diff options
-rwxr-xr-x | bin/ebuild.sh | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/bin/ebuild.sh b/bin/ebuild.sh index f17e63b3e..6627c898d 100755 --- a/bin/ebuild.sh +++ b/bin/ebuild.sh @@ -19,12 +19,6 @@ fi # environment by modifying our PATH. unset BASH_ENV -# Avoid sandbox violations in temporary directories. -for x in TEMP TMP TMPDIR ; do - [[ -n ${!x} ]] && export SANDBOX_WRITE="${SANDBOX_WRITE:+${SANDBOX_WRITE}:}${!x}" -done -unset x - ROOTPATH=${ROOTPATH##:} ROOTPATH=${ROOTPATH%%:} PREROOTPATH=${PREROOTPATH##:} @@ -107,6 +101,18 @@ addwrite "${PORTAGE_TMPDIR}" addread "/:${PORTAGE_TMPDIR}" [[ -n ${PORTAGE_GPG_DIR} ]] && addpredict "${PORTAGE_GPG_DIR}" +# Avoid sandbox violations in temporary directories. +if [[ -w $T ]] ; then + export TEMP=$T + export TMP=$T + export TMPDIR=$T +else + for x in TEMP TMP TMPDIR ; do + [[ -n ${!x} ]] && addwrite "${!x}" + done + unset x +fi + lchown() { chown -h "$@" } @@ -2079,12 +2085,6 @@ fi #a reasonable default for $S [[ -z ${S} ]] && export S=${WORKDIR}/${P} -#some users have $TMP/$TMPDIR to a custom dir in their home ... -#this will cause sandbox errors with some ./configure -#scripts, so set it to $T. -export TMP="${T}" -export TMPDIR="${T}" - # Note: readonly variables interfere with preprocess_ebuild_env(), so # declare them only after it has already run. if [ "${EBUILD_PHASE}" != "depend" ] ; then |