summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2009-06-30 04:39:07 +0000
committerZac Medico <zmedico@gentoo.org>2009-06-30 04:39:07 +0000
commitbfb4f6446422205198ce3a1662a9f3b21065924c (patch)
treeaa39a0ad4586c47ae14d08a955de3afb6fee2c3f
parent5624d5f205423b19613822b3ef9cb3a2d961a5e3 (diff)
downloadportage-bfb4f6446422205198ce3a1662a9f3b21065924c.tar.gz
portage-bfb4f6446422205198ce3a1662a9f3b21065924c.tar.bz2
portage-bfb4f6446422205198ce3a1662a9f3b21065924c.zip
Bug #82488 - In _expand_new_virtuals(), check PROVIDE before expanding
old-style virtuals. svn path=/main/trunk/; revision=13742
-rw-r--r--pym/portage/__init__.py38
1 files changed, 25 insertions, 13 deletions
diff --git a/pym/portage/__init__.py b/pym/portage/__init__.py
index 99715c740..947aea07b 100644
--- a/pym/portage/__init__.py
+++ b/pym/portage/__init__.py
@@ -6959,13 +6959,8 @@ def _expand_new_virtuals(mysplit, edebug, mydbapi, mysettings, myroot="/",
# dependency that needs to be satisfied.
newsplit.append(x)
continue
- if not pkgs and len(mychoices) == 1:
- newsplit.append(portage.dep.Atom(x.replace(mykey, mychoices[0])))
- continue
- if isblocker:
- a = []
- else:
- a = ['||']
+
+ a = []
for y in pkgs:
cpv, pv_split, db = y
depstring = " ".join(db.aux_get(cpv, dep_keys))
@@ -7011,13 +7006,30 @@ def _expand_new_virtuals(mysplit, edebug, mydbapi, mysettings, myroot="/",
a.append(mycheck[1])
# Plain old-style virtuals. New-style virtuals are preferred.
if not pkgs:
- for y in mychoices:
- a.append(portage.dep.Atom(x.replace(mykey, y, 1)))
- if isblocker and not a:
- # Probably a compound virtual. Pass the atom through unprocessed.
+ if repoman:
+ # TODO: Add PROVIDE check for repoman.
+ for y in mychoices:
+ a.append(portage.dep.Atom(x.replace(mykey, y, 1)))
+ else:
+ for y in mychoices:
+ new_atom = portage.dep.Atom(x.replace(mykey, y, 1))
+ matches = portdb.match(new_atom)
+ # portdb is an instance of depgraph._dep_check_composite_db, so
+ # USE conditionals are already evaluated.
+ if matches and mykey in \
+ portdb.aux_get(matches[-1], ['PROVIDE'])[0].split():
+ a.append(new_atom)
+
+ if not a:
newsplit.append(x)
- continue
- newsplit.append(a)
+ elif len(a) == 1:
+ newsplit.append(a[0])
+ else:
+ if isblocker:
+ newsplit.extend(a)
+ else:
+ newsplit.append(['||'] + a)
+
return newsplit
def dep_eval(deplist):