commit: 2f873589218b6ac68864c12a359b9b6f70978d49
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: Mon Dec 28 01:11:13 2015 +0000
URL: https://gitweb.gentoo.org/proj/qt.git/commit/?id=2f873589
qt5-build.eclass: respect nonfatal in qt5_foreach_target_subdir()
In src_test it can be called from virtx, which uses nonfatal.
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 7bac25e..9eb17b3 100644
--- a/eclass/qt5-build.eclass
+++ b/eclass/qt5-build.eclass
@@ -253,13 +253,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
}
@@ -424,28 +422,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