diff options
Diffstat (limited to 'DistUpgrade/DistUpgradeCache.py')
| -rw-r--r-- | DistUpgrade/DistUpgradeCache.py | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/DistUpgrade/DistUpgradeCache.py b/DistUpgrade/DistUpgradeCache.py index c8e1e9a1..c7cb89f3 100644 --- a/DistUpgrade/DistUpgradeCache.py +++ b/DistUpgrade/DistUpgradeCache.py @@ -107,7 +107,31 @@ class MyCache(apt.Cache): _("A unresolvable problem occured while " "calculating the upgrade. Please report " "this as a bug. ")) - logging.debug("Dist-upgrade failed: '%s'", e) + logging.error("Dist-upgrade failed: '%s'", e) + return False + + # check the trust of the packages that are going to change + untrusted = [] + for pkg in self.getChanges(): + if pkg.markedDelete: + continue + origins = pkg.candidateOrigin + trusted = False + for origin in origins: + trusted |= origin.trusted + if not trusted: + untrusted.append(pkg.name) + if len(untrusted) > 0: + untrusted.sort() + logging.error("Unauthenticated packages found: '%s'" % \ + " ".join(untrusted)) + # FIXME: maybe ask a question here? instead of failing? + view.error(_("Error authenticating some packages"), + _("It was not possible to authenticate some " + "packages. This may be a transient network problem. " + "You may want to try again later. See below for a " + "list of unauthenticated packages."), + "\n".join(untrusted)) return False return True @@ -119,6 +143,9 @@ class MyCache(apt.Cache): if pkg.markedDelete and self._inRemovalBlacklist(pkg.name): logging.debug("The package '%s' is marked for removal but it's in the removal blacklist", pkg.name) return False + if pkg.markedDelete and pkg._pkg.Essential == True: + logging.debug("The package '%s' is marked for removal but it's a ESSENTIAL package", pkg.name) + return False return True def _installMetaPkgs(self, view): |
