summaryrefslogtreecommitdiff
path: root/eclass
diff options
context:
space:
mode:
authorDavide Pesavento <pesa@gentoo.org>2015-12-28 02:09:03 +0100
committerDavide Pesavento <pesa@gentoo.org>2016-02-02 19:34:55 +0100
commit11880fed8d7fa1cf3692213c84baa7dabefcc9f8 (patch)
tree32f525a5c22fb5fb691b7401a3341b708b36c6bd /eclass
parentqt5-build.eclass: move VIRTUALX_REQUIRED definition before inherit (diff)
downloadgentoo-11880fed8d7fa1cf3692213c84baa7dabefcc9f8.tar.gz
gentoo-11880fed8d7fa1cf3692213c84baa7dabefcc9f8.tar.bz2
gentoo-11880fed8d7fa1cf3692213c84baa7dabefcc9f8.zip
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)
Diffstat (limited to 'eclass')
-rw-r--r--eclass/qt5-build.eclass31
1 files changed, 16 insertions, 15 deletions
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