From 5f6b887f309a2aa369d08028e976163224d9b988 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Fri, 23 Mar 2007 01:27:16 +0000 Subject: For bug #171840, consider all choices for slot intersection and promote those that have upgrades relative to other choices. (trunk r6266:6267) svn path=/main/branches/2.1.2/; revision=6268 --- pym/portage.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'pym') diff --git a/pym/portage.py b/pym/portage.py index ea702dd25..5b2ef1a6a 100644 --- a/pym/portage.py +++ b/pym/portage.py @@ -4228,10 +4228,15 @@ 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. - for possible_upgrade in list(possible_upgrades): + preferred.extend(possible_upgrades) + possible_upgrades = preferred[1:] + for possible_upgrade in possible_upgrades: atoms, versions, all_available = possible_upgrade myslots = set(versions) for other_choice in preferred: + if possible_upgrade is other_choice: + # possible_upgrade will not be promoted, so move on + break o_atoms, o_versions, o_all_available = other_choice intersecting_slots = myslots.intersection(o_versions) if not intersecting_slots: @@ -4248,11 +4253,10 @@ def dep_zapdeps(unreduced, reduced, myroot, use_binaries=0, trees=None): has_downgrade = True break if has_upgrade and not has_downgrade: + preferred.remove(possible_upgrade) o_index = preferred.index(other_choice) preferred.insert(o_index, possible_upgrade) - possible_upgrades.remove(possible_upgrade) break - preferred.extend(possible_upgrades) # preferred now contains a) and c) from the order above with # the masked flag differentiating the two. other contains b) -- cgit v1.2.3-1-g7c22