summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2011-12-08 09:46:55 -0800
committerZac Medico <zmedico@gentoo.org>2011-12-08 09:46:55 -0800
commit3bd94dbffd4cf338de8cc786f60525b0a84d2562 (patch)
tree97dfe70a2b0ab376b22c8bf40cb547beced0bfc4
parentc281c323adf14ece439b98dcf35531666266a0a5 (diff)
downloadportage-3bd94dbffd4cf338de8cc786f60525b0a84d2562.tar.gz
portage-3bd94dbffd4cf338de8cc786f60525b0a84d2562.tar.bz2
portage-3bd94dbffd4cf338de8cc786f60525b0a84d2562.zip
Support FEATURES=force-prefix.
This adjusts the logic from commit ff52f9dc31004becb8022e6437088d01917f413c to use FEATURES=force-prefix instead of USE=prefix. This has the advantage that we don't have to make any assumptions about the USE=prefix.
-rwxr-xr-xbin/ebuild-helpers/dobin2
-rwxr-xr-xbin/ebuild-helpers/dodir2
-rwxr-xr-xbin/ebuild-helpers/dodoc2
-rwxr-xr-xbin/ebuild-helpers/doexe2
-rwxr-xr-xbin/ebuild-helpers/dohard2
-rwxr-xr-xbin/ebuild-helpers/doinfo2
-rwxr-xr-xbin/ebuild-helpers/doins2
-rwxr-xr-xbin/ebuild-helpers/dolib2
-rwxr-xr-xbin/ebuild-helpers/doman2
-rwxr-xr-xbin/ebuild-helpers/domo2
-rwxr-xr-xbin/ebuild-helpers/dosbin2
-rwxr-xr-xbin/ebuild-helpers/dosed2
-rwxr-xr-xbin/ebuild-helpers/dosym2
-rwxr-xr-xbin/ebuild-helpers/ecompressdir2
-rwxr-xr-xbin/ebuild-helpers/fowners2
-rwxr-xr-xbin/ebuild-helpers/fperms2
-rwxr-xr-xbin/ebuild-helpers/prepall2
-rwxr-xr-xbin/ebuild-helpers/prepalldocs2
-rwxr-xr-xbin/ebuild-helpers/prepallinfo2
-rwxr-xr-xbin/ebuild-helpers/prepallman2
-rwxr-xr-xbin/ebuild-helpers/prepallstrip2
-rwxr-xr-xbin/ebuild-helpers/prepinfo2
-rwxr-xr-xbin/ebuild-helpers/preplib2
-rwxr-xr-xbin/ebuild-helpers/prepman2
-rwxr-xr-xbin/ebuild-helpers/prepstrip2
-rwxr-xr-xbin/ebuild.sh2
-rwxr-xr-xbin/misc-functions.sh16
-rw-r--r--bin/phase-functions.sh6
-rw-r--r--bin/phase-helpers.sh18
-rw-r--r--man/make.conf.56
-rw-r--r--pym/portage/const.py2
-rw-r--r--pym/portage/package/ebuild/config.py17
32 files changed, 60 insertions, 57 deletions
diff --git a/bin/ebuild-helpers/dobin b/bin/ebuild-helpers/dobin
index 7ea29d4d4..f90d8933c 100755
--- a/bin/ebuild-helpers/dobin
+++ b/bin/ebuild-helpers/dobin
@@ -9,7 +9,7 @@ if [[ $# -lt 1 ]] ; then
exit 1
fi
-[[ " ${USE} " == *" prefix "* ]] || \
+[[ " ${FEATURES} " == *" force-prefix "* ]] || \
case "$EAPI" in 0|1|2) ED=${D} ;; esac
if [[ ! -d ${ED}${DESTTREE}/bin ]] ; then
diff --git a/bin/ebuild-helpers/dodir b/bin/ebuild-helpers/dodir
index 5bedd05c9..90a3efed4 100755
--- a/bin/ebuild-helpers/dodir
+++ b/bin/ebuild-helpers/dodir
@@ -4,7 +4,7 @@
source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
-[[ " ${USE} " == *" prefix "* ]] || \
+[[ " ${FEATURES} " == *" force-prefix "* ]] || \
case "$EAPI" in 0|1|2) ED=${D} ;; esac
install -d ${DIROPTIONS} "${@/#/${ED}/}"
diff --git a/bin/ebuild-helpers/dodoc b/bin/ebuild-helpers/dodoc
index 6280536e5..1f333a615 100755
--- a/bin/ebuild-helpers/dodoc
+++ b/bin/ebuild-helpers/dodoc
@@ -9,7 +9,7 @@ if [ $# -lt 1 ] ; then
exit 1
fi
-[[ " ${USE} " == *" prefix "* ]] || \
+[[ " ${FEATURES} " == *" force-prefix "* ]] || \
case "$EAPI" in 0|1|2) ED=${D} ;; esac
dir="${ED}usr/share/doc/${PF}/${_E_DOCDESTTREE_}"
diff --git a/bin/ebuild-helpers/doexe b/bin/ebuild-helpers/doexe
index 65f355af9..fb228f905 100755
--- a/bin/ebuild-helpers/doexe
+++ b/bin/ebuild-helpers/doexe
@@ -9,7 +9,7 @@ if [[ $# -lt 1 ]] ; then
exit 1
fi
-[[ " ${USE} " == *" prefix "* ]] || \
+[[ " ${FEATURES} " == *" force-prefix "* ]] || \
case "$EAPI" in 0|1|2) ED=${D} ;; esac
if [[ ! -d ${ED}${_E_EXEDESTTREE_} ]] ; then
diff --git a/bin/ebuild-helpers/dohard b/bin/ebuild-helpers/dohard
index 7a6fc7698..b52fd7c00 100755
--- a/bin/ebuild-helpers/dohard
+++ b/bin/ebuild-helpers/dohard
@@ -7,7 +7,7 @@ if [[ $# -ne 2 ]] ; then
exit 1
fi
-[[ " ${USE} " == *" prefix "* ]] || \
+[[ " ${FEATURES} " == *" force-prefix "* ]] || \
case "$EAPI" in 0|1|2) ED=${D} ;; esac
destdir=${2%/*}
diff --git a/bin/ebuild-helpers/doinfo b/bin/ebuild-helpers/doinfo
index c4b767e9b..8fd7d45f8 100755
--- a/bin/ebuild-helpers/doinfo
+++ b/bin/ebuild-helpers/doinfo
@@ -9,7 +9,7 @@ if [[ -z $1 ]] ; then
exit 1
fi
-[[ " ${USE} " == *" prefix "* ]] || \
+[[ " ${FEATURES} " == *" force-prefix "* ]] || \
case "$EAPI" in 0|1|2) ED=${D} ;; esac
if [[ ! -d ${ED}usr/share/info ]] ; then
diff --git a/bin/ebuild-helpers/doins b/bin/ebuild-helpers/doins
index c3af28905..443bfdb21 100755
--- a/bin/ebuild-helpers/doins
+++ b/bin/ebuild-helpers/doins
@@ -27,7 +27,7 @@ else
DOINSRECUR=n
fi
-[[ " ${USE} " == *" prefix "* ]] || \
+[[ " ${FEATURES} " == *" force-prefix "* ]] || \
case "$EAPI" in 0|1|2) export ED="${D}" ;; esac
if [[ ${INSDESTTREE#${ED}} != "${INSDESTTREE}" ]]; then
diff --git a/bin/ebuild-helpers/dolib b/bin/ebuild-helpers/dolib
index 8357dfaa9..9af541890 100755
--- a/bin/ebuild-helpers/dolib
+++ b/bin/ebuild-helpers/dolib
@@ -4,7 +4,7 @@
source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
-[[ " ${USE} " == *" prefix "* ]] || \
+[[ " ${FEATURES} " == *" force-prefix "* ]] || \
case "$EAPI" in 0|1|2) ED=${D} ;; esac
# Setup ABI cruft
diff --git a/bin/ebuild-helpers/doman b/bin/ebuild-helpers/doman
index 817743d7e..b4047ce40 100755
--- a/bin/ebuild-helpers/doman
+++ b/bin/ebuild-helpers/doman
@@ -9,7 +9,7 @@ if [[ $# -lt 1 ]] ; then
exit 1
fi
-[[ " ${USE} " == *" prefix "* ]] || \
+[[ " ${FEATURES} " == *" force-prefix "* ]] || \
case "$EAPI" in 0|1|2) ED=${D} ;; esac
i18n=""
diff --git a/bin/ebuild-helpers/domo b/bin/ebuild-helpers/domo
index 551785e76..d994343a9 100755
--- a/bin/ebuild-helpers/domo
+++ b/bin/ebuild-helpers/domo
@@ -10,7 +10,7 @@ if [ ${mynum} -lt 1 ] ; then
exit 1
fi
-[[ " ${USE} " == *" prefix "* ]] || \
+[[ " ${FEATURES} " == *" force-prefix "* ]] || \
case "$EAPI" in 0|1|2) ED=${D} ;; esac
if [ ! -d "${ED}${DESTTREE}/share/locale" ] ; then
diff --git a/bin/ebuild-helpers/dosbin b/bin/ebuild-helpers/dosbin
index 560607754..d101c8a6d 100755
--- a/bin/ebuild-helpers/dosbin
+++ b/bin/ebuild-helpers/dosbin
@@ -9,7 +9,7 @@ if [[ $# -lt 1 ]] ; then
exit 1
fi
-[[ " ${USE} " == *" prefix "* ]] || \
+[[ " ${FEATURES} " == *" force-prefix "* ]] || \
case "$EAPI" in 0|1|2) ED=${D} ;; esac
if [[ ! -d ${ED}${DESTTREE}/sbin ]] ; then
diff --git a/bin/ebuild-helpers/dosed b/bin/ebuild-helpers/dosed
index 200b011fb..f202df7a7 100755
--- a/bin/ebuild-helpers/dosed
+++ b/bin/ebuild-helpers/dosed
@@ -7,7 +7,7 @@ if [[ $# -lt 1 ]] ; then
exit 1
fi
-[[ " ${USE} " == *" prefix "* ]] || \
+[[ " ${FEATURES} " == *" force-prefix "* ]] || \
case "$EAPI" in 0|1|2) ED=${D} ;; esac
ret=0
diff --git a/bin/ebuild-helpers/dosym b/bin/ebuild-helpers/dosym
index 8925001e4..5e41ec456 100755
--- a/bin/ebuild-helpers/dosym
+++ b/bin/ebuild-helpers/dosym
@@ -9,7 +9,7 @@ if [[ $# -ne 2 ]] ; then
exit 1
fi
-[[ " ${USE} " == *" prefix "* ]] || \
+[[ " ${FEATURES} " == *" force-prefix "* ]] || \
case "$EAPI" in 0|1|2) ED=${D} ;; esac
if [[ ${2} == */ ]] || \
diff --git a/bin/ebuild-helpers/ecompressdir b/bin/ebuild-helpers/ecompressdir
index 937ba268b..5ba44d755 100755
--- a/bin/ebuild-helpers/ecompressdir
+++ b/bin/ebuild-helpers/ecompressdir
@@ -9,7 +9,7 @@ if [[ -z $1 ]] ; then
exit 1
fi
-[[ " ${USE} " == *" prefix "* ]] || \
+[[ " ${FEATURES} " == *" force-prefix "* ]] || \
case "$EAPI" in 0|1|2) ED=${D} ;; esac
case $1 in
diff --git a/bin/ebuild-helpers/fowners b/bin/ebuild-helpers/fowners
index b3e4555cd..a5a28f2fb 100755
--- a/bin/ebuild-helpers/fowners
+++ b/bin/ebuild-helpers/fowners
@@ -4,7 +4,7 @@
source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
-[[ " ${USE} " == *" prefix "* ]] || \
+[[ " ${FEATURES} " == *" force-prefix "* ]] || \
case "$EAPI" in 0|1|2) ED=${D} ;; esac
# we can't prefix all arguments because
diff --git a/bin/ebuild-helpers/fperms b/bin/ebuild-helpers/fperms
index 207cf54a5..a2f77ea00 100755
--- a/bin/ebuild-helpers/fperms
+++ b/bin/ebuild-helpers/fperms
@@ -4,7 +4,7 @@
source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
-[[ " ${USE} " == *" prefix "* ]] || \
+[[ " ${FEATURES} " == *" force-prefix "* ]] || \
case "$EAPI" in 0|1|2) ED=${D} ;; esac
# we can't prefix all arguments because
diff --git a/bin/ebuild-helpers/prepall b/bin/ebuild-helpers/prepall
index 512feb33a..49e646cd2 100755
--- a/bin/ebuild-helpers/prepall
+++ b/bin/ebuild-helpers/prepall
@@ -4,7 +4,7 @@
source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
-[[ " ${USE} " == *" prefix "* ]] || \
+[[ " ${FEATURES} " == *" force-prefix "* ]] || \
case "$EAPI" in 0|1|2) ED=${D} ;; esac
if has chflags $FEATURES ; then
diff --git a/bin/ebuild-helpers/prepalldocs b/bin/ebuild-helpers/prepalldocs
index 1d0224981..560a02bcb 100755
--- a/bin/ebuild-helpers/prepalldocs
+++ b/bin/ebuild-helpers/prepalldocs
@@ -8,7 +8,7 @@ if [[ -n $1 ]] ; then
vecho "${0##*/}: invalid usage; takes no arguments" 1>&2
fi
-[[ " ${USE} " == *" prefix "* ]] || \
+[[ " ${FEATURES} " == *" force-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 183e1ca62..db9bbfacb 100755
--- a/bin/ebuild-helpers/prepallinfo
+++ b/bin/ebuild-helpers/prepallinfo
@@ -4,7 +4,7 @@
source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
-[[ " ${USE} " == *" prefix "* ]] || \
+[[ " ${FEATURES} " == *" force-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 a5699c2f1..dee1c7236 100755
--- a/bin/ebuild-helpers/prepallman
+++ b/bin/ebuild-helpers/prepallman
@@ -7,7 +7,7 @@ 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
-[[ " ${USE} " == *" prefix "* ]] || \
+[[ " ${FEATURES} " == *" force-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 6032b48c9..28320d975 100755
--- a/bin/ebuild-helpers/prepallstrip
+++ b/bin/ebuild-helpers/prepallstrip
@@ -2,7 +2,7 @@
# Copyright 1999-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-[[ " ${USE} " == *" prefix "* ]] || \
+[[ " ${FEATURES} " == *" force-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 7c60d9b86..ffe2ecec3 100755
--- a/bin/ebuild-helpers/prepinfo
+++ b/bin/ebuild-helpers/prepinfo
@@ -4,7 +4,7 @@
source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
-[[ " ${USE} " == *" prefix "* ]] || \
+[[ " ${FEATURES} " == *" force-prefix "* ]] || \
case "$EAPI" in 0|1|2) ED=${D} ;; esac
if [[ -z $1 ]] ; then
diff --git a/bin/ebuild-helpers/preplib b/bin/ebuild-helpers/preplib
index cbff76d4c..6e91cf33d 100755
--- a/bin/ebuild-helpers/preplib
+++ b/bin/ebuild-helpers/preplib
@@ -6,7 +6,7 @@ source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
eqawarn "QA Notice: Deprecated call to 'preplib'"
-[[ " ${USE} " == *" prefix "* ]] || \
+[[ " ${FEATURES} " == *" force-prefix "* ]] || \
case "$EAPI" in 0|1|2) ED=${D} ;; esac
LIBDIR_VAR="LIBDIR_${ABI}"
diff --git a/bin/ebuild-helpers/prepman b/bin/ebuild-helpers/prepman
index 18c0f992a..f96b64147 100755
--- a/bin/ebuild-helpers/prepman
+++ b/bin/ebuild-helpers/prepman
@@ -4,7 +4,7 @@
source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
-[[ " ${USE} " == *" prefix "* ]] || \
+[[ " ${FEATURES} " == *" force-prefix "* ]] || \
case "$EAPI" in 0|1|2) ED=${D} ;; esac
if [[ -z $1 ]] ; then
diff --git a/bin/ebuild-helpers/prepstrip b/bin/ebuild-helpers/prepstrip
index 085c93d56..15eed8457 100755
--- a/bin/ebuild-helpers/prepstrip
+++ b/bin/ebuild-helpers/prepstrip
@@ -18,7 +18,7 @@ exp_tf() {
exp_tf FEATURES installsources nostrip splitdebug
exp_tf RESTRICT binchecks installsources strip
-[[ " ${USE} " == *" prefix "* ]] || \
+[[ " ${FEATURES} " == *" force-prefix "* ]] || \
case "$EAPI" in 0|1|2) ED=${D} ;; esac
banner=false
diff --git a/bin/ebuild.sh b/bin/ebuild.sh
index d77b52c85..1f95adb82 100755
--- a/bin/ebuild.sh
+++ b/bin/ebuild.sh
@@ -670,7 +670,7 @@ else
declare -r $PORTAGE_READONLY_METADATA $PORTAGE_READONLY_VARS
case "$EAPI" in
0|1|2)
- [[ " ${USE} " == *" prefix "* ]] && \
+ [[ " ${FEATURES} " == *" force-prefix "* ]] && \
declare -r ED EPREFIX EROOT
;;
*)
diff --git a/bin/misc-functions.sh b/bin/misc-functions.sh
index 584d16a00..358288932 100755
--- a/bin/misc-functions.sh
+++ b/bin/misc-functions.sh
@@ -17,7 +17,7 @@ shift $#
source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}/ebuild.sh"
install_symlink_html_docs() {
- [[ " ${USE} " == *" prefix "* ]] || \
+ [[ " ${FEATURES} " == *" force-prefix "* ]] || \
case "$EAPI" in 0|1|2) local ED=${D} ;; esac
cd "${ED}" || die "cd failed"
#symlink the html documentation (if DOC_SYMLINKS_DIR is set in make.conf)
@@ -66,7 +66,7 @@ canonicalize() {
prepcompress() {
local -a include exclude incl_d incl_f
local f g i real_f real_d
- [[ " ${USE} " == *" prefix "* ]] || \
+ [[ " ${FEATURES} " == *" force-prefix "* ]] || \
case "$EAPI" in 0|1|2) local ED=${D} ;; esac
# Canonicalize path names and check for their existence.
@@ -149,7 +149,7 @@ prepcompress() {
install_qa_check() {
local f i x
- [[ " ${USE} " == *" prefix "* ]] || \
+ [[ " ${FEATURES} " == *" force-prefix "* ]] || \
case "$EAPI" in 0|1|2) local ED=${D} ;; esac
cd "${ED}" || die "cd failed"
@@ -889,7 +889,7 @@ preinst_mask() {
return 1
fi
- [[ " ${USE} " == *" prefix "* ]] || \
+ [[ " ${FEATURES} " == *" force-prefix "* ]] || \
case "$EAPI" in 0|1|2) local ED=${D} ;; esac
# Make sure $PWD is not ${D} so that we don't leave gmon.out files
@@ -918,7 +918,7 @@ preinst_sfperms() {
return 1
fi
- [[ " ${USE} " == *" prefix "* ]] || \
+ [[ " ${FEATURES} " == *" force-prefix "* ]] || \
case "$EAPI" in 0|1|2) local ED=${D} ;; esac
# Smart FileSystem Permissions
@@ -957,7 +957,7 @@ preinst_suid_scan() {
return 1
fi
- [[ " ${USE} " == *" prefix "* ]] || \
+ [[ " ${FEATURES} " == *" force-prefix "* ]] || \
case "$EAPI" in 0|1|2) local ED=${D} ;; esac
# total suid control.
@@ -1023,7 +1023,7 @@ preinst_selinux_labels() {
dyn_package() {
- [[ " ${USE} " == *" prefix "* ]] || \
+ [[ " ${FEATURES} " == *" force-prefix "* ]] || \
case "$EAPI" in 0|1|2) local ED=${D} ;; esac
# Make sure $PWD is not ${D} so that we don't leave gmon.out files
@@ -1104,7 +1104,7 @@ __END1__
dyn_rpm() {
- [[ " ${USE} " == *" prefix "* ]] || \
+ [[ " ${FEATURES} " == *" force-prefix "* ]] || \
case "$EAPI" in 0|1|2) local EPREFIX= ;; esac
cd "${T}" || die "cd failed"
diff --git a/bin/phase-functions.sh b/bin/phase-functions.sh
index 230291065..b19424291 100644
--- a/bin/phase-functions.sh
+++ b/bin/phase-functions.sh
@@ -96,7 +96,7 @@ filter_readonly_variables() {
# supported by the current EAPI.
case "${EAPI:-0}" in
0|1|2)
- [[ " ${USE} " == *" prefix "* ]] && \
+ [[ " ${FEATURES} " == *" force-prefix "* ]] && \
filtered_vars+=" ED EPREFIX EROOT"
;;
*)
@@ -502,7 +502,7 @@ dyn_install() {
ebuild_phase pre_src_install
_x=${ED}
- [[ " ${USE} " == *" prefix "* ]] || \
+ [[ " ${FEATURES} " == *" force-prefix "* ]] || \
case "$EAPI" in 0|1|2) _x=${D} ;; esac
rm -rf "${D}"
mkdir -p "${_x}"
@@ -564,7 +564,7 @@ dyn_install() {
# work in a different EPREFIX from the one is was built for.
case "${EAPI:-0}" in
0|1|2)
- [[ " ${USE} " == *" prefix "* ]] && \
+ [[ " ${FEATURES} " == *" force-prefix "* ]] && \
[ -n "${EPREFIX}" ] && echo "${EPREFIX}" > EPREFIX
;;
*)
diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh
index aadfac17d..969cecfe0 100644
--- a/bin/phase-helpers.sh
+++ b/bin/phase-helpers.sh
@@ -19,7 +19,7 @@ into() {
export DESTTREE=""
else
export DESTTREE=$1
- [[ " ${USE} " == *" prefix "* ]] || \
+ [[ " ${FEATURES} " == *" force-prefix "* ]] || \
case "$EAPI" in 0|1|2) local ED=${D} ;; esac
if [ ! -d "${ED}${DESTTREE}" ]; then
install -d "${ED}${DESTTREE}"
@@ -37,7 +37,7 @@ insinto() {
export INSDESTTREE=""
else
export INSDESTTREE=$1
- [[ " ${USE} " == *" prefix "* ]] || \
+ [[ " ${FEATURES} " == *" force-prefix "* ]] || \
case "$EAPI" in 0|1|2) local ED=${D} ;; esac
if [ ! -d "${ED}${INSDESTTREE}" ]; then
install -d "${ED}${INSDESTTREE}"
@@ -55,7 +55,7 @@ exeinto() {
export _E_EXEDESTTREE_=""
else
export _E_EXEDESTTREE_="$1"
- [[ " ${USE} " == *" prefix "* ]] || \
+ [[ " ${FEATURES} " == *" force-prefix "* ]] || \
case "$EAPI" in 0|1|2) local ED=${D} ;; esac
if [ ! -d "${ED}${_E_EXEDESTTREE_}" ]; then
install -d "${ED}${_E_EXEDESTTREE_}"
@@ -73,7 +73,7 @@ docinto() {
export _E_DOCDESTTREE_=""
else
export _E_DOCDESTTREE_="$1"
- [[ " ${USE} " == *" prefix "* ]] || \
+ [[ " ${FEATURES} " == *" force-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_}"
@@ -141,7 +141,7 @@ docompress() {
keepdir() {
dodir "$@"
local x
- [[ " ${USE} " == *" prefix "* ]] || \
+ [[ " ${FEATURES} " == *" force-prefix "* ]] || \
case "$EAPI" in 0|1|2) local ED=${D} ;; esac
if [ "$1" == "-R" ] || [ "$1" == "-r" ]; then
shift
@@ -379,7 +379,7 @@ unpack() {
econf() {
local x
- [[ " ${USE} " == *" prefix "* ]] || \
+ [[ " ${FEATURES} " == *" force-prefix "* ]] || \
case "$EAPI" in 0|1|2) local EPREFIX= ;; esac
_hasg() {
@@ -476,7 +476,7 @@ econf() {
einstall() {
# CONF_PREFIX is only set if they didn't pass in libdir above.
local LOCAL_EXTRA_EINSTALL="${EXTRA_EINSTALL}"
- [[ " ${USE} " == *" prefix "* ]] || \
+ [[ " ${FEATURES} " == *" force-prefix "* ]] || \
case "$EAPI" in 0|1|2) local ED=${D} ;; esac
LIBDIR_VAR="LIBDIR_${ABI}"
if [ -n "${ABI}" -a -n "${!LIBDIR_VAR}" ]; then
@@ -607,7 +607,7 @@ has_version() {
local eroot
case "$EAPI" in
0|1|2)
- [[ " ${USE} " == *" prefix "* ]] && \
+ [[ " ${FEATURES} " == *" force-prefix "* ]] && \
eroot=${ROOT%/}${EPREFIX}/ || eroot=${ROOT}
;;
*)
@@ -642,7 +642,7 @@ best_version() {
local eroot
case "$EAPI" in
0|1|2)
- [[ " ${USE} " == *" prefix "* ]] && \
+ [[ " ${FEATURES} " == *" force-prefix "* ]] && \
eroot=${ROOT%/}${EPREFIX}/ || eroot=${ROOT}
;;
*)
diff --git a/man/make.conf.5 b/man/make.conf.5
index d70d7b8e8..9e517e52c 100644
--- a/man/make.conf.5
+++ b/man/make.conf.5
@@ -322,6 +322,12 @@ fixes (order of flags, duplicated entries, ...)
Only fetch files from configured mirrors, ignoring \fBSRC_URI\fR,
except when \fImirror\fR is in the \fBebuild\fR(5) \fBRESTRICT\fR variable.
.TP
+.B force\-prefix
+Enable prefix support for all ebuilds, regardless of EAPI, since 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).
+.TP
.B lmirror
When \fImirror\fR is enabled in \fBFEATURES\fR, fetch files even
when \fImirror\fR is also in the \fBebuild\fR(5) \fBRESTRICT\fR variable.
diff --git a/pym/portage/const.py b/pym/portage/const.py
index 29c3878a6..3dad36a2e 100644
--- a/pym/portage/const.py
+++ b/pym/portage/const.py
@@ -90,7 +90,7 @@ SUPPORTED_FEATURES = frozenset([
"ccache", "chflags", "clean-logs",
"collision-protect", "compress-build-logs",
"digest", "distcc", "distcc-pump", "distlocks", "ebuild-locks", "fakeroot",
- "fail-clean", "force-mirror", "getbinpkg",
+ "fail-clean", "force-mirror", "force-prefix", "getbinpkg",
"installsources", "keeptemp", "keepwork", "fixlafiles", "lmirror",
"metadata-transfer", "mirror", "multilib-strict", "news",
"noauto", "noclean", "nodoc", "noinfo", "noman",
diff --git a/pym/portage/package/ebuild/config.py b/pym/portage/package/ebuild/config.py
index 1ccaee7c8..fb79e5ee1 100644
--- a/pym/portage/package/ebuild/config.py
+++ b/pym/portage/package/ebuild/config.py
@@ -2238,17 +2238,14 @@ class config(object):
if not eapi_exports_merge_type(eapi):
mydict.pop("MERGE_TYPE", None)
- # Prefix variables are supported beginning with EAPI 3, or when EPREFIX
- # is non-empty (implying that EPREFIX support is required in the
- # current environment, regardless of EAPI). For EAPIs prior to 3,
- # ebuild helpers rely on these variables only when USE=prefix is
- # enabled. 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).
+ # Prefix variables are supported beginning with EAPI 3, or when
+ # force-prefix is in FEATURES, since 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).
if phase == 'depend' or eapi is None or \
- (not eapi_supports_prefix(eapi) and not mydict.get("EPREFIX")):
+ ('force-prefix' not in self.features and
+ not eapi_supports_prefix(eapi)):
mydict.pop("ED", None)
mydict.pop("EPREFIX", None)
mydict.pop("EROOT", None)