Handle InvalidDependString from portdbapi.getFetchMap() inside
authorZac Medico <zmedico@gentoo.org>
Tue, 30 Sep 2008 15:16:03 +0000 (15:16 -0000)
committerZac Medico <zmedico@gentoo.org>
Tue, 30 Sep 2008 15:16:03 +0000 (15:16 -0000)
search.output(). Thanks to agaffney for reporting.

svn path=/main/trunk/; revision=11602

pym/_emerge/__init__.py

index ac168bd1f0c139f33e3d632f942302d4d6113008..87269a135907870472a7095c1a79497be9b702ae 100644 (file)
@@ -684,12 +684,18 @@ class search(object):
                                                from portage import manifest
                                                mf = manifest.Manifest(
                                                        pkgdir, self.settings["DISTDIR"])
-                                               fetchlist = self.portdb.getFetchMap(mycpv)
                                                try:
-                                                       mysum[0] = mf.getDistfilesSize(fetchlist)
-                                               except KeyError, e:
-                                                       file_size_str = "Unknown (missing digest for %s)" % \
-                                                               str(e)
+                                                       uri_map = self.portdb.getFetchMap(mycpv)
+                                               except portage.exception.InvalidDependString, e:
+                                                       file_size_str = "Unknown (%s)" % (e,)
+                                                       del e
+                                               else:
+                                                       try:
+                                                               mysum[0] = mf.getDistfilesSize(uri_map)
+                                                       except KeyError, e:
+                                                               file_size_str = "Unknown (missing " + \
+                                                                       "digest for %s)" % (e,)
+                                                               del e
 
                                        available = False
                                        for db in self._dbs: