Gentoo Archives: gentoo-commits

From: "Zac Medico (zmedico)" <zmedico@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] portage r9920 - main/trunk/pym/portage
Date: Wed, 16 Apr 2008 22:29:24
Message-Id: E1JmG81-0001Yz-St@stork.gentoo.org
1 Author: zmedico
2 Date: 2008-04-16 22:29:20 +0000 (Wed, 16 Apr 2008)
3 New Revision: 9920
4
5 Modified:
6 main/trunk/pym/portage/__init__.py
7 Log:
8 Remove redundant version sorting in _expand_new_virtuals() since the
9 dbapi match results are already sorted.
10
11
12 Modified: main/trunk/pym/portage/__init__.py
13 ===================================================================
14 --- main/trunk/pym/portage/__init__.py 2008-04-16 18:09:27 UTC (rev 9919)
15 +++ main/trunk/pym/portage/__init__.py 2008-04-16 22:29:20 UTC (rev 9920)
16 @@ -5309,8 +5309,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 @@ -5336,19 +5334,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 @@ -5360,8 +5353,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