summaryrefslogtreecommitdiffstats
path: root/pym
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2006-12-30 04:11:33 +0000
committerZac Medico <zmedico@gentoo.org>2006-12-30 04:11:33 +0000
commit63c8602f4596b6efd1ad0bd8222d2bd82498f8e0 (patch)
tree3e2bb1724ab1b61d556c63da92e0a9ba63b873dd /pym
parentbab58cf5d43a0289d7c741b4aa62f83737798ea0 (diff)
downloadportage-63c8602f4596b6efd1ad0bd8222d2bd82498f8e0.tar.gz
portage-63c8602f4596b6efd1ad0bd8222d2bd82498f8e0.tar.bz2
portage-63c8602f4596b6efd1ad0bd8222d2bd82498f8e0.zip
Improve the logic for bug #159360 to ensure that an actual upgrade is selected without any downgrades.
svn path=/main/trunk/; revision=5422
Diffstat (limited to 'pym')
-rw-r--r--pym/portage.py15
1 files changed, 9 insertions, 6 deletions
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)