summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2006-05-05 21:04:04 +0000
committerZac Medico <zmedico@gentoo.org>2006-05-05 21:04:04 +0000
commit88bbb1ac0e88b8d2024bbeebf1dfa06d75c20ea1 (patch)
treeb8be995fff64044af417a80b84756e42dcc4dde5
parentb991f0efbaf5c6b6a885876c3e4ddf7b0d9fe1ec (diff)
downloadportage-88bbb1ac0e88b8d2024bbeebf1dfa06d75c20ea1.tar.gz
portage-88bbb1ac0e88b8d2024bbeebf1dfa06d75c20ea1.tar.bz2
portage-88bbb1ac0e88b8d2024bbeebf1dfa06d75c20ea1.zip
Catch a KeyError and notify the user of a missing digest for bug #132373.
svn path=/main/trunk/; revision=3321
-rwxr-xr-xbin/emerge17
1 files changed, 10 insertions, 7 deletions
diff --git a/bin/emerge b/bin/emerge
index c74d949ff..404e720d6 100755
--- a/bin/emerge
+++ b/bin/emerge
@@ -800,13 +800,16 @@ class search:
pkgdir, portage.settings["DISTDIR"])
fetchlist = portage.portdb.getfetchlist(mycpv,
mysettings=portage.settings, all=True)[1]
- mysum[0] = mf.getDistfilesSize(fetchlist)
- mystr = str(mysum[0]/1024)
- mycount=len(mystr)
- while (mycount > 3):
- mycount-=3
- mystr=mystr[:mycount]+","+mystr[mycount:]
- mysum[0]=mystr+" kB"
+ try:
+ mysum[0] = mf.getDistfilesSize(fetchlist)
+ mystr = str(mysum[0]/1024)
+ mycount=len(mystr)
+ while (mycount > 3):
+ mycount-=3
+ mystr=mystr[:mycount]+","+mystr[mycount:]
+ mysum[0]=mystr+" kB"
+ except KeyError, e:
+ mysum[0] = "Unknown (missing digest for %s)" % str(e)
if "--quiet" not in myopts:
print " ", darkgreen("Latest version available:"),myversion