From: Zac Medico Date: Mon, 9 May 2011 20:30:04 +0000 (-0700) Subject: dep_check: avoid old-style virtuals code X-Git-Tag: v2.1.9.49~20 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=2d2e8c0a94a5fae3d387520e6db2cee4e1973e4f;p=portage.git dep_check: avoid old-style virtuals code --- diff --git a/pym/portage/dep/dep_check.py b/pym/portage/dep/dep_check.py index 7ec01fa52..53fce128e 100644 --- a/pym/portage/dep/dep_check.py +++ b/pym/portage/dep/dep_check.py @@ -50,7 +50,6 @@ def _expand_new_virtuals(mysplit, edebug, mydbapi, mysettings, myroot="/", repoman = not mysettings.local_config if kwargs["use_binaries"]: portdb = trees[myroot]["bintree"].dbapi - myvirtuals = mysettings.getvirtuals() pprovideddict = mysettings.pprovideddict myuse = kwargs["myuse"] for x in mysplit: @@ -76,7 +75,7 @@ def _expand_new_virtuals(mysplit, edebug, mydbapi, mysettings, myroot="/", if atom_graph is not None: atom_graph.add((x, id(x)), graph_parent) continue - mychoices = myvirtuals.get(mykey, []) + if x.blocker: # Virtual blockers are no longer expanded here since # the un-expanded virtual atom is more useful for @@ -93,6 +92,10 @@ def _expand_new_virtuals(mysplit, edebug, mydbapi, mysettings, myroot="/", else: # TODO: Add PROVIDE check for repoman. a = [] + myvartree = mytrees.get("vartree") + if myvartree is not None: + mysettings._populate_treeVirtuals_if_needed(myvartree) + mychoices = mysettings.getvirtuals().get(mykey, []) for y in mychoices: a.append(Atom(x.replace(x.cp, y.cp, 1))) if not a: @@ -114,6 +117,14 @@ def _expand_new_virtuals(mysplit, edebug, mydbapi, mysettings, myroot="/", # only use new-style matches if pkg.cp.startswith("virtual/"): pkgs.append(pkg) + + mychoices = [] + if not pkgs and not portdb.cp_list(x.cp): + myvartree = mytrees.get("vartree") + if myvartree is not None: + mysettings._populate_treeVirtuals_if_needed(myvartree) + mychoices = mysettings.getvirtuals().get(mykey, []) + if not (pkgs or mychoices): # This one couldn't be expanded as a new-style virtual. Old-style # virtuals have already been expanded by dep_virtual, so this one diff --git a/pym/portage/package/ebuild/config.py b/pym/portage/package/ebuild/config.py index 6981e24ca..13a91f97d 100644 --- a/pym/portage/package/ebuild/config.py +++ b/pym/portage/package/ebuild/config.py @@ -1964,7 +1964,11 @@ class config(object): def _populate_treeVirtuals_if_needed(self, vartree): """Reduce the provides into a list by CP.""" - self._virtuals_manager.populate_treeVirtuals_if_needed(vartree) + if self._virtuals_manager._treeVirtuals is None: + if self.local_config: + self._virtuals_manager.populate_treeVirtuals_if_needed(vartree) + else: + self._virtuals_manager._treeVirtuals = {} def __delitem__(self,mykey): self.modifying()