summaryrefslogtreecommitdiffstats
path: root/pym
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2007-12-18 06:57:53 +0000
committerZac Medico <zmedico@gentoo.org>2007-12-18 06:57:53 +0000
commit1187f6e8455ef68b978555ed177f167257c61fe4 (patch)
tree49d1b3f1bf91f0f682ed1ed5431f2047e5a4841d /pym
parent8a1fb38707052311dcabdcf9409984de2cb889b3 (diff)
downloadportage-1187f6e8455ef68b978555ed177f167257c61fe4.tar.gz
portage-1187f6e8455ef68b978555ed177f167257c61fe4.tar.bz2
portage-1187f6e8455ef68b978555ed177f167257c61fe4.zip
Create a PORTAGE_IUSE variable containing an egrep pattern
for use by the QA check that's built into useq(). This allows the IUSE logic for this check to be isolated in the python code. (trunk r8945) svn path=/main/branches/2.1.2/; revision=8948
Diffstat (limited to 'pym')
-rw-r--r--pym/portage.py15
1 files changed, 13 insertions, 2 deletions
diff --git a/pym/portage.py b/pym/portage.py
index eed8dd158..254c35d64 100644
--- a/pym/portage.py
+++ b/pym/portage.py
@@ -1016,6 +1016,7 @@ class config:
"PORTAGE_BUILDDIR", "PORTAGE_COLORMAP",
"PORTAGE_CONFIGROOT", "PORTAGE_DEBUG", "PORTAGE_DEPCACHEDIR",
"PORTAGE_GID", "PORTAGE_INST_GID", "PORTAGE_INST_UID",
+ "PORTAGE_IUSE",
"PORTAGE_LOG_FILE", "PORTAGE_MASTER_PID",
"PORTAGE_PYM_PATH", "PORTAGE_REPO_NAME", "PORTAGE_RESTRICT",
"PORTAGE_TMPDIR", "PORTAGE_WORKDIR_MODE",
@@ -2377,12 +2378,12 @@ class config:
iuse_implicit = set(iuse)
# Flags derived from ARCH.
- if arch:
- iuse_implicit.add(arch)
+ iuse_implicit.update(self.get("PORTAGE_ARCHLIST", "").split())
# Flags derived from USE_EXPAND_HIDDEN variables
# such as ELIBC, KERNEL, and USERLAND.
use_expand_hidden = self.get("USE_EXPAND_HIDDEN", "").split()
+ use_expand_hidden_raw = use_expand_hidden
if use_expand_hidden:
use_expand_hidden = re.compile("^(%s)_.*" % \
("|".join(x.lower() for x in use_expand_hidden)))
@@ -2394,6 +2395,16 @@ class config:
iuse_implicit.update(x for x in self.useforce \
if x not in self.usemask)
+ iuse_grep = iuse_implicit.copy()
+ if use_expand_hidden_raw:
+ for x in use_expand_hidden_raw:
+ iuse_grep.add(x.lower() + "_.*")
+ if iuse_grep:
+ iuse_grep = "^(%s)$" % "|".join(sorted(iuse_grep))
+ else:
+ iuse_grep = ""
+ self.configdict["pkg"]["PORTAGE_IUSE"] = iuse_grep
+
usesplit = [x for x in usesplit if \
x in iuse_implicit and \
x not in self.usemask]