From c5c5f86db727831f68c93e7a388e4e2cb8491cb6 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Mon, 18 Sep 2006 16:51:08 +0200 Subject: * typo fixes (thanks to Bruce Cowan) --- DistUpgrade/DistUpgradeCache.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'DistUpgrade/DistUpgradeCache.py') diff --git a/DistUpgrade/DistUpgradeCache.py b/DistUpgrade/DistUpgradeCache.py index 680e7d9e..3c0efffa 100644 --- a/DistUpgrade/DistUpgradeCache.py +++ b/DistUpgrade/DistUpgradeCache.py @@ -155,7 +155,7 @@ class MyCache(apt.Cache): except SystemError, e: # FIXME: change the text to something more useful view.error(_("Could not calculate the upgrade"), - _("A unresolvable problem occured while " + _("A unresolvable problem occurred while " "calculating the upgrade.\n\n" "Please report this bug against the 'update-manager' " "package and include the files in /var/log/dist-upgrade/ " @@ -259,7 +259,7 @@ class MyCache(apt.Cache): "ubuntu-desktop, kubuntu-desktop or " "edubuntu-desktop package and it was not " "possible to detect which version of " - "ubuntu you are runing.\n " + "ubuntu you are running.\n " "Please install one of the packages " "above first using synaptic or " "apt-get before proceeding.")) -- cgit v1.2.3 From 1dd21dbda1eeee6daf6eaf4a2f7c4bf1ce25ce08 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Tue, 19 Sep 2006 11:35:13 +0200 Subject: * DistUpgrade/DistUpgradeCache.py, UpdateManager/UpdateManager.py: - filter out python-apt warnings * UpdateManager/UpdateManager.py: - make sure that src_ver is always initialized --- DistUpgrade/DistUpgradeCache.py | 1 + UpdateManager/UpdateManager.py | 4 ++++ debian/changelog | 9 +++++++++ 3 files changed, 14 insertions(+) (limited to 'DistUpgrade/DistUpgradeCache.py') diff --git a/DistUpgrade/DistUpgradeCache.py b/DistUpgrade/DistUpgradeCache.py index 3c0efffa..4b6fd680 100644 --- a/DistUpgrade/DistUpgradeCache.py +++ b/DistUpgrade/DistUpgradeCache.py @@ -1,6 +1,7 @@ import warnings warnings.filterwarnings("ignore", "apt API not stable yet", FutureWarning) +warnings.filterwarnings("ignore", "apt API not stable yet", FutureWarning) import apt import apt_pkg import os diff --git a/UpdateManager/UpdateManager.py b/UpdateManager/UpdateManager.py index 3fe9ad1e..0d70b56c 100644 --- a/UpdateManager/UpdateManager.py +++ b/UpdateManager/UpdateManager.py @@ -33,8 +33,11 @@ try: except: import fakegconf as gconf import gobject +from warnings import warn +warnings.filterwarnings("ignore", "apt API not stable yet", FutureWarning) import apt import apt_pkg + import gettext import copy import string @@ -130,6 +133,7 @@ class MyCache(apt.Cache): # get the source version, start with the binaries version binver = pkg.candidateVersion + srcver = pkg.candidateVersion #print "bin: %s" % binver try: # try to get the source version of the pkg, this differs diff --git a/debian/changelog b/debian/changelog index 0346d48e..7c759639 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,12 @@ +update-manager (0.44.13) edgy; urgency=low + + * UpdateManager/UpdateManager.py: + - make sure that src_ver is always initialized (thanks to + Simira for reporting) + - filter python-apt future warning (especially for seb128) + + -- + update-manager (0.44.12) edgy; urgency=low * DistUpgrade/DistUpgradeViewGtk.py: -- cgit v1.2.3 From 3c13b603ab6bb720861441a3992bff55831942bf Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Fri, 22 Sep 2006 19:07:42 +0200 Subject: * DistUpgrade/DistUpgradeCache.py: - add clear() function that is autoMark friendly * DistUpgrade/DistUpgradeControler.py: - bugfixes - pass the old arguments to the new execed child * DistUpgrade/dist-upgrade.py: - remove debug output --- DistUpgrade/DistUpgradeCache.py | 6 ++++-- DistUpgrade/DistUpgradeControler.py | 6 ++++-- DistUpgrade/dist-upgrade.py | 3 --- 3 files changed, 8 insertions(+), 7 deletions(-) (limited to 'DistUpgrade/DistUpgradeCache.py') diff --git a/DistUpgrade/DistUpgradeCache.py b/DistUpgrade/DistUpgradeCache.py index 4b6fd680..99f3b585 100644 --- a/DistUpgrade/DistUpgradeCache.py +++ b/DistUpgrade/DistUpgradeCache.py @@ -67,10 +67,12 @@ class MyCache(apt.Cache): if pkg.markedDelete: self.to_remove.append(pkg.name) + def clear(self): + self.depcache.Init() + def restore_snapshot(self): """ restore a snapshot """ - for pkg in self: - pkg.markKeep() + self.clear() for name in self.to_remove: pkg = self[name] pkg.markDelete() diff --git a/DistUpgrade/DistUpgradeControler.py b/DistUpgrade/DistUpgradeControler.py index 7d48db69..441952b2 100644 --- a/DistUpgrade/DistUpgradeControler.py +++ b/DistUpgrade/DistUpgradeControler.py @@ -557,15 +557,17 @@ class DistUpgradeControler(object): apt_pkg.Config.FindDir("Dir::Etc::sourceparts")) # run update self.doUpdate() + self.openCache() + # save cachedir and setup new one cachedir = apt_pkg.Config.Find("Dir::Cache::archives") cwd = os.getcwd() backportsdir = os.path.join(os.getcwd(),"backports") - os.chdir(backportsdir) if not os.path.exists(backportsdir): os.mkdir(backportsdir) if not os.path.exists(os.path.join(backportsdir,"partial")): os.mkdir(os.path.join(backportsdir,"partial")) + os.chdir(backportsdir) apt_pkg.Config.Set("Dir::Cache::archives",backportsdir) # mark the backports for upgrade and get them @@ -623,7 +625,7 @@ class DistUpgradeControler(object): os.getenv("PATH")) # now exec self again - os.execve(sys.argv[0],[sys.argv[0],"--have-backports"], os.environ) + os.execve(sys.argv[0],sys.argv+["--have-backports"], os.environ) # this is the core def edgyUpgrade(self): diff --git a/DistUpgrade/dist-upgrade.py b/DistUpgrade/dist-upgrade.py index 997297c2..7174ce17 100755 --- a/DistUpgrade/dist-upgrade.py +++ b/DistUpgrade/dist-upgrade.py @@ -9,9 +9,6 @@ from optparse import OptionParser if __name__ == "__main__": - # debug - print os.environ - parser = OptionParser() parser.add_option("-c", "--cdrom", dest="cdromPath", default=None, help="Use the given path to search for a cdrom with upgradable packages") -- cgit v1.2.3 From 3f8b06652b6bce05452cbbd7a6b916562a9762f1 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Sat, 23 Sep 2006 09:55:29 +0200 Subject: * DistUpgrade/DistUpgradeCache.py: - fix in clear() * UpdateManager/UpdateManager.py: - fixes in the new DistUpgrader code --- DistUpgrade/DistUpgradeCache.py | 7 ++++++- DistUpgrade/DistUpgradeControler.py | 14 +++++++++----- UpdateManager/UpdateManager.py | 2 +- 3 files changed, 16 insertions(+), 7 deletions(-) (limited to 'DistUpgrade/DistUpgradeCache.py') diff --git a/DistUpgrade/DistUpgradeCache.py b/DistUpgrade/DistUpgradeCache.py index 99f3b585..8427bb3d 100644 --- a/DistUpgrade/DistUpgradeCache.py +++ b/DistUpgrade/DistUpgradeCache.py @@ -68,7 +68,7 @@ class MyCache(apt.Cache): self.to_remove.append(pkg.name) def clear(self): - self.depcache.Init() + self._depcache.Init() def restore_snapshot(self): """ restore a snapshot """ @@ -318,3 +318,8 @@ class MyCache(apt.Cache): if foreign: foreign_pkgs.add(pkg.name) return foreign_pkgs + +if __name__ == "__main__": + import DistUpgradeConfigParser + c = MyCache(DistUpgradeConfigParser.DistUpgradeConfig(".")) + c.clear() diff --git a/DistUpgrade/DistUpgradeControler.py b/DistUpgrade/DistUpgradeControler.py index bcb54553..5217a990 100644 --- a/DistUpgrade/DistUpgradeControler.py +++ b/DistUpgrade/DistUpgradeControler.py @@ -107,11 +107,15 @@ class DistUpgradeControler(object): self._view.updateStatus(_("Reading cache")) self.cache = None - if self.options.withNetwork == None: + if not self.options or self.options.withNetwork == None: self.useNetwork = True else: self.useNetwork = self.options.withNetwork - self.aptcdrom = AptCdrom(distUpgradeView, options.cdromPath) + if options: + cdrompath = options.cdromPath + else: + cdrompath = None + self.aptcdrom = AptCdrom(distUpgradeView, cdrompath) # the configuration self.config = DistUpgradeConfig(datadir) @@ -143,7 +147,7 @@ class DistUpgradeControler(object): return False # FIXME: we may try to find out a bit more about the network # connection here and ask more inteligent questions - if self.aptcdrom and self.options.withNetwork == None: + if self.aptcdrom and self.options and self.options.withNetwork == None: res = self._view.askYesNoQuestion(_("Fetch data from the network for the upgrade?"), _("The upgrade can use the network to check " "the latest updates and to fetch packages that are not on the " @@ -422,7 +426,7 @@ class DistUpgradeControler(object): return res def doDistUpgrade(self): - if self.options.haveBackports: + if self.options and self.options.haveBackports: backportsdir = os.getcwd()+"/backports" apt_pkg.Config.Set("Dir::Bin::dpkg",backportsdir+"/usr/bin/dpkg"); currentRetry = 0 @@ -647,7 +651,7 @@ class DistUpgradeControler(object): if not self.prepare(): self.abort(1) - if self.options.haveBackports == False: + if selfoptions and self.options.haveBackports == False: # get backported packages (if needed) self.getRequiredBackports() diff --git a/UpdateManager/UpdateManager.py b/UpdateManager/UpdateManager.py index 0d70b56c..a609ab5e 100644 --- a/UpdateManager/UpdateManager.py +++ b/UpdateManager/UpdateManager.py @@ -33,7 +33,7 @@ try: except: import fakegconf as gconf import gobject -from warnings import warn +import warnings warnings.filterwarnings("ignore", "apt API not stable yet", FutureWarning) import apt import apt_pkg -- cgit v1.2.3