Fix config.setcpv() to properly call config.regenerate() in cases
authorZac Medico <zmedico@gentoo.org>
Mon, 31 Dec 2007 09:54:15 +0000 (09:54 -0000)
committerZac Medico <zmedico@gentoo.org>
Mon, 31 Dec 2007 09:54:15 +0000 (09:54 -0000)
when USE needs to be regenerated due to FEATURES=test to USE=test
mapping.

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

pym/portage/__init__.py

index 64ae709489ace557cb0e78fc217c32d1d1ec724d..c9db5e9fdc28d601b0e535552496ae42fac322b5 100644 (file)
@@ -1908,7 +1908,14 @@ class config(object):
                self.configdict["pkg"]["USE"]    = self.puse[:] # this gets appended to USE
                if iuse != self.configdict["pkg"].get("IUSE",""):
                        self.configdict["pkg"]["IUSE"] = iuse
-                       if self._use_wildcards or self.get("EBUILD_PHASE"):
+                       test_use_changed = False
+                       if "test" in self.features:
+                               test_use_changed = \
+                                       ("test" in iuse.split()) != \
+                                       ("test" in self.get("PORTAGE_USE","").split())
+                       if self.get("EBUILD_PHASE") or \
+                               self._use_wildcards or \
+                               test_use_changed:
                                # Without this conditional, regenerate() would be called
                                # *every* time.
                                has_changed = True