diff options
author | Zac Medico <zmedico@gentoo.org> | 2007-12-18 06:32:16 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2007-12-18 06:32:16 +0000 |
commit | 11e10ec824550554651409c089ea1095449cb672 (patch) | |
tree | add3251ab3ccebee410635daea025c20abfb8ff9 /pym | |
parent | bbff2d84b034435756500be72ce167445f0f411c (diff) | |
download | portage-11e10ec824550554651409c089ea1095449cb672.tar.gz portage-11e10ec824550554651409c089ea1095449cb672.tar.bz2 portage-11e10ec824550554651409c089ea1095449cb672.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.
svn path=/main/trunk/; revision=8945
Diffstat (limited to 'pym')
-rw-r--r-- | pym/portage/__init__.py | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/pym/portage/__init__.py b/pym/portage/__init__.py index 9e2f424ce..1cdbda2c8 100644 --- a/pym/portage/__init__.py +++ b/pym/portage/__init__.py @@ -881,6 +881,7 @@ class config(object): "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", @@ -2396,12 +2397,12 @@ class config(object): 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))) @@ -2413,6 +2414,16 @@ class config(object): 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] |