summaryrefslogtreecommitdiffstats
path: root/pym
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2006-12-29 22:24:31 +0000
committerZac Medico <zmedico@gentoo.org>2006-12-29 22:24:31 +0000
commit1492478b1110a3b9678ea884e06599285ba45b12 (patch)
tree589dc618938728822b8446f82f264a4d4d47fe18 /pym
parent0137f024d61343de565026fbed098bee5bda6a08 (diff)
downloadportage-1492478b1110a3b9678ea884e06599285ba45b12.tar.gz
portage-1492478b1110a3b9678ea884e06599285ba45b12.tar.bz2
portage-1492478b1110a3b9678ea884e06599285ba45b12.zip
Do some minor cleanup in the dep_zapdeps downgrade avoidance logic (while working toward a fix for bug #159360).
svn path=/main/trunk/; revision=5414
Diffstat (limited to 'pym')
-rw-r--r--pym/portage.py18
1 files changed, 9 insertions, 9 deletions
diff --git a/pym/portage.py b/pym/portage.py
index 2a1635080..0b550f445 100644
--- a/pym/portage.py
+++ b/pym/portage.py
@@ -3982,28 +3982,28 @@ def dep_zapdeps(unreduced, reduced, myroot, use_binaries=0, trees=None):
# Check if the set of atoms will result in a downgrade of
# an installed package. If they will then don't prefer them
# over other atoms.
+ is_downgrade = False
if all_installed and all_available:
for atom in atoms:
mykey = dep_getkey(atom)
- if mykey.startswith("virtual/"):
- # New-style virtuals have zero cost to install.
- continue
inst_pkgs = vardb.match(mykey)
+ if not inst_pkgs:
+ # This must be a new-style virtual that isn't really
+ # installed yet (they have zero cost to install).
+ continue
avail_pkg = best(mydbapi.match(atom))
avail_slot = mydbapi.aux_get(avail_pkg, ["SLOT"])[0]
avail_split = catpkgsplit(avail_pkg)[1:]
- is_okay = False
for pkg in inst_pkgs:
if avail_slot != vardb.aux_get(pkg, ["SLOT"])[0]:
continue
- if pkgcmp(avail_split, catpkgsplit(pkg)[1:]) >= 0:
- is_okay = True
+ if pkgcmp(avail_split, catpkgsplit(pkg)[1:]) < 0:
+ is_downgrade = True
break
- if not is_okay:
- all_installed = False
+ if is_downgrade:
break
- if all_installed:
+ if all_installed and not is_downgrade:
preferred.append((atoms, all_available))
else:
other.append((atoms, all_available))