summaryrefslogtreecommitdiffstats
path: root/bin/phase-functions.sh
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2011-12-07 22:43:06 -0800
committerZac Medico <zmedico@gentoo.org>2011-12-07 22:43:06 -0800
commit5cd61be51c5d6c9e4714e65db77ad9c27b2fb9a7 (patch)
tree9064aba1844774a721511c9c6f8cb17dd346ac47 /bin/phase-functions.sh
parentff52f9dc31004becb8022e6437088d01917f413c (diff)
downloadportage-5cd61be51c5d6c9e4714e65db77ad9c27b2fb9a7.tar.gz
portage-5cd61be51c5d6c9e4714e65db77ad9c27b2fb9a7.tar.bz2
portage-5cd61be51c5d6c9e4714e65db77ad9c27b2fb9a7.zip
Save EPREFIX in vdb when appropriate.
The prefix branch already does this since it makes it easy to use chpathtool to adjust the content of a binary package so that it will work in a different EPREFIX from the one is was built for.
Diffstat (limited to 'bin/phase-functions.sh')
-rw-r--r--bin/phase-functions.sh14
1 files changed, 14 insertions, 0 deletions
diff --git a/bin/phase-functions.sh b/bin/phase-functions.sh
index 351ae9e1d..230291065 100644
--- a/bin/phase-functions.sh
+++ b/bin/phase-functions.sh
@@ -558,6 +558,20 @@ dyn_install() {
fi
echo "${USE}" > USE
echo "${EAPI:-0}" > EAPI
+
+ # Save EPREFIX, since it makes it easy to use chpathtool to
+ # adjust the content of a binary package so that it will
+ # work in a different EPREFIX from the one is was built for.
+ case "${EAPI:-0}" in
+ 0|1|2)
+ [[ " ${USE} " == *" prefix "* ]] && \
+ [ -n "${EPREFIX}" ] && echo "${EPREFIX}" > EPREFIX
+ ;;
+ *)
+ [ -n "${EPREFIX}" ] && echo "${EPREFIX}" > EPREFIX
+ ;;
+ esac
+
set +f
# local variables can leak into the saved environment.