diff options
author | Zac Medico <zmedico@gentoo.org> | 2008-02-12 04:08:33 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2008-02-12 04:08:33 +0000 |
commit | 78a733f6f39e17b72194c1e2dd21d3920ed018e2 (patch) | |
tree | f776943cbe6e2a91c6f40711fbb0bbd08f99c621 | |
parent | bb9c2261b5b9ccb0e30dece55365187438773c76 (diff) | |
download | portage-78a733f6f39e17b72194c1e2dd21d3920ed018e2.tar.gz portage-78a733f6f39e17b72194c1e2dd21d3920ed018e2.tar.bz2 portage-78a733f6f39e17b72194c1e2dd21d3920ed018e2.zip |
Bug #209768 - Fix --search "Size of files:" handling so that it properly
shows the "Unknown (missing digest)" message instead of a traceback.
svn path=/main/trunk/; revision=9333
-rw-r--r-- | pym/_emerge/__init__.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/pym/_emerge/__init__.py b/pym/_emerge/__init__.py index 462410c3b..e5e48fe48 100644 --- a/pym/_emerge/__init__.py +++ b/pym/_emerge/__init__.py @@ -650,6 +650,7 @@ class search(object): myversion = self.getVersion(full_package, search.VERSION_RELEASE) mysum = [0,0] + file_size_str = None mycat = match.split("/")[0] mypkg = match.split("/")[1] mycpv = match + "-" + myversion @@ -664,7 +665,7 @@ class search(object): try: mysum[0] = mf.getDistfilesSize(fetchlist) except KeyError, e: - mysum[0] = "Unknown (missing digest for %s)" % \ + file_size_str = "Unknown (missing digest for %s)" % \ str(e) available = False @@ -680,13 +681,13 @@ class search(object): myebuild = None break - if myebuild: + if myebuild and file_size_str is None: mystr = str(mysum[0] / 1024) mycount = len(mystr) while (mycount > 3): mycount -= 3 mystr = mystr[:mycount] + "," + mystr[mycount:] - mysum[0] = mystr + " kB" + file_size_str = mystr + " kB" if self.verbose: if available: @@ -694,7 +695,7 @@ class search(object): print " ", self.getInstallationStatus(mycat+'/'+mypkg) if myebuild: print " %s %s" % \ - (darkgreen("Size of files:"), mysum[0]) + (darkgreen("Size of files:"), file_size_str) print " ", darkgreen("Homepage:")+" ",homepage print " ", darkgreen("Description:")+" ",desc print " ", darkgreen("License:")+" ",license |