ebuild.sh: source /etc/portage/env scripts after /etc/portage/bashrc
authorJames Le Cuirot <chewi@aura-online.co.uk>
Sat, 28 Apr 2012 16:33:07 +0000 (17:33 +0100)
committerZac Medico <zmedico@gentoo.org>
Sat, 28 Apr 2012 20:17:37 +0000 (13:17 -0700)
This will fix bug #413895.

bin/ebuild.sh

index b1d1df158f22dbb38b76af0d8d27def244c85ae2..173865cde219682dd6f3d39c41ccf49b60c314c0 100755 (executable)
@@ -375,7 +375,19 @@ source_all_bashrcs() {
                for x in "${path_array[@]}" ; do
                        [ -f "$x/profile.bashrc" ] && qa_source "$x/profile.bashrc"
                done
+       fi
+
+       if [ -r "${PORTAGE_BASHRC}" ] ; then
+               if [ "$PORTAGE_DEBUG" != "1" ] || [ "${-/x/}" != "$-" ]; then
+                       source "${PORTAGE_BASHRC}"
+               else
+                       set -x
+                       source "${PORTAGE_BASHRC}"
+                       set +x
+               fi
+       fi
 
+       if [[ $EBUILD_PHASE != depend ]] ; then
                # The user's bashrc is the ONLY non-portage bit of code that can
                # change shopts without a QA violation.
                for x in "${PM_EBUILD_HOOK_DIR}"/${CATEGORY}/{${PN},${PN}:${SLOT},${P},${PF}}; do
@@ -394,16 +406,6 @@ source_all_bashrcs() {
                done
        fi
 
-       if [ -r "${PORTAGE_BASHRC}" ] ; then
-               if [ "$PORTAGE_DEBUG" != "1" ] || [ "${-/x/}" != "$-" ]; then
-                       source "${PORTAGE_BASHRC}"
-               else
-                       set -x
-                       source "${PORTAGE_BASHRC}"
-                       set +x
-               fi
-       fi
-
        [ ! -z "${OCC}" ] && export CC="${OCC}"
        [ ! -z "${OCXX}" ] && export CXX="${OCXX}"
 }