summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2010-08-21 12:27:05 -0700
committerZac Medico <zmedico@gentoo.org>2010-08-21 12:27:05 -0700
commit1b3799269ad8c7ec8f8f307a6e41b5550517a36a (patch)
tree42dd1c9aaba74e2e9bb8517403e27d393243b15a
parent513b6f7282fe4d6b6ea0235f8dd30d5e18c548ef (diff)
downloadportage-1b3799269ad8c7ec8f8f307a6e41b5550517a36a.tar.gz
portage-1b3799269ad8c7ec8f8f307a6e41b5550517a36a.tar.bz2
portage-1b3799269ad8c7ec8f8f307a6e41b5550517a36a.zip
Move default ACCEPT_KEYWORDS handling for package.keywords out of
an unnecessary loop.
-rw-r--r--pym/portage/package/ebuild/config.py15
1 files changed, 5 insertions, 10 deletions
diff --git a/pym/portage/package/ebuild/config.py b/pym/portage/package/ebuild/config.py
index 572effd51..095957918 100644
--- a/pym/portage/package/ebuild/config.py
+++ b/pym/portage/package/ebuild/config.py
@@ -1021,19 +1021,14 @@ class config(object):
recursive=1, allow_wildcard=True).items():
pkgdict.setdefault(k, []).extend(v)
+ accept_keywords_defaults = \
+ self.configdict["defaults"].get("ACCEPT_KEYWORDS", "").split()
+ accept_keywords_defaults = tuple('~' + keyword for keyword in \
+ accept_keywords_defaults if keyword[:1] not in "~-")
for k, v in pkgdict.items():
# default to ~arch if no specific keyword is given
if not v:
- mykeywordlist = []
- if self.configdict["defaults"] and \
- "ACCEPT_KEYWORDS" in self.configdict["defaults"]:
- groups = self.configdict["defaults"]["ACCEPT_KEYWORDS"].split()
- else:
- groups = []
- for keyword in groups:
- if not keyword[0] in "~-":
- mykeywordlist.append("~"+keyword)
- v = mykeywordlist
+ v = accept_keywords_defaults
self.pkeywordsdict.setdefault(k.cp, {})[k] = v
#package.license