diff options
author | Zac Medico <zmedico@gentoo.org> | 2011-12-07 22:22:31 -0800 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2011-12-07 22:22:31 -0800 |
commit | ff52f9dc31004becb8022e6437088d01917f413c (patch) | |
tree | 0f333c6bf4c09f751d993ef843089f8b5c80ef2e /bin/phase-helpers.sh | |
parent | c93a46851c43f7e8539a67b2376dc8f55af41789 (diff) | |
download | portage-ff52f9dc31004becb8022e6437088d01917f413c.tar.gz portage-ff52f9dc31004becb8022e6437088d01917f413c.tar.bz2 portage-ff52f9dc31004becb8022e6437088d01917f413c.zip |
Make USE=prefix enable EPREFIX in all EAPIs.
This is safe because the prefix flag should be masked in all non-prefix
profiles, and older EAPIs would otherwise be useless with prefix
configurations. This brings compatibility with the prefix branch of
portage, which also supports EPREFIX for all EAPIs (for obvious
reasons).
Diffstat (limited to 'bin/phase-helpers.sh')
-rw-r--r-- | bin/phase-helpers.sh | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh index 04cf35aa4..aadfac17d 100644 --- a/bin/phase-helpers.sh +++ b/bin/phase-helpers.sh @@ -19,7 +19,8 @@ into() { export DESTTREE="" else export DESTTREE=$1 - case "$EAPI" in 0|1|2) local ED=${D} ;; esac + [[ " ${USE} " == *" prefix "* ]] || \ + case "$EAPI" in 0|1|2) local ED=${D} ;; esac if [ ! -d "${ED}${DESTTREE}" ]; then install -d "${ED}${DESTTREE}" local ret=$? @@ -36,7 +37,8 @@ insinto() { export INSDESTTREE="" else export INSDESTTREE=$1 - case "$EAPI" in 0|1|2) local ED=${D} ;; esac + [[ " ${USE} " == *" prefix "* ]] || \ + case "$EAPI" in 0|1|2) local ED=${D} ;; esac if [ ! -d "${ED}${INSDESTTREE}" ]; then install -d "${ED}${INSDESTTREE}" local ret=$? @@ -53,7 +55,8 @@ exeinto() { export _E_EXEDESTTREE_="" else export _E_EXEDESTTREE_="$1" - case "$EAPI" in 0|1|2) local ED=${D} ;; esac + [[ " ${USE} " == *" prefix "* ]] || \ + case "$EAPI" in 0|1|2) local ED=${D} ;; esac if [ ! -d "${ED}${_E_EXEDESTTREE_}" ]; then install -d "${ED}${_E_EXEDESTTREE_}" local ret=$? @@ -70,7 +73,8 @@ docinto() { export _E_DOCDESTTREE_="" else export _E_DOCDESTTREE_="$1" - case "$EAPI" in 0|1|2) local ED=${D} ;; esac + [[ " ${USE} " == *" prefix "* ]] || \ + case "$EAPI" in 0|1|2) local ED=${D} ;; esac if [ ! -d "${ED}usr/share/doc/${PF}/${_E_DOCDESTTREE_}" ]; then install -d "${ED}usr/share/doc/${PF}/${_E_DOCDESTTREE_}" local ret=$? @@ -137,7 +141,8 @@ docompress() { keepdir() { dodir "$@" local x - case "$EAPI" in 0|1|2) local ED=${D} ;; esac + [[ " ${USE} " == *" prefix "* ]] || \ + case "$EAPI" in 0|1|2) local ED=${D} ;; esac if [ "$1" == "-R" ] || [ "$1" == "-r" ]; then shift find "$@" -type d -printf "${ED}%p/.keep_${CATEGORY}_${PN}-${SLOT}\n" \ @@ -374,7 +379,8 @@ unpack() { econf() { local x - case "$EAPI" in 0|1|2) local EPREFIX= ;; esac + [[ " ${USE} " == *" prefix "* ]] || \ + case "$EAPI" in 0|1|2) local EPREFIX= ;; esac _hasg() { local x s=$1 @@ -470,7 +476,8 @@ econf() { einstall() { # CONF_PREFIX is only set if they didn't pass in libdir above. local LOCAL_EXTRA_EINSTALL="${EXTRA_EINSTALL}" - case "$EAPI" in 0|1|2) local ED=${D} ;; esac + [[ " ${USE} " == *" prefix "* ]] || \ + case "$EAPI" in 0|1|2) local ED=${D} ;; esac LIBDIR_VAR="LIBDIR_${ABI}" if [ -n "${ABI}" -a -n "${!LIBDIR_VAR}" ]; then CONF_LIBDIR="${!LIBDIR_VAR}" @@ -600,7 +607,8 @@ has_version() { local eroot case "$EAPI" in 0|1|2) - eroot=${ROOT} + [[ " ${USE} " == *" prefix "* ]] && \ + eroot=${ROOT%/}${EPREFIX}/ || eroot=${ROOT} ;; *) eroot=${ROOT%/}${EPREFIX}/ @@ -634,7 +642,8 @@ best_version() { local eroot case "$EAPI" in 0|1|2) - eroot=${ROOT} + [[ " ${USE} " == *" prefix "* ]] && \ + eroot=${ROOT%/}${EPREFIX}/ || eroot=${ROOT} ;; *) eroot=${ROOT%/}${EPREFIX}/ |