summaryrefslogtreecommitdiffstats
path: root/pym
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2007-12-28 16:42:14 +0000
committerZac Medico <zmedico@gentoo.org>2007-12-28 16:42:14 +0000
commit5a217ecdc46ad1d2318c2b4ddcad7fef4a028022 (patch)
tree259ee7346cd56452205debdfa08db6bbb4af5fc1 /pym
parent2f51b3bf3752c5774fc7a8bcd564eef3a3cb7c70 (diff)
downloadportage-5a217ecdc46ad1d2318c2b4ddcad7fef4a028022.tar.gz
portage-5a217ecdc46ad1d2318c2b4ddcad7fef4a028022.tar.bz2
portage-5a217ecdc46ad1d2318c2b4ddcad7fef4a028022.zip
Fixes for logic related to FEATURES=test to USE=test mapping:
* Add EBUILD_FORCE_TEST to the environment whitelist and filter it from the saved environment in save_ebuild_env(). * Tweak logic inside the ebuild command and config.regenerate() so that EBUILD_FORCE_TEST works even in odd cases like when USE=test is masked. * Only make FEATURES=test map to USE=test when "test" is actually in IUSE. * Remove USE=test from the set of implicit IUSE so that useq() calls in ebuild.sh properly generate a QA Notice when "test" is missing from IUSE. (trunk r9063:9065) svn path=/main/branches/2.1.2/; revision=9076
Diffstat (limited to 'pym')
-rw-r--r--pym/portage.py39
1 files changed, 28 insertions, 11 deletions
diff --git a/pym/portage.py b/pym/portage.py
index f791b6c69..a6a0aee42 100644
--- a/pym/portage.py
+++ b/pym/portage.py
@@ -1005,8 +1005,9 @@ class config:
# in it's bashrc (causing major leakage).
_environ_whitelist += [
"BASH_ENV", "BUILD_PREFIX", "D",
- "DISTDIR", "DOC_SYMLINKS_DIR", "EBUILD_EXIT_STATUS_FILE",
- "EBUILD", "EBUILD_PHASE", "ECLASSDIR", "ECLASS_DEPTH", "EMERGE_FROM",
+ "DISTDIR", "DOC_SYMLINKS_DIR", "EBUILD",
+ "EBUILD_EXIT_STATUS_FILE", "EBUILD_FORCE_TEST",
+ "EBUILD_PHASE", "ECLASSDIR", "ECLASS_DEPTH", "EMERGE_FROM",
"FEATURES", "FILESDIR", "HOME", "PATH",
"PKGUSE", "PKG_LOGDIR", "PKG_TMPDIR",
"PORTAGE_ACTUAL_DISTDIR", "PORTAGE_ARCHLIST",
@@ -1647,8 +1648,8 @@ class config:
self[var] = "0"
self.backup_changes(var)
+ # initialize self.features
self.regenerate()
- self.features = portage_util.unique_array(self["FEATURES"].split())
if "gpg" in self.features:
if not os.path.exists(self["PORTAGE_GPG_DIR"]) or \
@@ -2297,19 +2298,37 @@ class config:
myflags.update(self.useforce)
+ iuse = self.configdict["pkg"].get("IUSE","").split()
+ iuse = [ x.lstrip("+-") for x in iuse ]
# FEATURES=test should imply USE=test
- if "test" in self.configlist[-1].get("FEATURES","").split():
- myflags.add("test")
- if self.get("EBUILD_FORCE_TEST") == "1":
- self.usemask.discard("test")
+ if not hasattr(self, "features"):
+ self.features = list(sorted(set(
+ self.configlist[-1].get("FEATURES","").split())))
+ self["FEATURES"] = " ".join(self.features)
+ ebuild_force_test = self.get("EBUILD_FORCE_TEST") == "1"
+ if ebuild_force_test and \
+ self.get("EBUILD_PHASE") == "test" and \
+ not hasattr(self, "_ebuild_force_test_msg_shown"):
+ self._ebuild_force_test_msg_shown = True
+ writemsg("Forcing test.\n", noiselevel=-1)
+ if "test" in self.features and "test" in iuse:
+ if "test" in self.usemask and not ebuild_force_test:
+ # "test" is in IUSE and USE=test is masked, so execution
+ # of src_test() probably is not reliable. Therefore,
+ # temporarily disable FEATURES=test just for this package.
+ self["FEATURES"] = " ".join(x for x in self.features \
+ if x != "test")
+ myflags.discard("test")
+ else:
+ myflags.add("test")
+ if ebuild_force_test:
+ self.usemask.discard("test")
usesplit = [ x for x in myflags if \
x not in self.usemask]
# Use the calculated USE flags to regenerate the USE_EXPAND flags so
# that they are consistent.
- iuse = self.configdict["pkg"].get("IUSE","").split()
- iuse = [ x.lstrip("+-") for x in iuse ]
for var in use_expand:
prefix = var.lower() + "_"
prefix_len = len(prefix)
@@ -2377,7 +2396,6 @@ class config:
# * Masked flags, such as those from {,package}use.mask
# * Forced flags, such as those from {,package}use.force
# * build and bootstrap flags used by bootstrap.sh
- # * The "test" flag that's enabled by FEATURES=test
# Do this even when there's no package since setcpv() can
# optimize away regenerate() calls.
@@ -2406,7 +2424,6 @@ class config:
# build and bootstrap flags used by bootstrap.sh
iuse_implicit.add("build")
iuse_implicit.add("bootstrap")
- iuse_implicit.add("test")
iuse_grep = iuse_implicit.copy()
if use_expand_hidden_raw: