From: Zac Medico Date: Thu, 16 Nov 2006 23:29:17 +0000 (-0000) Subject: For bug #141118, make dep_zapdeps assign zero cost to new-style virtuals. X-Git-Tag: v2.1.2~457 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=358f4d5988305708546858ee99077d10c07b2aa4;p=portage.git For bug #141118, make dep_zapdeps assign zero cost to new-style virtuals. svn path=/main/trunk/; revision=5062 --- 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:]