When dep_check() expands new-style virtuals, use USE flags from aux_get
authorZac Medico <zmedico@gentoo.org>
Fri, 11 Apr 2008 20:29:47 +0000 (20:29 -0000)
committerZac Medico <zmedico@gentoo.org>
Fri, 11 Apr 2008 20:29:47 +0000 (20:29 -0000)
calls to evaluate any conditionals that the depstrings might contain. This
works properly for ebuilds now that aux_get() is backed by Package instances
containing the correct USE. (trunk r9838:9840)

svn path=/main/branches/2.1.2/; revision=9841

pym/portage.py

index aae53d20dce9090626c0acbb9291c3fe30159cf0..2a427dfd4e601208b2c6b671473296adcfd66e8a 100644 (file)
@@ -5361,12 +5361,21 @@ def _expand_new_virtuals(mysplit, edebug, mydbapi, mysettings, myroot="/",
                else:
                        a = ['||']
                for y in pkgs:
-                       depstring = " ".join(y[2].aux_get(y[0], dep_keys))
+                       cpv, pv_split, db = y
+                       depstring = " ".join(db.aux_get(cpv, dep_keys))
+                       pkg_kwargs = kwargs.copy()
+                       if isinstance(db, portdbapi):
+                               # for repoman
+                               pass
+                       else:
+                               # for emerge
+                               use_split = db.aux_get(cpv, ["USE"])[0].split()
+                               pkg_kwargs["myuse"] = use_split
                        if edebug:
                                print "Virtual Parent:   ", y[0]
                                print "Virtual Depstring:", depstring
                        mycheck = dep_check(depstring, mydbapi, mysettings, myroot=myroot,
-                               trees=trees, **kwargs)
+                               trees=trees, **pkg_kwargs)
                        if not mycheck[0]:
                                raise portage_exception.ParseError(
                                        "%s: %s '%s'" % (y[0], mycheck[1], depstring))