diff options
| author | Michael Vogt <michael.vogt@ubuntu.com> | 2006-01-25 11:55:54 +0100 |
|---|---|---|
| committer | Michael Vogt <michael.vogt@ubuntu.com> | 2006-01-25 11:55:54 +0100 |
| commit | 03c8611b39e82f89b612ae78f0ae59691d628164 (patch) | |
| tree | 767236777c0b078018abb6bcb34cae8f17e7e2e7 /DistUpgrade/DistUpgradeCache.py | |
| parent | 9a25b192d880aa9d90c0293eff16415646d41710 (diff) | |
| download | python-apt-03c8611b39e82f89b612ae78f0ae59691d628164.tar.gz | |
* check authentication status and fail on unauthenticated upgrades
Diffstat (limited to 'DistUpgrade/DistUpgradeCache.py')
| -rw-r--r-- | DistUpgrade/DistUpgradeCache.py | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/DistUpgrade/DistUpgradeCache.py b/DistUpgrade/DistUpgradeCache.py index 2417a364..abe11d3b 100644 --- a/DistUpgrade/DistUpgradeCache.py +++ b/DistUpgrade/DistUpgradeCache.py @@ -109,6 +109,27 @@ class MyCache(apt.Cache): "this as a bug. ")) logging.debug("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: + # 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 def _verifyChanges(self): |
