summaryrefslogtreecommitdiffstats
path: root/bin/phase-helpers.sh
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2011-11-09 10:48:36 -0800
committerZac Medico <zmedico@gentoo.org>2011-11-09 10:48:36 -0800
commitf75d02eb630c5595127faded4a048268ff59ac17 (patch)
treec7e9698e65a73ef3be8ec3c08fca26566a990eb4 /bin/phase-helpers.sh
parent27a9aec2a725066bd4585baab252eae5110f6b58 (diff)
downloadportage-f75d02eb630c5595127faded4a048268ff59ac17.tar.gz
portage-f75d02eb630c5595127faded4a048268ff59ac17.tar.bz2
portage-f75d02eb630c5595127faded4a048268ff59ac17.zip
Use local EPREFIX for uniformity.
The EPREFIX variable is not readonly in EAPI 0, 1, and 2, so we can declare EPREFIX as a local variable. We must be careful not to let this variable leak into the environment of ebuild/eclass functions that we call, since bash propagates local variables to nested function calls.
Diffstat (limited to 'bin/phase-helpers.sh')
-rw-r--r--bin/phase-helpers.sh23
1 files changed, 11 insertions, 12 deletions
diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh
index be8919c9f..04cf35aa4 100644
--- a/bin/phase-helpers.sh
+++ b/bin/phase-helpers.sh
@@ -374,8 +374,7 @@ unpack() {
econf() {
local x
- local eprefix=${EPREFIX}
- case "$EAPI" in 0|1|2) eprefix= ;; esac
+ case "$EAPI" in 0|1|2) local EPREFIX= ;; esac
_hasg() {
local x s=$1
@@ -406,12 +405,12 @@ econf() {
sed -e "1s:^#![[:space:]]*/bin/sh:#!$CONFIG_SHELL:" -i "$ECONF_SOURCE/configure" || \
die "Substition of shebang in '$ECONF_SOURCE/configure' failed"
fi
- if [ -e "${eprefix}"/usr/share/gnuconfig/ ]; then
+ if [ -e "${EPREFIX}"/usr/share/gnuconfig/ ]; then
find "${WORKDIR}" -type f '(' \
-name config.guess -o -name config.sub ')' -print0 | \
while read -r -d $'\0' x ; do
- vecho " * econf: updating ${x/${WORKDIR}\/} with ${eprefix}/usr/share/gnuconfig/${x##*/}"
- cp -f "${eprefix}"/usr/share/gnuconfig/"${x##*/}" "${x}"
+ vecho " * econf: updating ${x/${WORKDIR}\/} with ${EPREFIX}/usr/share/gnuconfig/${x##*/}"
+ cp -f "${EPREFIX}"/usr/share/gnuconfig/"${x##*/}" "${x}"
done
fi
@@ -431,7 +430,7 @@ econf() {
if [[ -n ${CONF_LIBDIR} ]] && ! _hasgq --libdir=\* "$@" ; then
export CONF_PREFIX=$(_hasg --exec-prefix=\* "$@")
[[ -z ${CONF_PREFIX} ]] && CONF_PREFIX=$(_hasg --prefix=\* "$@")
- : ${CONF_PREFIX:=${eprefix}/usr}
+ : ${CONF_PREFIX:=${EPREFIX}/usr}
CONF_PREFIX=${CONF_PREFIX#*=}
[[ ${CONF_PREFIX} != /* ]] && CONF_PREFIX="/${CONF_PREFIX}"
[[ ${CONF_LIBDIR} != /* ]] && CONF_LIBDIR="/${CONF_LIBDIR}"
@@ -439,15 +438,15 @@ econf() {
fi
set -- \
- --prefix="${eprefix}"/usr \
+ --prefix="${EPREFIX}"/usr \
${CBUILD:+--build=${CBUILD}} \
--host=${CHOST} \
${CTARGET:+--target=${CTARGET}} \
- --mandir="${eprefix}"/usr/share/man \
- --infodir="${eprefix}"/usr/share/info \
- --datadir="${eprefix}"/usr/share \
- --sysconfdir="${eprefix}"/etc \
- --localstatedir="${eprefix}"/var/lib \
+ --mandir="${EPREFIX}"/usr/share/man \
+ --infodir="${EPREFIX}"/usr/share/info \
+ --datadir="${EPREFIX}"/usr/share \
+ --sysconfdir="${EPREFIX}"/etc \
+ --localstatedir="${EPREFIX}"/var/lib \
"$@" \
${EXTRA_ECONF}
vecho "${ECONF_SOURCE}/configure" "$@"