Refactor FEATURES=test USE logic. v2.2.0_alpha128
authorZac Medico <zmedico@gentoo.org>
Fri, 14 Sep 2012 02:24:04 +0000 (19:24 -0700)
committerZac Medico <zmedico@gentoo.org>
Fri, 14 Sep 2012 02:24:04 +0000 (19:24 -0700)
pym/portage/package/ebuild/config.py

index bb0a7c1c4504be6a9bd440534531addf3ec12576..c1630cbc14556d956c9b6044be4753431641293b 100644 (file)
@@ -1467,9 +1467,11 @@ class config(object):
                        not hasattr(self, "_ebuild_force_test_msg_shown"):
                                self._ebuild_force_test_msg_shown = True
                                writemsg(_("Forcing test.\n"), noiselevel=-1)
-               if "test" in self.features and \
-                       ("test" in explicit_iuse or iuse_implicit_match("test")):
-                       if "test" in self.usemask and not ebuild_force_test:
+
+               if "test" in explicit_iuse or iuse_implicit_match("test"):
+                       if "test" not in self.features:
+                               use.discard("test")
+                       elif "test" in self.usemask and not ebuild_force_test:
                                # "test" is in IUSE and USE=test is masked, so execution
                                # of src_test() probably is not reliable. Therefore,
                                # temporarily disable FEATURES=test just for this package.
@@ -1481,11 +1483,6 @@ class config(object):
                                if ebuild_force_test and "test" in self.usemask:
                                        self.usemask = \
                                                frozenset(x for x in self.usemask if x != "test")
-               elif "test" in explicit_iuse or iuse_implicit_match("test"):
-                       if "test" in self.usemask or "test" not in self.features:
-                               use.discard("test")
-                       elif "test" in self.features:
-                               use.add("test")
 
                # Allow _* flags from USE_EXPAND wildcards to pass through here.
                use.difference_update([x for x in use \