summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2007-04-24 06:55:54 +0000
committerZac Medico <zmedico@gentoo.org>2007-04-24 06:55:54 +0000
commit71a091068c5ca8f25cf2d2be57105b9e27f11f62 (patch)
tree23affda5e54c893a9a41d45d5a2d6cb0b3450ab1
parenta3d5e273e9c3ace7b5c341a18e3216f3a883cea0 (diff)
downloadportage-71a091068c5ca8f25cf2d2be57105b9e27f11f62.tar.gz
portage-71a091068c5ca8f25cf2d2be57105b9e27f11f62.tar.bz2
portage-71a091068c5ca8f25cf2d2be57105b9e27f11f62.zip
For bug #175781, add a higher preference priority for choices where all matching slots are installed (not just any slot).
svn path=/main/trunk/; revision=6432
-rw-r--r--pym/portage/__init__.py16
1 files changed, 15 insertions, 1 deletions
diff --git a/pym/portage/__init__.py b/pym/portage/__init__.py
index 2e385c95b..b9af08eb3 100644
--- a/pym/portage/__init__.py
+++ b/pym/portage/__init__.py
@@ -4209,6 +4209,7 @@ def dep_zapdeps(unreduced, reduced, myroot, use_binaries=0, trees=None):
# d) is the first item
preferred = []
+ preferred_any_slot = []
possible_upgrades = []
other = []
@@ -4262,8 +4263,20 @@ def dep_zapdeps(unreduced, reduced, myroot, use_binaries=0, trees=None):
if not vardb.match(atom) and not atom.startswith("virtual/"):
all_installed = False
break
+ all_installed_slots = False
if all_installed:
- preferred.append(this_choice)
+ all_installed_slots = True
+ for slot_atom in versions:
+ # New-style virtuals have zero cost to install.
+ if not vardb.match(slot_atom) and \
+ not slot_atom.startswith("virtual/"):
+ all_installed_slots = False
+ break
+ if all_installed:
+ if all_installed_slots:
+ preferred.append(this_choice)
+ else:
+ preferred_any_slot.append(this_choice)
else:
possible_upgrades.append(this_choice)
else:
@@ -4275,6 +4288,7 @@ def dep_zapdeps(unreduced, reduced, myroot, use_binaries=0, trees=None):
# into || ( highest version ... lowest version ). We want to prefer the
# highest all_available version of the new-style virtual when there is a
# lower all_installed version.
+ preferred.extend(preferred_any_slot)
preferred.extend(possible_upgrades)
possible_upgrades = preferred[1:]
for possible_upgrade in possible_upgrades: