summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2011-05-09 13:30:04 -0700
committerZac Medico <zmedico@gentoo.org>2011-05-09 13:30:04 -0700
commit6f9ee9c508c1506cdf8eb0dc46796dbe30f268db (patch)
tree0090611fd075d0e853a5fee83bb90e7bfd023931
parentcd54d00ab3035525e500512bdeb49e1c15585342 (diff)
downloadportage-6f9ee9c508c1506cdf8eb0dc46796dbe30f268db.tar.gz
portage-6f9ee9c508c1506cdf8eb0dc46796dbe30f268db.tar.bz2
portage-6f9ee9c508c1506cdf8eb0dc46796dbe30f268db.zip
dep_check: avoid old-style virtuals code
-rw-r--r--pym/portage/dep/dep_check.py15
-rw-r--r--pym/portage/package/ebuild/config.py6
2 files changed, 18 insertions, 3 deletions
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 82d660d6b..e51079539 100644
--- a/pym/portage/package/ebuild/config.py
+++ b/pym/portage/package/ebuild/config.py
@@ -1963,7 +1963,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()