summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2007-04-05 20:46:31 +0000
committerZac Medico <zmedico@gentoo.org>2007-04-05 20:46:31 +0000
commit62551a66cc82cfdc426fd533883674035622b4d6 (patch)
tree2c1ec9a1ce90f05f7d3ee30b9fe0b9f66c6814e5
parent225de51d6c0b8a44e8750b812ad784e5d5d96caf (diff)
downloadportage-62551a66cc82cfdc426fd533883674035622b4d6.tar.gz
portage-62551a66cc82cfdc426fd533883674035622b4d6.tar.bz2
portage-62551a66cc82cfdc426fd533883674035622b4d6.zip
Punt the sorted_versions() function in favor of list.sort(vercmp).
svn path=/main/trunk/; revision=6339
-rw-r--r--pym/emerge/__init__.py39
1 files changed, 7 insertions, 32 deletions
diff --git a/pym/emerge/__init__.py b/pym/emerge/__init__.py
index e872f5443..980eff386 100644
--- a/pym/emerge/__init__.py
+++ b/pym/emerge/__init__.py
@@ -151,32 +151,6 @@ def userquery(prompt, responses=None, colours=None):
print "Interrupted."
sys.exit(1)
-def sorted_versions(verlist):
- ret = []
- for ver in verlist:
- verparts = ver.split("-")
- if len(verparts) == 2:
- verrev = int(verparts[1][1:])
- else:
- verrev = 0
- x = 0
- while x < len(ret):
- retparts = ret[x].split("-")
- verdiff = portage.vercmp(retparts[0], verparts[0])
- if verdiff > 0:
- break
- elif verdiff == 0:
- if len(retparts) == 2:
- retrev = int(retparts[1][1:])
- else:
- retrev = 0
- if retrev >= verrev:
- break
- x += 1
- ret.insert(x, ver)
- return ret
-
-
actions=[
"clean", "config", "depclean",
"info", "metadata",
@@ -4533,15 +4507,16 @@ def action_info(settings, trees, myopts, myfiles):
for x in myvars:
if portage.isvalidatom(x):
pkg_matches = trees["/"]["vartree"].dbapi.match(x)
+ pkg_matches = [portage.catpkgsplit(cpv)[1:] for cpv in pkg_matches]
+ pkg_matches.sort(portage.pkgcmp)
pkgs = []
- for y in pkg_matches:
- mycpv = portage.catpkgsplit(y)
- if(mycpv[3] != "r0"):
- pkgs += [mycpv[2] + "-" + mycpv[3]]
+ for pn, ver, rev in pkg_matches:
+ if rev != "r0":
+ pkgs.append(ver + "-" + rev)
else:
- pkgs += [mycpv[2]]
+ pkgs.append(ver)
if pkgs:
- pkgs = ", ".join(sorted_versions(pkgs))
+ pkgs = ", ".join(pkgs)
print "%-20s %s" % (x+":", pkgs)
else:
print "%-20s %s" % (x+":", "[NOT VALID]")