summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2006-11-06 19:05:22 +0000
committerZac Medico <zmedico@gentoo.org>2006-11-06 19:05:22 +0000
commit7123514c5bda43457183326308dc14ded0d978d8 (patch)
tree2b0bcc8b75c2b88b4d4aaf42362c0f2bc3a311ee
parent7b89c862dd424112b4a8cacae0ae5b41d9ef07a3 (diff)
downloadportage-7123514c5bda43457183326308dc14ded0d978d8.tar.gz
portage-7123514c5bda43457183326308dc14ded0d978d8.tar.bz2
portage-7123514c5bda43457183326308dc14ded0d978d8.zip
For bug #154223, bridge new-style virtuals into old-style virtuals in order to prevent old-style virtuals from making new-style virtuals invisible.
svn path=/main/trunk/; revision=4955
-rwxr-xr-xbin/emerge13
-rw-r--r--pym/portage.py24
2 files changed, 32 insertions, 5 deletions
diff --git a/bin/emerge b/bin/emerge
index e6db286ed..4cdab4b84 100755
--- a/bin/emerge
+++ b/bin/emerge
@@ -721,10 +721,15 @@ class depgraph:
self.edebug = 1
self.spinner = spinner
self.pkgsettings = {}
- self.pkgsettings[self.target_root] = portage.config(clone=settings)
- if self.target_root != "/":
- self.pkgsettings["/"] = \
- portage.config(clone=trees["/"]["vartree"].settings)
+ for myroot in self.trees:
+ self.pkgsettings[myroot] = portage.config(
+ clone=trees[myroot]["vartree"].settings)
+ mydbapis = []
+ if "--usepkgonly" not in self.myopts:
+ mydbapis.append(trees[myroot]["porttree"].dbapi)
+ if "--usepkg" in self.myopts:
+ mydbapis.append(trees[myroot]["bintree"].dbapi)
+ self.pkgsettings[myroot].add_new_virtuals(mydbapis)
self.useFlags = {}
self.useFlags[self.target_root] = {}
if self.target_root != "/":
diff --git a/pym/portage.py b/pym/portage.py
index d6c5ec0be..fd11dc22e 100644
--- a/pym/portage.py
+++ b/pym/portage.py
@@ -849,6 +849,7 @@ class config:
self.virtuals = {}
self.virts_p = {}
self.dirVirtuals = None
+ self._new_virtuals = {}
self.v_count = 0
# Virtuals obtained from the vartree
@@ -914,6 +915,7 @@ class config:
self.prevmaskdict = copy.deepcopy(clone.prevmaskdict)
self.pprovideddict = copy.deepcopy(clone.pprovideddict)
self.dirVirtuals = copy.deepcopy(clone.dirVirtuals)
+ self._new_virtuals = copy.deepcopy(clone._new_virtuals)
self.treeVirtuals = copy.deepcopy(clone.treeVirtuals)
self.features = copy.deepcopy(clone.features)
@@ -1621,6 +1623,9 @@ class config:
virts = flatten(portage_dep.use_reduce(portage_dep.paren_reduce(provides), uselist=myuse.split()))
cp = dep_getkey(mycpv)
+ if cp.startswith("virtual/"):
+ # Bridge new-style virtual into old-style.
+ virts.append(cp)
for virt in virts:
virt = dep_getkey(virt)
if not self.treeVirtuals.has_key(virt):
@@ -1859,7 +1864,19 @@ class config:
ptVirtuals.setdefault(virt, [])
ptVirtuals[virt].append(cp)
- return stack_dictlist([ptVirtuals, self.treeVirtuals, self.dirVirtuals])
+ return stack_dictlist([ptVirtuals, self.treeVirtuals, self.dirVirtuals,
+ self._new_virtuals])
+
+ def add_new_virtuals(self, mydbapis):
+ """Scan for new-style virtuals and bridge them into the old-style."""
+ new_virtuals = {}
+ for mydbapi in mydbapis:
+ for cpv in mydbapi.cpv_all():
+ if cpv.startswith("virtual/"):
+ cp = dep_getkey(cpv)
+ new_virtuals[cp] = [cp]
+ self._new_virtuals = new_virtuals
+ self.virtuals = self.getvirtuals()
def __delitem__(self,mykey):
self.modifying()
@@ -4738,6 +4755,9 @@ class vartree(packagetree):
if not mys:
mys = string.split(myprovide, "/")
myprovides += [mys[0] + "/" + mys[1]]
+ if mycpv.startswith("virtual/"):
+ # Bridge new-style virtual into old-style.
+ myprovides.append(dep_getkey(mycpv))
return myprovides
except SystemExit, e:
raise
@@ -5318,6 +5338,8 @@ class portdbapi(dbapi):
l.sort()
return l
+ cpv_all = cp_all
+
def p_list(self,mycp):
d={}
for oroot in self.porttrees: