Gentoo Archives: gentoo-commits

From: "Zac Medico (zmedico)" <zmedico@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] portage r9665 - main/trunk/pym/portage
Date: Tue, 01 Apr 2008 18:08:09
Message-Id: E1Jgktz-0004tH-1c@stork.gentoo.org
1 Author: zmedico
2 Date: 2008-04-01 18:08:06 +0000 (Tue, 01 Apr 2008)
3 New Revision: 9665
4
5 Modified:
6 main/trunk/pym/portage/__init__.py
7 Log:
8 Exploid ascending order returned from dbapi.match() calls to avoid the need
9 to call best().
10
11
12 Modified: main/trunk/pym/portage/__init__.py
13 ===================================================================
14 --- main/trunk/pym/portage/__init__.py 2008-04-01 16:59:56 UTC (rev 9664)
15 +++ main/trunk/pym/portage/__init__.py 2008-04-01 18:08:06 UTC (rev 9665)
16 @@ -5378,8 +5378,9 @@
17 all_available = True
18 versions = {}
19 for atom in atoms:
20 - avail_pkg = best(mydbapi.match(atom))
21 + avail_pkg = mydbapi.match(atom)
22 if avail_pkg:
23 + avail_pkg = avail_pkg[-1] # highest (ascending order)
24 avail_slot = "%s:%s" % (dep_getkey(atom),
25 mydbapi.aux_get(avail_pkg, ["SLOT"])[0])
26 elif not avail_pkg:
27 @@ -5387,8 +5388,9 @@
28 if hasattr(mydbapi, "xmatch"):
29 has_mask = bool(mydbapi.xmatch("match-all", atom))
30 if (selective or use_binaries or not has_mask):
31 - avail_pkg = best(vardb.match(atom))
32 + avail_pkg = vardb.match(atom)
33 if avail_pkg:
34 + avail_pkg = avail_pkg[-1] # highest (ascending order)
35 avail_slot = "%s:%s" % (dep_getkey(atom),
36 vardb.aux_get(avail_pkg, ["SLOT"])[0])
37 if not avail_pkg:
38
39 --
40 gentoo-commits@l.g.o mailing list