summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--man/portage.57
-rw-r--r--pym/portage/package/ebuild/config.py36
2 files changed, 41 insertions, 2 deletions
diff --git a/man/portage.5 b/man/portage.5
index 7edeb171e..f3317da53 100644
--- a/man/portage.5
+++ b/man/portage.5
@@ -28,6 +28,7 @@ eapi
make.defaults
packages
packages.build
+package.accept_keywords
package.keywords
package.mask
package.provided
@@ -765,6 +766,12 @@ FSF-APPROVED @GPL-COMPATIBLE Apache-1.1 BSD-4 MPL-1.0 MPL-1.1
GPL-COMPATIBLE Apache-2.0 BSD BSD-2 GPL-2 GPL-3 LGPL-2.1 LGPL-3 X11 ZLIB
.fi
.TP
+.BR package.accept_keywords
+Per\-package ACCEPT_KEYWORDS for profiles. This has the same format and
+behavior as /etc/portage/package.accept_keywords, including the ability
+to list atoms without any keywords in order to accept unstable variants
+of all stable keywords listed in ACCEPT_KEYWORDS.
+.TP
.BR package.keywords
Per\-profile KEYWORDS. Useful for cases in which the effective KEYWORDS of a
given package should vary depending on which profile the user has selected.
diff --git a/pym/portage/package/ebuild/config.py b/pym/portage/package/ebuild/config.py
index 7a1f640b6..6e20b1cb7 100644
--- a/pym/portage/package/ebuild/config.py
+++ b/pym/portage/package/ebuild/config.py
@@ -544,6 +544,7 @@ class config(object):
self.pusedict = copy.deepcopy(clone.pusedict)
self.pkeywordsdict = copy.deepcopy(clone.pkeywordsdict)
self._pkeywords_list = copy.deepcopy(clone._pkeywords_list)
+ self._p_accept_keywords = copy.deepcopy(clone._p_accept_keywords)
self.pmaskdict = copy.deepcopy(clone.pmaskdict)
self.punmaskdict = copy.deepcopy(clone.punmaskdict)
self.prevmaskdict = copy.deepcopy(clone.prevmaskdict)
@@ -711,6 +712,19 @@ class config(object):
cpdict.setdefault(k.cp, {})[k] = v
self._pkeywords_list.append(cpdict)
+ self._p_accept_keywords = []
+ raw_p_accept_keywords = [grabdict_package(
+ os.path.join(x, "package.accept_keywords"), recursive=1) \
+ for x in self.profiles]
+ for d in raw_p_accept_keywords:
+ if not d:
+ # Omit non-existent files from the stack.
+ continue
+ cpdict = {}
+ for k, v in d.items():
+ cpdict.setdefault(k.cp, {})[k] = tuple(v)
+ self._p_accept_keywords.append(cpdict)
+
# get profile-masked use flags -- INCREMENTAL Child over parent
self.usemask_list = tuple(
tuple(grabfile(os.path.join(x, "use.mask"), recursive=1))
@@ -2056,10 +2070,26 @@ class config(object):
mygroups = self._getKeywords(cpv, metadata)
# Repoman may modify this attribute as necessary.
pgroups = self["ACCEPT_KEYWORDS"].split()
- match=0
+ matches = False
cp = cpv_getkey(cpv)
+
+ if self._p_accept_keywords:
+ cpv_slot = "%s:%s" % (cpv, metadata["SLOT"])
+ accept_keywords_defaults = tuple('~' + keyword for keyword in \
+ pgroups if keyword[:1] not in "~-")
+ for d in self._p_accept_keywords:
+ cpdict = d.get(cp)
+ if cpdict:
+ pkg_accept_keywords = \
+ _ordered_by_atom_specificity(cpdict, cpv_slot)
+ if pkg_accept_keywords:
+ for x in pkg_accept_keywords:
+ if not x:
+ x = accept_keywords_defaults
+ pgroups.extend(x)
+ matches = True
+
pkgdict = self.pkeywordsdict.get(cp)
- matches = False
if pkgdict:
cpv_slot = "%s:%s" % (cpv, metadata["SLOT"])
pkg_accept_keywords = \
@@ -2082,6 +2112,8 @@ class config(object):
inc_pgroups.add(x)
pgroups = inc_pgroups
del inc_pgroups
+
+ match = False
hasstable = False
hastesting = False
for gp in mygroups: