summaryrefslogtreecommitdiffstats
path: root/pym
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2007-04-24 06:58:16 +0000
committerZac Medico <zmedico@gentoo.org>2007-04-24 06:58:16 +0000
commit9fd1b8775135485566749b78f24dfac2c26119ea (patch)
tree9e49e9266b6394e9e0b5186507ffddd452a4bc7e /pym
parent1326c0b61a60864724baa4d841a89f3f8e20b676 (diff)
downloadportage-9fd1b8775135485566749b78f24dfac2c26119ea.tar.gz
portage-9fd1b8775135485566749b78f24dfac2c26119ea.tar.bz2
portage-9fd1b8775135485566749b78f24dfac2c26119ea.zip
For bug #175781, add a higher preference priority for choices where all matching slots are installed (not just any slot). (trunk r6431:6432)
svn path=/main/branches/2.1.2/; revision=6433
Diffstat (limited to 'pym')
-rw-r--r--pym/portage.py16
1 files changed, 15 insertions, 1 deletions
diff --git a/pym/portage.py b/pym/portage.py
index 97a942f37..ab5e984c1 100644
--- a/pym/portage.py
+++ b/pym/portage.py
@@ -4156,6 +4156,7 @@ def dep_zapdeps(unreduced, reduced, myroot, use_binaries=0, trees=None):
# d) is the first item
preferred = []
+ preferred_any_slot = []
possible_upgrades = []
other = []
@@ -4209,8 +4210,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:
@@ -4222,6 +4235,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: