diff options
author | 2015-04-26 14:13:41 -0700 | |
---|---|---|
committer | 2015-04-28 16:45:41 -0700 | |
commit | bc53f538039006f49bdcd19d3f17ab7f6b7a48d9 (patch) | |
tree | 0a1b0bda84eb7d9e8a95b42dbe50d48412ef5a68 | |
parent | ro_checker: only check nearest parent (bug 547390) (diff) | |
download | portage-bc53f538039006f49bdcd19d3f17ab7f6b7a48d9.tar.gz portage-bc53f538039006f49bdcd19d3f17ab7f6b7a48d9.tar.bz2 portage-bc53f538039006f49bdcd19d3f17ab7f6b7a48d9.zip |
Make the USE variable readonly (bug 325009)
This requires the EBUILD_FORCE_TEST code from dyn_test to execute
before USE is declared readonly.
X-Gentoo-Bug: 325009
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=325009
Acked-by: Brian Dolbec <dolsen@gentoo.org>
-rwxr-xr-x | bin/ebuild.sh | 10 | ||||
-rw-r--r-- | bin/phase-functions.sh | 9 |
2 files changed, 10 insertions, 9 deletions
diff --git a/bin/ebuild.sh b/bin/ebuild.sh index b6b372348..4e26f879e 100755 --- a/bin/ebuild.sh +++ b/bin/ebuild.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright 1999-2013 Gentoo Foundation +# Copyright 1999-2015 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 PORTAGE_BIN_PATH="${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}" @@ -746,6 +746,14 @@ else declare -r ED EPREFIX EROOT fi + # If ${EBUILD_FORCE_TEST} == 1 and USE came from ${T}/environment + # then it might not have USE=test like it's supposed to here. + if [[ ${EBUILD_PHASE} == test && ${EBUILD_FORCE_TEST} == 1 && + test =~ ${PORTAGE_IUSE} ]] && ! has test ${USE} ; then + export USE="${USE} test" + fi + declare -r USE + if [[ -n $EBUILD_SH_ARGS ]] ; then ( # Don't allow subprocesses to inherit the pipe which diff --git a/bin/phase-functions.sh b/bin/phase-functions.sh index 2743e27b0..7bf4d6336 100644 --- a/bin/phase-functions.sh +++ b/bin/phase-functions.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright 1999-2013 Gentoo Foundation +# Copyright 1999-2015 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # Hardcoded bash lists are needed for backward compatibility with @@ -489,13 +489,6 @@ __dyn_test() { elif [[ ${EBUILD_FORCE_TEST} != 1 ]] && ! has test ${FEATURES} ; then __vecho ">>> Test phase [not enabled]: ${CATEGORY}/${PF}" else - # If ${EBUILD_FORCE_TEST} == 1 and USE came from ${T}/environment - # then it might not have USE=test like it's supposed to here. - if [[ ${EBUILD_FORCE_TEST} == 1 && test =~ ${PORTAGE_IUSE} ]] && \ - ! has test ${USE} ; then - export USE="${USE} test" - fi - local save_sp=${SANDBOX_PREDICT} addpredict / __ebuild_phase pre_src_test |