Gentoo Archives: gentoo-commits

From: "Zac Medico (zmedico)" <zmedico@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] portage r13888 - main/trunk/pym/portage
Date: Tue, 04 Aug 2009 06:18:16
Message-Id: E1MYDLi-0000z1-09@stork.gentoo.org
1 Author: zmedico
2 Date: 2009-08-04 06:18:13 +0000 (Tue, 04 Aug 2009)
3 New Revision: 13888
4
5 Modified:
6 main/trunk/pym/portage/__init__.py
7 Log:
8 Fix a regression caused by the code from bug #278729, which causes incorrect
9 preference evaluation for cases like kde-base/nepomuk:
10 || (
11 >=dev-libs/soprano-2.3.0[clucene,dbus,raptor,redland]
12 >=dev-libs/soprano-2.3.0[clucene,dbus,raptor,java]
13 )
14
15 In cases like this we need to prefer the choice which is already satisfied
16 by current USE configuration. Thanks to Maciej Mrozowski <reavertm@××××××.fm>
17 for reporting.
18
19
20 Modified: main/trunk/pym/portage/__init__.py
21 ===================================================================
22 --- main/trunk/pym/portage/__init__.py 2009-08-04 01:24:48 UTC (rev 13887)
23 +++ main/trunk/pym/portage/__init__.py 2009-08-04 06:18:13 UTC (rev 13888)
24 @@ -7138,6 +7138,7 @@
25 continue
26
27 all_available = True
28 + all_use_satisfied = True
29 versions = {}
30 for atom in atoms:
31 if atom[:1] == "!":
32 @@ -7153,9 +7154,21 @@
33 all_available = False
34 break
35
36 + if atom.use:
37 + avail_pkg_use = mydbapi.match(atom)
38 + if not avail_pkg_use:
39 + all_use_satisfied = False
40 + else:
41 + # highest (ascending order)
42 + avail_pkg_use = avail_pkg_use[-1]
43 + if avail_pkg_use != avail_pkg:
44 + avail_pkg = avail_pkg_use
45 + avail_slot = "%s:%s" % (dep_getkey(atom),
46 + mydbapi.aux_get(avail_pkg, ["SLOT"])[0])
47 +
48 versions[avail_slot] = avail_pkg
49
50 - this_choice = (atoms, versions, all_available)
51 + this_choice = (atoms, versions, all_available, all_use_satisfied)
52 if all_available:
53 # The "all installed" criterion is not version or slot specific.
54 # If any version of a package is already in the graph then we
55 @@ -7229,9 +7242,12 @@
56 preferred_any_slot + preferred_non_installed + other
57
58 for allow_masked in (False, True):
59 - for atoms, versions, all_available in preferred:
60 - if all_available or allow_masked:
61 - return atoms
62 + for allow_unsatisfied_use in (False, True):
63 + for atoms, versions, all_available, all_use_satisfied in preferred:
64 + if all_use_satisfied or \
65 + (all_available and allow_unsatisfied_use) \
66 + or allow_masked:
67 + return atoms
68
69 assert(False) # This point should not be reachable