Move the check for unsupported FEATURES to config.validate().
authorZac Medico <zmedico@gentoo.org>
Sun, 11 Jul 2010 21:13:49 +0000 (14:13 -0700)
committerZac Medico <zmedico@gentoo.org>
Sun, 11 Jul 2010 21:13:49 +0000 (14:13 -0700)
pym/portage/package/ebuild/config.py

index a3a372e71a84d7fd045a661980fe50eb9a093824..2874dc3ce71fbd4244d5cf5a3cdb70841c645c79 100644 (file)
@@ -1152,6 +1152,17 @@ class config(object):
                        writemsg(_("!!! FEATURES=fakeroot is enabled, but the "
                                "fakeroot binary is not installed.\n"), noiselevel=-1)
 
+               unsupported_features = []
+               for x in self.features:
+                       if x not in SUPPORTED_FEATURES:
+                               unsupported_features.append(x)
+
+               if unsupported_features:
+                       writemsg(colorize("BAD",
+                               _("FEATURES variable contains an unknown value(s): %s") % \
+                               ", ".join(unsupported_features)) \
+                               + "\n", noiselevel=-1)
+
        def loadVirtuals(self,root):
                """Not currently used by portage."""
                writemsg("DEPRECATED: portage.config.loadVirtuals\n")
@@ -2183,18 +2194,6 @@ class config(object):
                                                myflags = []
                                                continue
 
-                                       if mykey == "FEATURES":
-                                               if x[:1] in ("+", "-"):
-                                                       val = x[1:]
-                                               else:
-                                                       val = x
-
-                                               if val not in SUPPORTED_FEATURES:
-                                                       writemsg(colorize("BAD",
-                                                               _("FEATURES variable contains an unknown value: %s") % x) \
-                                                               + "\n", noiselevel=-1)
-                                                       continue
-
                                        if x[0]=="+":
                                                # Not legal. People assume too much. Complain.
                                                writemsg(colorize("BAD",