summaryrefslogtreecommitdiffstats
path: root/bin/ebuild-helpers
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2011-12-07 22:22:31 -0800
committerZac Medico <zmedico@gentoo.org>2011-12-07 22:22:31 -0800
commitff52f9dc31004becb8022e6437088d01917f413c (patch)
tree0f333c6bf4c09f751d993ef843089f8b5c80ef2e /bin/ebuild-helpers
parentc93a46851c43f7e8539a67b2376dc8f55af41789 (diff)
downloadportage-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/ebuild-helpers')
-rwxr-xr-xbin/ebuild-helpers/dobin5
-rwxr-xr-xbin/ebuild-helpers/dodir3
-rwxr-xr-xbin/ebuild-helpers/dodoc3
-rwxr-xr-xbin/ebuild-helpers/doexe3
-rwxr-xr-xbin/ebuild-helpers/dohard3
-rwxr-xr-xbin/ebuild-helpers/doinfo3
-rwxr-xr-xbin/ebuild-helpers/doins3
-rwxr-xr-xbin/ebuild-helpers/dolib3
-rwxr-xr-xbin/ebuild-helpers/doman3
-rwxr-xr-xbin/ebuild-helpers/domo3
-rwxr-xr-xbin/ebuild-helpers/dosbin3
-rwxr-xr-xbin/ebuild-helpers/dosed3
-rwxr-xr-xbin/ebuild-helpers/dosym3
-rwxr-xr-xbin/ebuild-helpers/ecompressdir3
-rwxr-xr-xbin/ebuild-helpers/fowners3
-rwxr-xr-xbin/ebuild-helpers/fperms4
-rwxr-xr-xbin/ebuild-helpers/prepall3
-rwxr-xr-xbin/ebuild-helpers/prepalldocs3
-rwxr-xr-xbin/ebuild-helpers/prepallinfo3
-rwxr-xr-xbin/ebuild-helpers/prepallman3
-rwxr-xr-xbin/ebuild-helpers/prepallstrip3
-rwxr-xr-xbin/ebuild-helpers/prepinfo3
-rwxr-xr-xbin/ebuild-helpers/preplib3
-rwxr-xr-xbin/ebuild-helpers/prepman3
-rwxr-xr-xbin/ebuild-helpers/prepstrip3
25 files changed, 52 insertions, 26 deletions
diff --git a/bin/ebuild-helpers/dobin b/bin/ebuild-helpers/dobin
index af3af0d84..7ea29d4d4 100755
--- a/bin/ebuild-helpers/dobin
+++ b/bin/ebuild-helpers/dobin
@@ -1,5 +1,5 @@
#!/bin/bash
-# Copyright 1999-2010 Gentoo Foundation
+# Copyright 1999-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
@@ -9,7 +9,8 @@ if [[ $# -lt 1 ]] ; then
exit 1
fi
-case "$EAPI" in 0|1|2) ED=${D} ;; esac
+[[ " ${USE} " == *" prefix "* ]] || \
+ case "$EAPI" in 0|1|2) ED=${D} ;; esac
if [[ ! -d ${ED}${DESTTREE}/bin ]] ; then
install -d "${ED}${DESTTREE}/bin" || { helpers_die "${0##*/}: failed to install ${ED}${DESTTREE}/bin"; exit 2; }
diff --git a/bin/ebuild-helpers/dodir b/bin/ebuild-helpers/dodir
index 7db7cafb1..5bedd05c9 100755
--- a/bin/ebuild-helpers/dodir
+++ b/bin/ebuild-helpers/dodir
@@ -4,7 +4,8 @@
source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
-case "$EAPI" in 0|1|2) ED=${D} ;; esac
+[[ " ${USE} " == *" prefix "* ]] || \
+ case "$EAPI" in 0|1|2) ED=${D} ;; esac
install -d ${DIROPTIONS} "${@/#/${ED}/}"
ret=$?
diff --git a/bin/ebuild-helpers/dodoc b/bin/ebuild-helpers/dodoc
index 37bbc79d0..6280536e5 100755
--- a/bin/ebuild-helpers/dodoc
+++ b/bin/ebuild-helpers/dodoc
@@ -9,7 +9,8 @@ if [ $# -lt 1 ] ; then
exit 1
fi
-case "$EAPI" in 0|1|2) ED=${D} ;; esac
+[[ " ${USE} " == *" prefix "* ]] || \
+ case "$EAPI" in 0|1|2) ED=${D} ;; esac
dir="${ED}usr/share/doc/${PF}/${_E_DOCDESTTREE_}"
if [ ! -d "${dir}" ] ; then
diff --git a/bin/ebuild-helpers/doexe b/bin/ebuild-helpers/doexe
index a5b9af0eb..65f355af9 100755
--- a/bin/ebuild-helpers/doexe
+++ b/bin/ebuild-helpers/doexe
@@ -9,7 +9,8 @@ if [[ $# -lt 1 ]] ; then
exit 1
fi
-case "$EAPI" in 0|1|2) ED=${D} ;; esac
+[[ " ${USE} " == *" prefix "* ]] || \
+ case "$EAPI" in 0|1|2) ED=${D} ;; esac
if [[ ! -d ${ED}${_E_EXEDESTTREE_} ]] ; then
install -d "${ED}${_E_EXEDESTTREE_}"
diff --git a/bin/ebuild-helpers/dohard b/bin/ebuild-helpers/dohard
index cf6fb112d..7a6fc7698 100755
--- a/bin/ebuild-helpers/dohard
+++ b/bin/ebuild-helpers/dohard
@@ -7,7 +7,8 @@ if [[ $# -ne 2 ]] ; then
exit 1
fi
-case "$EAPI" in 0|1|2) ED=${D} ;; esac
+[[ " ${USE} " == *" prefix "* ]] || \
+ case "$EAPI" in 0|1|2) ED=${D} ;; esac
destdir=${2%/*}
[[ ! -d ${ED}${destdir} ]] && dodir "${destdir}"
diff --git a/bin/ebuild-helpers/doinfo b/bin/ebuild-helpers/doinfo
index a922ef1be..c4b767e9b 100755
--- a/bin/ebuild-helpers/doinfo
+++ b/bin/ebuild-helpers/doinfo
@@ -9,7 +9,8 @@ if [[ -z $1 ]] ; then
exit 1
fi
-case "$EAPI" in 0|1|2) ED=${D} ;; esac
+[[ " ${USE} " == *" prefix "* ]] || \
+ case "$EAPI" in 0|1|2) ED=${D} ;; esac
if [[ ! -d ${ED}usr/share/info ]] ; then
install -d "${ED}usr/share/info" || { helpers_die "${0##*/}: failed to install ${ED}usr/share/info"; exit 1; }
diff --git a/bin/ebuild-helpers/doins b/bin/ebuild-helpers/doins
index b9189d5ed..c3af28905 100755
--- a/bin/ebuild-helpers/doins
+++ b/bin/ebuild-helpers/doins
@@ -27,7 +27,8 @@ else
DOINSRECUR=n
fi
-case "$EAPI" in 0|1|2) export ED="${D}" ;; esac
+[[ " ${USE} " == *" prefix "* ]] || \
+ case "$EAPI" in 0|1|2) export ED="${D}" ;; esac
if [[ ${INSDESTTREE#${ED}} != "${INSDESTTREE}" ]]; then
vecho "-------------------------------------------------------" 1>&2
diff --git a/bin/ebuild-helpers/dolib b/bin/ebuild-helpers/dolib
index 9dd11d857..8357dfaa9 100755
--- a/bin/ebuild-helpers/dolib
+++ b/bin/ebuild-helpers/dolib
@@ -4,7 +4,8 @@
source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
-case "$EAPI" in 0|1|2) ED=${D} ;; esac
+[[ " ${USE} " == *" prefix "* ]] || \
+ case "$EAPI" in 0|1|2) ED=${D} ;; esac
# Setup ABI cruft
LIBDIR_VAR="LIBDIR_${ABI}"
diff --git a/bin/ebuild-helpers/doman b/bin/ebuild-helpers/doman
index 27401f3b3..817743d7e 100755
--- a/bin/ebuild-helpers/doman
+++ b/bin/ebuild-helpers/doman
@@ -9,7 +9,8 @@ if [[ $# -lt 1 ]] ; then
exit 1
fi
-case "$EAPI" in 0|1|2) ED=${D} ;; esac
+[[ " ${USE} " == *" prefix "* ]] || \
+ case "$EAPI" in 0|1|2) ED=${D} ;; esac
i18n=""
diff --git a/bin/ebuild-helpers/domo b/bin/ebuild-helpers/domo
index 0e3656d58..551785e76 100755
--- a/bin/ebuild-helpers/domo
+++ b/bin/ebuild-helpers/domo
@@ -10,7 +10,8 @@ if [ ${mynum} -lt 1 ] ; then
exit 1
fi
-case "$EAPI" in 0|1|2) ED=${D} ;; esac
+[[ " ${USE} " == *" prefix "* ]] || \
+ case "$EAPI" in 0|1|2) ED=${D} ;; esac
if [ ! -d "${ED}${DESTTREE}/share/locale" ] ; then
install -d "${ED}${DESTTREE}/share/locale/"
diff --git a/bin/ebuild-helpers/dosbin b/bin/ebuild-helpers/dosbin
index d0783ed33..560607754 100755
--- a/bin/ebuild-helpers/dosbin
+++ b/bin/ebuild-helpers/dosbin
@@ -9,7 +9,8 @@ if [[ $# -lt 1 ]] ; then
exit 1
fi
-case "$EAPI" in 0|1|2) ED=${D} ;; esac
+[[ " ${USE} " == *" prefix "* ]] || \
+ case "$EAPI" in 0|1|2) ED=${D} ;; esac
if [[ ! -d ${ED}${DESTTREE}/sbin ]] ; then
install -d "${ED}${DESTTREE}/sbin" || { helpers_die "${0##*/}: failed to install ${ED}${DESTTREE}/sbin"; exit 2; }
diff --git a/bin/ebuild-helpers/dosed b/bin/ebuild-helpers/dosed
index 00cf5da17..200b011fb 100755
--- a/bin/ebuild-helpers/dosed
+++ b/bin/ebuild-helpers/dosed
@@ -7,7 +7,8 @@ if [[ $# -lt 1 ]] ; then
exit 1
fi
-case "$EAPI" in 0|1|2) ED=${D} ;; esac
+[[ " ${USE} " == *" prefix "* ]] || \
+ case "$EAPI" in 0|1|2) ED=${D} ;; esac
ret=0
file_found=0
diff --git a/bin/ebuild-helpers/dosym b/bin/ebuild-helpers/dosym
index 8b7b304ee..8925001e4 100755
--- a/bin/ebuild-helpers/dosym
+++ b/bin/ebuild-helpers/dosym
@@ -9,7 +9,8 @@ if [[ $# -ne 2 ]] ; then
exit 1
fi
-case "$EAPI" in 0|1|2) ED=${D} ;; esac
+[[ " ${USE} " == *" prefix "* ]] || \
+ case "$EAPI" in 0|1|2) ED=${D} ;; esac
if [[ ${2} == */ ]] || \
[[ -d ${ED}${2} && ! -L ${ED}${2} ]] ; then
diff --git a/bin/ebuild-helpers/ecompressdir b/bin/ebuild-helpers/ecompressdir
index f9a846a90..937ba268b 100755
--- a/bin/ebuild-helpers/ecompressdir
+++ b/bin/ebuild-helpers/ecompressdir
@@ -9,7 +9,8 @@ if [[ -z $1 ]] ; then
exit 1
fi
-case "$EAPI" in 0|1|2) ED=${D} ;; esac
+[[ " ${USE} " == *" prefix "* ]] || \
+ case "$EAPI" in 0|1|2) ED=${D} ;; esac
case $1 in
--ignore)
diff --git a/bin/ebuild-helpers/fowners b/bin/ebuild-helpers/fowners
index 3f51b4e54..b3e4555cd 100755
--- a/bin/ebuild-helpers/fowners
+++ b/bin/ebuild-helpers/fowners
@@ -4,7 +4,8 @@
source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
-case "$EAPI" in 0|1|2) ED=${D} ;; esac
+[[ " ${USE} " == *" prefix "* ]] || \
+ case "$EAPI" in 0|1|2) ED=${D} ;; esac
# we can't prefix all arguments because
# chown takes random options
diff --git a/bin/ebuild-helpers/fperms b/bin/ebuild-helpers/fperms
index 9a2971ae5..207cf54a5 100755
--- a/bin/ebuild-helpers/fperms
+++ b/bin/ebuild-helpers/fperms
@@ -4,7 +4,9 @@
source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
-case "$EAPI" in 0|1|2) ED=${D} ;; esac
+[[ " ${USE} " == *" prefix "* ]] || \
+ case "$EAPI" in 0|1|2) ED=${D} ;; esac
+
# we can't prefix all arguments because
# chmod takes random options
slash="/"
diff --git a/bin/ebuild-helpers/prepall b/bin/ebuild-helpers/prepall
index 611c4ce79..512feb33a 100755
--- a/bin/ebuild-helpers/prepall
+++ b/bin/ebuild-helpers/prepall
@@ -4,7 +4,8 @@
source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
-case "$EAPI" in 0|1|2) ED=${D} ;; esac
+[[ " ${USE} " == *" prefix "* ]] || \
+ case "$EAPI" in 0|1|2) ED=${D} ;; esac
if has chflags $FEATURES ; then
# Save all the file flags for restoration at the end of prepall.
diff --git a/bin/ebuild-helpers/prepalldocs b/bin/ebuild-helpers/prepalldocs
index 540d02500..1d0224981 100755
--- a/bin/ebuild-helpers/prepalldocs
+++ b/bin/ebuild-helpers/prepalldocs
@@ -8,7 +8,8 @@ if [[ -n $1 ]] ; then
vecho "${0##*/}: invalid usage; takes no arguments" 1>&2
fi
-case "$EAPI" in 0|1|2) ED=${D} ;; esac
+[[ " ${USE} " == *" prefix "* ]] || \
+ case "$EAPI" in 0|1|2) ED=${D} ;; esac
[[ -d ${ED}usr/share/doc ]] || exit 0
diff --git a/bin/ebuild-helpers/prepallinfo b/bin/ebuild-helpers/prepallinfo
index e351f878b..183e1ca62 100755
--- a/bin/ebuild-helpers/prepallinfo
+++ b/bin/ebuild-helpers/prepallinfo
@@ -4,7 +4,8 @@
source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
-case "$EAPI" in 0|1|2) ED=${D} ;; esac
+[[ " ${USE} " == *" prefix "* ]] || \
+ case "$EAPI" in 0|1|2) ED=${D} ;; esac
[[ -d ${ED}usr/share/info ]] || exit 0
diff --git a/bin/ebuild-helpers/prepallman b/bin/ebuild-helpers/prepallman
index be7f19453..a5699c2f1 100755
--- a/bin/ebuild-helpers/prepallman
+++ b/bin/ebuild-helpers/prepallman
@@ -7,7 +7,8 @@ source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
# replaced by controllable compression in EAPI 4
has "${EAPI}" 0 1 2 3 || exit 0
-case "$EAPI" in 0|1|2) ED=${D} ;; esac
+[[ " ${USE} " == *" prefix "* ]] || \
+ case "$EAPI" in 0|1|2) ED=${D} ;; esac
ret=0
diff --git a/bin/ebuild-helpers/prepallstrip b/bin/ebuild-helpers/prepallstrip
index e9f5f8e3e..6032b48c9 100755
--- a/bin/ebuild-helpers/prepallstrip
+++ b/bin/ebuild-helpers/prepallstrip
@@ -2,6 +2,7 @@
# Copyright 1999-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-case "$EAPI" in 0|1|2) ED=${D} ;; esac
+[[ " ${USE} " == *" prefix "* ]] || \
+ case "$EAPI" in 0|1|2) ED=${D} ;; esac
exec prepstrip "${ED}"
diff --git a/bin/ebuild-helpers/prepinfo b/bin/ebuild-helpers/prepinfo
index afe214c6b..7c60d9b86 100755
--- a/bin/ebuild-helpers/prepinfo
+++ b/bin/ebuild-helpers/prepinfo
@@ -4,7 +4,8 @@
source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
-case "$EAPI" in 0|1|2) ED=${D} ;; esac
+[[ " ${USE} " == *" prefix "* ]] || \
+ case "$EAPI" in 0|1|2) ED=${D} ;; esac
if [[ -z $1 ]] ; then
infodir="/usr/share/info"
diff --git a/bin/ebuild-helpers/preplib b/bin/ebuild-helpers/preplib
index 8c6292101..cbff76d4c 100755
--- a/bin/ebuild-helpers/preplib
+++ b/bin/ebuild-helpers/preplib
@@ -6,7 +6,8 @@ source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
eqawarn "QA Notice: Deprecated call to 'preplib'"
-case "$EAPI" in 0|1|2) ED=${D} ;; esac
+[[ " ${USE} " == *" prefix "* ]] || \
+ case "$EAPI" in 0|1|2) ED=${D} ;; esac
LIBDIR_VAR="LIBDIR_${ABI}"
if [ -n "${ABI}" -a -n "${!LIBDIR_VAR}" ]; then
diff --git a/bin/ebuild-helpers/prepman b/bin/ebuild-helpers/prepman
index 8ea7607df..18c0f992a 100755
--- a/bin/ebuild-helpers/prepman
+++ b/bin/ebuild-helpers/prepman
@@ -4,7 +4,8 @@
source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
-case "$EAPI" in 0|1|2) ED=${D} ;; esac
+[[ " ${USE} " == *" prefix "* ]] || \
+ case "$EAPI" in 0|1|2) ED=${D} ;; esac
if [[ -z $1 ]] ; then
mandir="${ED}usr/share/man"
diff --git a/bin/ebuild-helpers/prepstrip b/bin/ebuild-helpers/prepstrip
index fac20b24f..085c93d56 100755
--- a/bin/ebuild-helpers/prepstrip
+++ b/bin/ebuild-helpers/prepstrip
@@ -18,7 +18,8 @@ exp_tf() {
exp_tf FEATURES installsources nostrip splitdebug
exp_tf RESTRICT binchecks installsources strip
-case "$EAPI" in 0|1|2) ED=${D} ;; esac
+[[ " ${USE} " == *" prefix "* ]] || \
+ case "$EAPI" in 0|1|2) ED=${D} ;; esac
banner=false
SKIP_STRIP=false