Fix _expand_new_virtuals to expand old-style virtuals for package.provided
authorZac Medico <zmedico@gentoo.org>
Tue, 30 Jun 2009 22:49:24 +0000 (22:49 -0000)
committerZac Medico <zmedico@gentoo.org>
Tue, 30 Jun 2009 22:49:24 +0000 (22:49 -0000)
entries when there is no other choice.

svn path=/main/trunk/; revision=13748

pym/portage/__init__.py

index a187bf56813f26be964c76c110f5836a90bf94f3..0d095149c04716a34599be15f02f5007e8b0401c 100644 (file)
@@ -6886,6 +6886,7 @@ def _expand_new_virtuals(mysplit, edebug, mydbapi, mysettings, myroot="/",
        if kwargs["use_binaries"]:
                portdb = trees[myroot]["bintree"].dbapi
        myvirtuals = mysettings.getvirtuals()
+       pprovideddict = mysettings.pprovideddict
        myuse = kwargs["myuse"]
        for x in mysplit:
                if x == "||":
@@ -7024,6 +7025,14 @@ def _expand_new_virtuals(mysplit, edebug, mydbapi, mysettings, myroot="/",
                                                portdb.aux_get(matches[-1], ['PROVIDE'])[0].split():
                                                a.append(new_atom)
 
+               if not a and not isblocker and mychoices:
+                       # Check for a virtual package.provided match.
+                       for y in mychoices:
+                               new_atom = portage.dep.Atom(x.replace(mykey, y, 1))
+                               if match_from_list(new_atom,
+                                       pprovideddict.get(new_atom.cp, [])):
+                                       a.append(new_atom)
+
                if not a:
                        newsplit.append(x)
                elif len(a) == 1: