commit:     11880fed8d7fa1cf3692213c84baa7dabefcc9f8
Author:     Davide Pesavento <pesa <AT> gentoo <DOT> org>
AuthorDate: Mon Dec 28 01:09:03 2015 +0000
Commit:     Davide Pesavento <pesa <AT> gentoo <DOT> org>
CommitDate: Tue Feb  2 18:34:55 2016 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=11880fed

qt5-build.eclass: respect nonfatal in qt5_foreach_target_subdir()

In src_test it can be called from virtx, which uses nonfatal.

(cherry picked from proj/qt commit 2f873589218b6ac68864c12a359b9b6f70978d49)

 eclass/qt5-build.eclass | 31 ++++++++++++++++---------------
 1 file changed, 16 insertions(+), 15 deletions(-)

diff --git a/eclass/qt5-build.eclass b/eclass/qt5-build.eclass
index 284febf..8665f3b 100644
--- a/eclass/qt5-build.eclass
+++ b/eclass/qt5-build.eclass
@@ -246,13 +246,11 @@ qt5-build_src_test() {
        _EOF_
        chmod +x "${testrunner}"
 
-       local testcmd=(
-               qt5_foreach_target_subdir emake TESTRUNNER="'${testrunner}'" 
check
-       )
+       set -- qt5_foreach_target_subdir emake TESTRUNNER="'${testrunner}'" 
check
        if [[ ${VIRTUALX_REQUIRED} == test ]]; then
-               virtx "${testcmd[@]}"
+               virtx "$@"
        else
-               "${testcmd[@]}"
+               "$@"
        fi
 }
 
@@ -417,28 +415,31 @@ qt5_prepare_env() {
 # @FUNCTION: qt5_foreach_target_subdir
 # @INTERNAL
 # @DESCRIPTION:
-# Executes the arguments inside each directory listed in QT5_TARGET_SUBDIRS.
+# Executes the command given as argument from inside each directory
+# listed in QT5_TARGET_SUBDIRS. Handles autotests subdirs automatically.
 qt5_foreach_target_subdir() {
        [[ -z ${QT5_TARGET_SUBDIRS[@]} ]] && QT5_TARGET_SUBDIRS=("")
 
-       local ret=0 subdir=
+       local die_args=()
+       [[ ${EAPI} != 5 ]] && die_args+=(-n)
+
+       local subdir=
        for subdir in "${QT5_TARGET_SUBDIRS[@]}"; do
                if [[ ${EBUILD_PHASE} == test ]]; then
                        subdir=tests/auto${subdir#src}
                        [[ -d ${S}/${subdir} ]] || continue
                fi
 
-               mkdir -p "${QT5_BUILD_DIR}/${subdir}" || die
-               pushd "${QT5_BUILD_DIR}/${subdir}" >/dev/null || die
+               local msg="Running $* ${subdir:+in ${subdir}}"
+               einfo "${msg}"
 
-               einfo "Running $* ${subdir:+in ${subdir}}"
-               "$@"
-               ((ret+=$?))
+               mkdir -p "${QT5_BUILD_DIR}/${subdir}" || die "${die_args[@]}" 
|| return $?
+               pushd "${QT5_BUILD_DIR}/${subdir}" >/dev/null || die 
"${die_args[@]}" || return $?
 
-               popd >/dev/null || die
-       done
+               "$@" || die "${die_args[@]}" "${msg} failed" || return $?
 
-       return ${ret}
+               popd >/dev/null || die "${die_args[@]}" || return $?
+       done
 }
 
 # @FUNCTION: qt5_symlink_tools_to_build_dir

Reply via email to