summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2006-04-25 03:42:44 +0000
committerZac Medico <zmedico@gentoo.org>2006-04-25 03:42:44 +0000
commit16036759ddb02a6ad56afaedbce90f5548346c01 (patch)
tree651d3975f5b290cfc436840ef6ffc879e791287f
parentfb1d769aa88a9d619b3ab2b64fe1102fd4af094b (diff)
downloadportage-16036759ddb02a6ad56afaedbce90f5548346c01.tar.gz
portage-16036759ddb02a6ad56afaedbce90f5548346c01.tar.bz2
portage-16036759ddb02a6ad56afaedbce90f5548346c01.zip
Move ACCEPT_KEYWORDS and PORTAGE_ARCHLIST validation from global scope to the config class.
svn path=/main/trunk/; revision=3221
-rw-r--r--pym/portage.py22
1 files changed, 14 insertions, 8 deletions
diff --git a/pym/portage.py b/pym/portage.py
index 7dd659bfe..1dc1a999c 100644
--- a/pym/portage.py
+++ b/pym/portage.py
@@ -1263,6 +1263,15 @@ class config:
self["CBUILD"] = self["CHOST"]
self.backup_changes("CBUILD")
+ groups = self["ACCEPT_KEYWORDS"].split()
+ archlist = self.archlist()
+ if not archlist:
+ writemsg("--- 'profiles/arch.list' is empty or not available. Empty portage tree?\n")
+ else:
+ for group in groups:
+ if group not in archlist and group[0] != '-':
+ writemsg("!!! INVALID ACCEPT_KEYWORDS: %s\n" % str(group))
+
if mycpv:
self.setcpv(mycpv)
@@ -1651,6 +1660,10 @@ class config:
thirdparty_lists = [grabdict(os.path.join(x, "thirdpartymirrors")) for x in profileroots]
return stack_dictlist(thirdparty_lists, incremental=True)
+ def archlist(self):
+ return flatten([[myarch, "~" + myarch] \
+ for myarch in self["PORTAGE_ARCHLIST"].split()])
+
# XXX This would be to replace getstatusoutput completely.
# XXX Issue: cannot block execution. Deadlock condition.
def spawn(mystring,mysettings,debug=0,free=0,droppriv=0,sesandbox=0,fd_pipes=None,**keywords):
@@ -6850,14 +6863,7 @@ if not os.path.isdir(settings["PORTAGE_TMPDIR"]):
pkglines = settings.packages
groups = settings["ACCEPT_KEYWORDS"].split()
-archlist = flatten([[myarch, "~"+myarch] for myarch in settings["PORTAGE_ARCHLIST"].split()])
-
-for group in groups:
- if not archlist:
- writemsg("--- 'profiles/arch.list' is empty or not available. Empty portage tree?\n")
- break
- elif (group not in archlist) and group[0]!='-':
- writemsg("\n"+red("!!! INVALID ACCEPT_KEYWORDS: ")+str(group)+"\n")
+archlist = settings.archlist()
# Clear the cache
dircache={}