From 11880fed8d7fa1cf3692213c84baa7dabefcc9f8 Mon Sep 17 00:00:00 2001 From: Davide Pesavento Date: Mon, 28 Dec 2015 02:09:03 +0100 Subject: 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(-) (limited to 'eclass') diff --git a/eclass/qt5-build.eclass b/eclass/qt5-build.eclass index 284febfa59a0..8665f3bfe30c 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 -- cgit v1.2.3-65-gdbad