diff options
author | Zac Medico <zmedico@gentoo.org> | 2009-08-04 06:18:13 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2009-08-04 06:18:13 +0000 |
commit | 1c6aec2925776edc6694c660877dd2b7a9ac7111 (patch) | |
tree | 862f7e59d3ad1efa4010ff7d8ec95caa955b2c56 | |
parent | 25b8d5924494e0937df07c8510d8b30cf7488686 (diff) | |
download | portage-1c6aec2925776edc6694c660877dd2b7a9ac7111.tar.gz portage-1c6aec2925776edc6694c660877dd2b7a9ac7111.tar.bz2 portage-1c6aec2925776edc6694c660877dd2b7a9ac7111.zip |
Fix a regression caused by the code from bug #278729, which causes incorrect
preference evaluation for cases like kde-base/nepomuk:
|| (
>=dev-libs/soprano-2.3.0[clucene,dbus,raptor,redland]
>=dev-libs/soprano-2.3.0[clucene,dbus,raptor,java]
)
In cases like this we need to prefer the choice which is already satisfied
by current USE configuration. Thanks to Maciej Mrozowski <reavertm@poczta.fm>
for reporting.
svn path=/main/trunk/; revision=13888
-rw-r--r-- | pym/portage/__init__.py | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/pym/portage/__init__.py b/pym/portage/__init__.py index a327bd644..6f79a5540 100644 --- a/pym/portage/__init__.py +++ b/pym/portage/__init__.py @@ -7138,6 +7138,7 @@ def dep_zapdeps(unreduced, reduced, myroot, use_binaries=0, trees=None): continue all_available = True + all_use_satisfied = True versions = {} for atom in atoms: if atom[:1] == "!": @@ -7153,9 +7154,21 @@ def dep_zapdeps(unreduced, reduced, myroot, use_binaries=0, trees=None): all_available = False break + if atom.use: + avail_pkg_use = mydbapi.match(atom) + if not avail_pkg_use: + all_use_satisfied = False + else: + # highest (ascending order) + avail_pkg_use = avail_pkg_use[-1] + if avail_pkg_use != avail_pkg: + avail_pkg = avail_pkg_use + avail_slot = "%s:%s" % (dep_getkey(atom), + mydbapi.aux_get(avail_pkg, ["SLOT"])[0]) + versions[avail_slot] = avail_pkg - this_choice = (atoms, versions, all_available) + this_choice = (atoms, versions, all_available, all_use_satisfied) if all_available: # The "all installed" criterion is not version or slot specific. # If any version of a package is already in the graph then we @@ -7229,9 +7242,12 @@ def dep_zapdeps(unreduced, reduced, myroot, use_binaries=0, trees=None): preferred_any_slot + preferred_non_installed + other for allow_masked in (False, True): - for atoms, versions, all_available in preferred: - if all_available or allow_masked: - return atoms + for allow_unsatisfied_use in (False, True): + for atoms, versions, all_available, all_use_satisfied in preferred: + if all_use_satisfied or \ + (all_available and allow_unsatisfied_use) \ + or allow_masked: + return atoms assert(False) # This point should not be reachable |