KeywordsManager: support ~* in KEYWORDS
authorZac Medico <zmedico@gentoo.org>
Sun, 2 Oct 2011 02:12:52 +0000 (19:12 -0700)
committerZac Medico <zmedico@gentoo.org>
Sun, 2 Oct 2011 02:12:52 +0000 (19:12 -0700)
This allows ~* in KEYWORDS to be match by any unstable keyword in the
user's configuration, similar to how * in KEYWORDS already matches any
user configuration. Thanks to Daniel Robbins <drobbins@funtoo.org> for
the suggestion.

Also, the warning about * or -* in KEYWORDS is now gone, so that
ebuilds from the funtoo tree will be usable without triggering
warnings like this. If necessary, we can add ways to selectively
enable these kinds of warnings via layout.conf and/or repos.conf.

pym/portage/package/ebuild/_config/KeywordsManager.py

index cd225549eaa1ed12aef552888e444f402c2185bb..c2b834344b248a12ccc8aff5953c7e6b27bcae8e 100644 (file)
@@ -206,12 +206,16 @@ class KeywordsManager(object):
                hasstable = False
                hastesting = False
                for gp in mygroups:
-                       if gp == "*" or (gp == "-*" and len(mygroups) == 1):
-                               writemsg(_("--- WARNING: Package '%(cpv)s' uses"
-                                       " '%(keyword)s' keyword.\n") % {"cpv": cpv, "keyword": gp},
-                                        noiselevel=-1)
-                               if gp == "*":
-                                       match = True
+                       if gp == "*":
+                               match = True
+                               break
+                       elif gp == "~*":
+                               hastesting = True
+                               for x in pgroups:
+                                       if x[:1] == "~":
+                                               match = True
+                                               break
+                               if match:
                                        break
                        elif gp in pgroups:
                                match = True