Catch a KeyError and notify the user of a missing digest for bug #132373.
authorZac Medico <zmedico@gentoo.org>
Fri, 5 May 2006 21:04:04 +0000 (21:04 -0000)
committerZac Medico <zmedico@gentoo.org>
Fri, 5 May 2006 21:04:04 +0000 (21:04 -0000)
svn path=/main/trunk/; revision=3321

bin/emerge

index c74d949ff6683de38a6b8f579ff9bf26365b937d..404e720d653754a8d12ac73832f08f71b76a1927 100755 (executable)
@@ -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