* [gentoo-commits] proj/portage:master commit in: bin/ebuild-helpers/, pym/portage/package/ebuild/, bin/
@ 2011-12-08 6:23 Zac Medico
0 siblings, 0 replies; only message in thread
From: Zac Medico @ 2011-12-08 6:23 UTC (permalink / raw
To: gentoo-commits
commit: ff52f9dc31004becb8022e6437088d01917f413c
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Dec 8 06:22:31 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Dec 8 06:22:31 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=ff52f9dc
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).
---
bin/ebuild-helpers/dobin | 5 +++--
bin/ebuild-helpers/dodir | 3 ++-
bin/ebuild-helpers/dodoc | 3 ++-
bin/ebuild-helpers/doexe | 3 ++-
bin/ebuild-helpers/dohard | 3 ++-
bin/ebuild-helpers/doinfo | 3 ++-
bin/ebuild-helpers/doins | 3 ++-
bin/ebuild-helpers/dolib | 3 ++-
bin/ebuild-helpers/doman | 3 ++-
bin/ebuild-helpers/domo | 3 ++-
bin/ebuild-helpers/dosbin | 3 ++-
bin/ebuild-helpers/dosed | 3 ++-
bin/ebuild-helpers/dosym | 3 ++-
bin/ebuild-helpers/ecompressdir | 3 ++-
bin/ebuild-helpers/fowners | 3 ++-
bin/ebuild-helpers/fperms | 4 +++-
bin/ebuild-helpers/prepall | 3 ++-
bin/ebuild-helpers/prepalldocs | 3 ++-
bin/ebuild-helpers/prepallinfo | 3 ++-
bin/ebuild-helpers/prepallman | 3 ++-
bin/ebuild-helpers/prepallstrip | 3 ++-
bin/ebuild-helpers/prepinfo | 3 ++-
bin/ebuild-helpers/preplib | 3 ++-
bin/ebuild-helpers/prepman | 3 ++-
bin/ebuild-helpers/prepstrip | 3 ++-
bin/ebuild.sh | 2 ++
bin/misc-functions.sh | 24 ++++++++++++++++--------
bin/phase-functions.sh | 5 ++++-
bin/phase-helpers.sh | 27 ++++++++++++++++++---------
pym/portage/package/ebuild/config.py | 13 +++++++++++--
30 files changed, 103 insertions(+), 46 deletions(-)
diff --git a/bin/ebuild-helpers/dobin b/bin/ebuild-helpers/dobin
index af3af0d..7ea29d4 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 7db7caf..5bedd05 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 37bbc79..6280536 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 a5b9af0..65f355a 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 cf6fb11..7a6fc76 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 a922ef1..c4b767e 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 b9189d5..c3af289 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 9dd11d8..8357dfa 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 27401f3..817743d 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 0e3656d..551785e 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 d0783ed..5606077 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 00cf5da..200b011 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 8b7b304..8925001 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 f9a846a..937ba26 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 3f51b4e..b3e4555 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 9a2971a..207cf54 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 611c4ce..512feb3 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 540d025..1d02249 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 e351f87..183e1ca 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 be7f194..a5699c2 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 e9f5f8e..6032b48 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 afe214c..7c60d9b 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 8c62921..cbff76d 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 8ea7607..18c0f99 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 fac20b2..085c93d 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
diff --git a/bin/ebuild.sh b/bin/ebuild.sh
index a3ac1e0..d77b52c 100755
--- a/bin/ebuild.sh
+++ b/bin/ebuild.sh
@@ -670,6 +670,8 @@ else
declare -r $PORTAGE_READONLY_METADATA $PORTAGE_READONLY_VARS
case "$EAPI" in
0|1|2)
+ [[ " ${USE} " == *" prefix "* ]] && \
+ declare -r ED EPREFIX EROOT
;;
*)
declare -r ED EPREFIX EROOT
diff --git a/bin/misc-functions.sh b/bin/misc-functions.sh
index 1c11dc5..584d16a 100755
--- a/bin/misc-functions.sh
+++ b/bin/misc-functions.sh
@@ -17,7 +17,8 @@ shift $#
source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}/ebuild.sh"
install_symlink_html_docs() {
- case "$EAPI" in 0|1|2) local ED=${D} ;; esac
+ [[ " ${USE} " == *" 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)
if [ -n "${DOC_SYMLINKS_DIR}" ] ; then
@@ -65,7 +66,8 @@ canonicalize() {
prepcompress() {
local -a include exclude incl_d incl_f
local f g i real_f real_d
- case "$EAPI" in 0|1|2) local ED=${D} ;; esac
+ [[ " ${USE} " == *" prefix "* ]] || \
+ case "$EAPI" in 0|1|2) local ED=${D} ;; esac
# Canonicalize path names and check for their existence.
real_d=$(canonicalize "${ED}")
@@ -147,7 +149,8 @@ prepcompress() {
install_qa_check() {
local f i x
- case "$EAPI" in 0|1|2) local ED=${D} ;; esac
+ [[ " ${USE} " == *" prefix "* ]] || \
+ case "$EAPI" in 0|1|2) local ED=${D} ;; esac
cd "${ED}" || die "cd failed"
@@ -886,7 +889,8 @@ preinst_mask() {
return 1
fi
- case "$EAPI" in 0|1|2) local ED=${D} ;; esac
+ [[ " ${USE} " == *" 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
# in there in case any tools were built with -pg in CFLAGS.
@@ -914,7 +918,8 @@ preinst_sfperms() {
return 1
fi
- case "$EAPI" in 0|1|2) local ED=${D} ;; esac
+ [[ " ${USE} " == *" prefix "* ]] || \
+ case "$EAPI" in 0|1|2) local ED=${D} ;; esac
# Smart FileSystem Permissions
if has sfperms $FEATURES; then
@@ -952,7 +957,8 @@ preinst_suid_scan() {
return 1
fi
- case "$EAPI" in 0|1|2) local ED=${D} ;; esac
+ [[ " ${USE} " == *" prefix "* ]] || \
+ case "$EAPI" in 0|1|2) local ED=${D} ;; esac
# total suid control.
if has suidctl $FEATURES; then
@@ -1017,7 +1023,8 @@ preinst_selinux_labels() {
dyn_package() {
- case "$EAPI" in 0|1|2) local ED=${D} ;; esac
+ [[ " ${USE} " == *" 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
# in there in case any tools were built with -pg in CFLAGS.
@@ -1097,7 +1104,8 @@ __END1__
dyn_rpm() {
- case "$EAPI" in 0|1|2) local EPREFIX= ;; esac
+ [[ " ${USE} " == *" prefix "* ]] || \
+ case "$EAPI" in 0|1|2) local EPREFIX= ;; esac
cd "${T}" || die "cd failed"
local machine_name=$(uname -m)
diff --git a/bin/phase-functions.sh b/bin/phase-functions.sh
index f46368d..351ae9e 100644
--- a/bin/phase-functions.sh
+++ b/bin/phase-functions.sh
@@ -96,6 +96,8 @@ filter_readonly_variables() {
# supported by the current EAPI.
case "${EAPI:-0}" in
0|1|2)
+ [[ " ${USE} " == *" prefix "* ]] && \
+ filtered_vars+=" ED EPREFIX EROOT"
;;
*)
filtered_vars+=" ED EPREFIX EROOT"
@@ -500,7 +502,8 @@ dyn_install() {
ebuild_phase pre_src_install
_x=${ED}
- case "$EAPI" in 0|1|2) _x=${D} ;; esac
+ [[ " ${USE} " == *" prefix "* ]] || \
+ case "$EAPI" in 0|1|2) _x=${D} ;; esac
rm -rf "${D}"
mkdir -p "${_x}"
unset _x
diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh
index 04cf35a..aadfac1 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}/
diff --git a/pym/portage/package/ebuild/config.py b/pym/portage/package/ebuild/config.py
index 2995740..1ccaee7 100644
--- a/pym/portage/package/ebuild/config.py
+++ b/pym/portage/package/ebuild/config.py
@@ -2238,8 +2238,17 @@ class config(object):
if not eapi_exports_merge_type(eapi):
mydict.pop("MERGE_TYPE", None)
- # Prefix variables are supported starting with EAPI 3.
- if phase == 'depend' or eapi is None or not eapi_supports_prefix(eapi):
+ # 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).
+ if phase == 'depend' or eapi is None or \
+ (not eapi_supports_prefix(eapi) and not mydict.get("EPREFIX")):
mydict.pop("ED", None)
mydict.pop("EPREFIX", None)
mydict.pop("EROOT", None)
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2011-12-08 6:23 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-12-08 6:23 [gentoo-commits] proj/portage:master commit in: bin/ebuild-helpers/, pym/portage/package/ebuild/, bin/ Zac Medico
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox