Fix USE filtering code so that it doesn't rely on config.setcpv()
authorZac Medico <zmedico@gentoo.org>
Tue, 18 Dec 2007 14:18:41 +0000 (14:18 -0000)
committerZac Medico <zmedico@gentoo.org>
Tue, 18 Dec 2007 14:18:41 +0000 (14:18 -0000)
calling config.regenerate(). (trunk r8957)

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

pym/portage.py

index 0f1fda2dee44aa616c1817b1e4a15cfa2ae1e4ff..8a3426b34bbf1b47b65f0ea76e494c18f7522b93 100644 (file)
@@ -2376,7 +2376,9 @@ class config:
                #  * Forced flags, such as those from {,package}use.force
                #  * build and bootstrap flags used by bootstrap.sh
 
-               if self.mycpv:
+               if True:
+                       # Do this even when there's no package since setcpv() can
+                       # optimize away regenerate() calls.
                        iuse_implicit = set(iuse)
 
                        # Flags derived from ARCH.
@@ -2409,7 +2411,7 @@ class config:
                                iuse_grep = "^(%s)$" % "|".join(sorted(iuse_grep))
                        else:
                                iuse_grep = ""
-                       self.configdict["pkg"]["PORTAGE_IUSE"] = iuse_grep
+                       self["PORTAGE_IUSE"] = iuse_grep
 
                        usesplit = [x for x in usesplit if \
                                x in iuse_implicit and \