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 | |
| parent | 9a25b192d880aa9d90c0293eff16415646d41710 (diff) | |
| download | python-apt-03c8611b39e82f89b612ae78f0ae59691d628164.tar.gz | |
* check authentication status and fail on unauthenticated upgrades
Diffstat (limited to 'DistUpgrade')
| -rw-r--r-- | DistUpgrade/DistUpgradeCache.py | 21 | ||||
| -rw-r--r-- | DistUpgrade/TODO | 5 |
2 files changed, 25 insertions, 1 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): diff --git a/DistUpgrade/TODO b/DistUpgrade/TODO index ab516769..fa31c041 100644 --- a/DistUpgrade/TODO +++ b/DistUpgrade/TODO @@ -28,5 +28,8 @@ Robustness: get all the metaIndexes in sources.list, nor a way to get the pkgIndexFiles from the metaIndexes (metaIndex is not available in python-apt at all) - + What we could do is to write DistUpgradeCache.update(), check the + DescURI for each failed item and guess from it what sources.list + line failed (e.g. uri.endswith("Sources{.bz2|.gz") -> deb-src, get + base-uri, find 'dists' in uri etc)
\ No newline at end of file |
