Save EPREFIX in vdb when appropriate.
authorZac Medico <zmedico@gentoo.org>
Thu, 8 Dec 2011 06:43:06 +0000 (22:43 -0800)
committerZac Medico <zmedico@gentoo.org>
Thu, 8 Dec 2011 06:43:06 +0000 (22:43 -0800)
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.

bin/phase-functions.sh

index 351ae9e1d6d8e9f0433e67b200288dca177b3075..2302910653990d919a57c9a51908a427b3786ee1 100644 (file)
@@ -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.