From: Zac Medico Date: Sat, 30 Dec 2006 04:11:33 +0000 (-0000) Subject: Improve the logic for bug #159360 to ensure that an actual upgrade is selected withou... X-Git-Tag: v2.1.2~190 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=63c8602f4596b6efd1ad0bd8222d2bd82498f8e0;p=portage.git Improve the logic for bug #159360 to ensure that an actual upgrade is selected without any downgrades. svn path=/main/trunk/; revision=5422 --- diff --git a/pym/portage.py b/pym/portage.py index 249252bb1..735920cf7 100644 --- a/pym/portage.py +++ b/pym/portage.py @@ -4030,15 +4030,18 @@ def dep_zapdeps(unreduced, reduced, myroot, use_binaries=0, trees=None): intersecting_slots = myslots.intersection(o_versions) if not intersecting_slots: continue - is_downgrade = False + has_upgrade = False + has_downgrade = False for myslot in intersecting_slots: myversion = versions[myslot] o_version = o_versions[myslot] - if myversion != o_version and \ - o_version == best([myversion, o_version]): - is_downgrade = True - break - if not is_downgrade: + if myversion != o_version: + if myversion == best([myversion, o_version]): + has_upgrade = True + else: + has_downgrade = True + break + if has_upgrade and not has_downgrade: o_index = preferred.index(other_choice) preferred.insert(o_index, possible_upgrade) possible_upgrades.remove(possible_upgrade)