summaryrefslogtreecommitdiffstats
path: root/pym/portage.py
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2008-04-16 22:31:23 +0000
committerZac Medico <zmedico@gentoo.org>2008-04-16 22:31:23 +0000
commit8dbaadf6621aa872e7ea35c136271f0c16da41df (patch)
tree10dad8329955a9af46ad43b696bb7e4061e6228c /pym/portage.py
parent13185ed903957683254bedac2862110cddf348d4 (diff)
downloadportage-8dbaadf6621aa872e7ea35c136271f0c16da41df.tar.gz
portage-8dbaadf6621aa872e7ea35c136271f0c16da41df.tar.bz2
portage-8dbaadf6621aa872e7ea35c136271f0c16da41df.zip
Remove redundant version sorting in _expand_new_virtuals() since the
dbapi match results are already sorted. (trunk r9920) svn path=/main/branches/2.1.2/; revision=9921
Diffstat (limited to 'pym/portage.py')
-rw-r--r--pym/portage.py21
1 files changed, 6 insertions, 15 deletions
diff --git a/pym/portage.py b/pym/portage.py
index aa8aa946f..2ded6dce1 100644
--- a/pym/portage.py
+++ b/pym/portage.py
@@ -5306,8 +5306,6 @@ def _expand_new_virtuals(mysplit, edebug, mydbapi, mysettings, myroot="/",
# According to GLEP 37, RDEPEND is the only dependency type that is valid
# for new-style virtuals. Repoman should enforce this.
dep_keys = ["RDEPEND", "DEPEND", "PDEPEND"]
- def compare_pkgs(a, b):
- return pkgcmp(b[1], a[1])
portdb = trees[myroot]["porttree"].dbapi
if kwargs["use_binaries"]:
portdb = trees[myroot]["bintree"].dbapi
@@ -5333,19 +5331,14 @@ def _expand_new_virtuals(mysplit, edebug, mydbapi, mysettings, myroot="/",
match_atom = x
if isblocker:
match_atom = x[1:]
- pkgs = {}
- for cpv in portdb.match(match_atom):
+ pkgs = []
+ matches = portdb.match(match_atom)
+ # Use descending order to prefer higher versions.
+ matches.reverse()
+ for cpv in matches:
# only use new-style matches
if cpv.startswith("virtual/"):
- pkgs[cpv] = (cpv, catpkgsplit(cpv)[1:], portdb)
- if kwargs["use_binaries"] and "vartree" in trees[myroot]:
- vardb = trees[myroot]["vartree"].dbapi
- for cpv in vardb.match(match_atom):
- # only use new-style matches
- if cpv.startswith("virtual/"):
- if cpv in pkgs:
- continue
- pkgs[cpv] = (cpv, catpkgsplit(cpv)[1:], vardb)
+ pkgs.append((cpv, catpkgsplit(cpv)[1:], portdb))
if not (pkgs or mychoices):
# This one couldn't be expanded as a new-style virtual. Old-style
# virtuals have already been expanded by dep_virtual, so this one
@@ -5357,8 +5350,6 @@ def _expand_new_virtuals(mysplit, edebug, mydbapi, mysettings, myroot="/",
if not pkgs and len(mychoices) == 1:
newsplit.append(x.replace(mykey, mychoices[0]))
continue
- pkgs = pkgs.values()
- pkgs.sort(compare_pkgs) # Prefer higher versions.
if isblocker:
a = []
else: