In the preprocess_ebuild_env() subshell, check for errors and
authorZac Medico <zmedico@gentoo.org>
Wed, 28 Nov 2007 00:02:21 +0000 (00:02 -0000)
committerZac Medico <zmedico@gentoo.org>
Wed, 28 Nov 2007 00:02:21 +0000 (00:02 -0000)
return early when necessary.

svn path=/main/trunk/; revision=8718

bin/ebuild.sh

index 2648bdb4240ed49898a39e875329dae5036772f4..e23434670b853ddab1571ae9aa5d562e90ddc807 100755 (executable)
@@ -1417,18 +1417,18 @@ preprocess_ebuild_env() {
        # called. Any variables that need to be relied upon should already be
        # filtered out above.
        (
-               source "${T}/environment" && \
-                       touch "${T}/environment.success"
+               source "${T}/environment" || exit $?
 
                # It's remotely possible that save_ebuild_env() has been overridden
                # by the above source command. To protect ourselves, we override it
                # here with our own version. ${PORTAGE_BIN_PATH} is safe to use here
                # because it's already filtered above.
-               source "${PORTAGE_BIN_PATH}/isolated-functions.sh"
+               source "${PORTAGE_BIN_PATH}/isolated-functions.sh" || exit $?
 
                # Rely on save_ebuild_env() to filter out any remaining variables
                # and functions that could interfere with the current environment.
-               save_ebuild_env
+               save_ebuild_env || exit $?
+               touch "${T}/environment.success" || exit $?
        ) | filter_readonly_variables > "${T}/environment.filtered"
        if [ -e "${T}/environment.success" ] ; then
                rm "${T}/environment.success"