summaryrefslogtreecommitdiffstats
path: root/bin/ebuild.sh
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2007-12-06 22:29:48 +0000
committerZac Medico <zmedico@gentoo.org>2007-12-06 22:29:48 +0000
commitbd44f336801fbd818fab568349dc4117950cd051 (patch)
treea1caec397ec9fde0a2ab21c37aaf4613c5c21501 /bin/ebuild.sh
parent18408d20bdf949131284abd28b000b76d28568a2 (diff)
downloadportage-bd44f336801fbd818fab568349dc4117950cd051.tar.gz
portage-bd44f336801fbd818fab568349dc4117950cd051.tar.bz2
portage-bd44f336801fbd818fab568349dc4117950cd051.zip
Bug #201506 - Make preprocess_ebuild_env() preserve
SANDBOX_{DENY,PREDICT,READ,WRITE} between all phases, except when the environment comes directly from environment.bz2. (trunk r8853) svn path=/main/branches/2.1.2/; revision=8854
Diffstat (limited to 'bin/ebuild.sh')
-rwxr-xr-xbin/ebuild.sh22
1 files changed, 13 insertions, 9 deletions
diff --git a/bin/ebuild.sh b/bin/ebuild.sh
index 6ea534de4..b23fe0ab2 100755
--- a/bin/ebuild.sh
+++ b/bin/ebuild.sh
@@ -1433,12 +1433,16 @@ filter_readonly_variables() {
# interfering with the current environment. This is useful when an existing
# environment needs to be loaded from a binary or installed package.
preprocess_ebuild_env() {
- filter_readonly_variables --filter-sandbox < "${T}"/environment \
+ local filter_opts=""
+ if [ -f "${T}/environment.raw" ] ; then
+ # This is a signal from the python side, indicating that the
+ # environment may contain stale SANDBOX_{DENY,PREDICT,READ,WRITE}
+ # variables that should be filtered out. Between phases, these
+ # variables are normally preserved.
+ filter_opts="--filter-sandbox ${filter_opts}"
+ fi
+ filter_readonly_variables ${filter_opts} < "${T}"/environment \
> "${T}"/environment.filtered
- if [ $? -ne 0 ] ; then
- rm -f "${T}/environment.filtered"
- return 1
- fi
mv "${T}"/environment.filtered "${T}"/environment || return $?
rm -f "${T}/environment.success" || return $?
# WARNING: Code inside this subshell should avoid making assumptions
@@ -1460,13 +1464,13 @@ preprocess_ebuild_env() {
touch "${T}/environment.success" || exit $?
) | filter_readonly_variables > "${T}/environment.filtered"
if [ -e "${T}/environment.success" ] ; then
- rm "${T}/environment.success"
mv "${T}/environment.filtered" "${T}/environment"
- return $?
+ retval=$?
else
- rm -f "${T}/environment.filtered"
+ retval=1
fi
- return 1
+ rm -f "${T}"/environment.{filtered,raw,success}
+ return ${retval}
}
# === === === === === === === === === === === === === === === === === ===