summaryrefslogtreecommitdiffstats
path: root/pym
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2006-11-16 23:29:17 +0000
committerZac Medico <zmedico@gentoo.org>2006-11-16 23:29:17 +0000
commit358f4d5988305708546858ee99077d10c07b2aa4 (patch)
treeea1864d791997251cd3e938e1f712d7080d3ea6f /pym
parent339a6cc5155becfbe99a3d765d4115587f69e8ef (diff)
downloadportage-358f4d5988305708546858ee99077d10c07b2aa4.tar.gz
portage-358f4d5988305708546858ee99077d10c07b2aa4.tar.bz2
portage-358f4d5988305708546858ee99077d10c07b2aa4.zip
For bug #141118, make dep_zapdeps assign zero cost to new-style virtuals.
svn path=/main/trunk/; revision=5062
Diffstat (limited to 'pym')
-rw-r--r--pym/portage.py15
1 files changed, 12 insertions, 3 deletions
diff --git a/pym/portage.py b/pym/portage.py
index 11f590109..b956148c5 100644
--- a/pym/portage.py
+++ b/pym/portage.py
@@ -3543,7 +3543,11 @@ def _expand_new_virtuals(mysplit, edebug, mydbapi, mysettings, myroot="/",
if cpv.startswith("virtual/"):
pkgs.append((cpv, pkgsplit(cpv)))
if not pkgs:
- newsplit.append(x)
+ # This one couldn't be expanded as a new-style virtual. In order
+ # for dep_zapdeps to work properly, this atom must be eliminated
+ # from the choices (dep_zapdeps assigns zero cost to any virtual/*
+ # atoms that it encounters). Old-style virtuals have already been
+ # expanded to real atoms via dep_virtual.
continue
pkgs.sort(compare_pkgs) # Prefer higher versions.
if isblocker:
@@ -3670,7 +3674,8 @@ def dep_zapdeps(unreduced, reduced, myroot, use_binaries=0, trees=None,
preference selection is handled later via slot and version comparison."""
all_installed = True
for atom in set([dep_getkey(atom) for atom in atoms]):
- if not vardb.match(atom):
+ # New-style virtuals have zero cost to install.
+ if not vardb.match(atom) and not atom.startswith("virtual/"):
all_installed = False
break
@@ -3685,7 +3690,11 @@ def dep_zapdeps(unreduced, reduced, myroot, use_binaries=0, trees=None,
# over other atoms.
if all_installed and all_available:
for atom in atoms:
- inst_pkgs = vardb.match(dep_getkey(atom))
+ mykey = dep_getkey(atom)
+ if mykey.startswith("virtual/"):
+ # New-style virtuals have zero cost to install.
+ continue
+ inst_pkgs = vardb.match(mykey)
avail_pkg = best(mydbapi.match(atom))
avail_slot = mydbapi.aux_get(avail_pkg, ["SLOT"])[0]
avail_split = catpkgsplit(avail_pkg)[1:]