1 |
Author: zmedico |
2 |
Date: 2008-04-16 22:31:23 +0000 (Wed, 16 Apr 2008) |
3 |
New Revision: 9921 |
4 |
|
5 |
Modified: |
6 |
main/branches/2.1.2/pym/portage.py |
7 |
Log: |
8 |
Remove redundant version sorting in _expand_new_virtuals() since the |
9 |
dbapi match results are already sorted. (trunk r9920) |
10 |
|
11 |
|
12 |
Modified: main/branches/2.1.2/pym/portage.py |
13 |
=================================================================== |
14 |
--- main/branches/2.1.2/pym/portage.py 2008-04-16 22:29:20 UTC (rev 9920) |
15 |
+++ main/branches/2.1.2/pym/portage.py 2008-04-16 22:31:23 UTC (rev 9921) |
16 |
@@ -5306,8 +5306,6 @@ |
17 |
# According to GLEP 37, RDEPEND is the only dependency type that is valid |
18 |
# for new-style virtuals. Repoman should enforce this. |
19 |
dep_keys = ["RDEPEND", "DEPEND", "PDEPEND"] |
20 |
- def compare_pkgs(a, b): |
21 |
- return pkgcmp(b[1], a[1]) |
22 |
portdb = trees[myroot]["porttree"].dbapi |
23 |
if kwargs["use_binaries"]: |
24 |
portdb = trees[myroot]["bintree"].dbapi |
25 |
@@ -5333,19 +5331,14 @@ |
26 |
match_atom = x |
27 |
if isblocker: |
28 |
match_atom = x[1:] |
29 |
- pkgs = {} |
30 |
- for cpv in portdb.match(match_atom): |
31 |
+ pkgs = [] |
32 |
+ matches = portdb.match(match_atom) |
33 |
+ # Use descending order to prefer higher versions. |
34 |
+ matches.reverse() |
35 |
+ for cpv in matches: |
36 |
# only use new-style matches |
37 |
if cpv.startswith("virtual/"): |
38 |
- pkgs[cpv] = (cpv, catpkgsplit(cpv)[1:], portdb) |
39 |
- if kwargs["use_binaries"] and "vartree" in trees[myroot]: |
40 |
- vardb = trees[myroot]["vartree"].dbapi |
41 |
- for cpv in vardb.match(match_atom): |
42 |
- # only use new-style matches |
43 |
- if cpv.startswith("virtual/"): |
44 |
- if cpv in pkgs: |
45 |
- continue |
46 |
- pkgs[cpv] = (cpv, catpkgsplit(cpv)[1:], vardb) |
47 |
+ pkgs.append((cpv, catpkgsplit(cpv)[1:], portdb)) |
48 |
if not (pkgs or mychoices): |
49 |
# This one couldn't be expanded as a new-style virtual. Old-style |
50 |
# virtuals have already been expanded by dep_virtual, so this one |
51 |
@@ -5357,8 +5350,6 @@ |
52 |
if not pkgs and len(mychoices) == 1: |
53 |
newsplit.append(x.replace(mykey, mychoices[0])) |
54 |
continue |
55 |
- pkgs = pkgs.values() |
56 |
- pkgs.sort(compare_pkgs) # Prefer higher versions. |
57 |
if isblocker: |
58 |
a = [] |
59 |
else: |
60 |
|
61 |
-- |
62 |
gentoo-commits@l.g.o mailing list |