diff options
Diffstat (limited to 'UpdateManager')
| -rw-r--r-- | UpdateManager/Common/DistInfo.py | 13 | ||||
| -rw-r--r-- | UpdateManager/Common/aptsources.py | 2 | ||||
| -rw-r--r-- | UpdateManager/DistUpgradeFetcher.py | 2 | ||||
| -rw-r--r-- | UpdateManager/UpdateManager.py | 27 |
4 files changed, 29 insertions, 15 deletions
diff --git a/UpdateManager/Common/DistInfo.py b/UpdateManager/Common/DistInfo.py index 83603ed9..8153f04b 100644 --- a/UpdateManager/Common/DistInfo.py +++ b/UpdateManager/Common/DistInfo.py @@ -116,11 +116,14 @@ class DistInfo: elif field == 'MatchURI': suite.match_uri = value elif field == 'MirrorsFile': - suite.valid_mirrors = filter(lambda s: - ((s != "") and - (not s.startswith("#"))), - map(string.strip, - open(value))) + if os.path.exists(value): + suite.valid_mirrors = filter(lambda s: + ((s != "") and + (not s.startswith("#"))), + map(string.strip, + open(value))) + else: + print "WARNING: can't read '%s'" % value elif field == 'Description': suite.description = _(value) elif field == 'Component': diff --git a/UpdateManager/Common/aptsources.py b/UpdateManager/Common/aptsources.py index 81b65cfa..836b8fae 100644 --- a/UpdateManager/Common/aptsources.py +++ b/UpdateManager/Common/aptsources.py @@ -396,7 +396,7 @@ class SourceEntryMatcher: f = os.path.basename(f) i = f.find(".info") f = f[0:i] - dist = DistInfo(f) + dist = DistInfo(f,base_dir=matcherPath) for suite in dist.suites: if suite.match_uri != None: self.templates.append(suite) diff --git a/UpdateManager/DistUpgradeFetcher.py b/UpdateManager/DistUpgradeFetcher.py index af07cfb4..cda27e2f 100644 --- a/UpdateManager/DistUpgradeFetcher.py +++ b/UpdateManager/DistUpgradeFetcher.py @@ -219,7 +219,7 @@ class DistUpgradeFetcher(object): if not self.verifyDistUprader(): error(self.window_main, _("Verfication failed"), - _("Verfing the upgrade failed. There may be a problem " + _("Verifying the upgrade failed. There may be a problem " "with the network or with the server. ")) self.cleanup() return diff --git a/UpdateManager/UpdateManager.py b/UpdateManager/UpdateManager.py index f4c34ada..63d0eab9 100644 --- a/UpdateManager/UpdateManager.py +++ b/UpdateManager/UpdateManager.py @@ -33,8 +33,11 @@ try: except: import fakegconf as gconf import gobject +import warnings +warnings.filterwarnings("ignore", "apt API not stable yet", FutureWarning) import apt import apt_pkg + import gettext import copy import string @@ -120,7 +123,7 @@ class MyCache(apt.Cache): # don't touch the gui in this function, it needs to be thread-safe pkg = self[name] - # get the src package name + # get the src package name srcpkg = pkg.sourcePackageName # assume "main" section @@ -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 @@ -146,6 +150,9 @@ class MyCache(apt.Cache): #print "srcver: %s" % srcver section = srcrecords.Section #print "srcsect: %s" % section + else: + # fail into the error handler + raise SystemError except SystemError, e: srcver = binver @@ -225,13 +232,12 @@ class UpdateList: dist = pipe.read().strip() del pipe - templates = [("%s-security" % dist, "Ubuntu", _("Important security updates" - " of Ubuntu"), 10), - ("%s-updates" % dist, "Ubuntu", _("Recommended updates of " - "Ubuntu"), 9), - ("%s-proposed" % dist, "Ubuntu", _("Proposed updates for Ubuntu"), 8), - ("%s-backports" % dist, "Ubuntu", _("Backports of Ubuntu"), 7), - (dist, "Ubuntu", _("Updates of Ubuntu"), 6)] + templates = [("%s-security" % dist, "Ubuntu", _("Important security updates") + , 10), + ("%s-updates" % dist, "Ubuntu", _("Recommended updates"), 9), + ("%s-proposed" % dist, "Ubuntu", _("Proposed updates"), 8), + ("%s-backports" % dist, "Ubuntu", _("Backports"), 7), + (dist, "Ubuntu", _("Normal updates"), 6)] self.pkgs = {} self.matcher = {} @@ -249,6 +255,11 @@ class UpdateList: # sort by origin for pkg in cache: if pkg.isUpgradable: + if pkg.candidateOrigin == None: + # can happen for e.g. loged packages + # FIXME: do something more sensible here (but what?) + print "WARNING: upgradable but no canidateOrigin?!?: ", pkg.name + continue # TRANSLATORS: updates from an 'unknown' origin originstr = _("Other updates") for aorigin in pkg.candidateOrigin: |
