Gentoo Archives: gentoo-commits

From: Davide Pesavento <pesa@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: eclass/
Date: Tue, 02 Feb 2016 18:35:37
Message-Id: 1454438095.11880fed8d7fa1cf3692213c84baa7dabefcc9f8.pesa@gentoo
1 commit: 11880fed8d7fa1cf3692213c84baa7dabefcc9f8
2 Author: Davide Pesavento <pesa <AT> gentoo <DOT> org>
3 AuthorDate: Mon Dec 28 01:09:03 2015 +0000
4 Commit: Davide Pesavento <pesa <AT> gentoo <DOT> org>
5 CommitDate: Tue Feb 2 18:34:55 2016 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=11880fed
7
8 qt5-build.eclass: respect nonfatal in qt5_foreach_target_subdir()
9
10 In src_test it can be called from virtx, which uses nonfatal.
11
12 (cherry picked from proj/qt commit 2f873589218b6ac68864c12a359b9b6f70978d49)
13
14 eclass/qt5-build.eclass | 31 ++++++++++++++++---------------
15 1 file changed, 16 insertions(+), 15 deletions(-)
16
17 diff --git a/eclass/qt5-build.eclass b/eclass/qt5-build.eclass
18 index 284febf..8665f3b 100644
19 --- a/eclass/qt5-build.eclass
20 +++ b/eclass/qt5-build.eclass
21 @@ -246,13 +246,11 @@ qt5-build_src_test() {
22 _EOF_
23 chmod +x "${testrunner}"
24
25 - local testcmd=(
26 - qt5_foreach_target_subdir emake TESTRUNNER="'${testrunner}'" check
27 - )
28 + set -- qt5_foreach_target_subdir emake TESTRUNNER="'${testrunner}'" check
29 if [[ ${VIRTUALX_REQUIRED} == test ]]; then
30 - virtx "${testcmd[@]}"
31 + virtx "$@"
32 else
33 - "${testcmd[@]}"
34 + "$@"
35 fi
36 }
37
38 @@ -417,28 +415,31 @@ qt5_prepare_env() {
39 # @FUNCTION: qt5_foreach_target_subdir
40 # @INTERNAL
41 # @DESCRIPTION:
42 -# Executes the arguments inside each directory listed in QT5_TARGET_SUBDIRS.
43 +# Executes the command given as argument from inside each directory
44 +# listed in QT5_TARGET_SUBDIRS. Handles autotests subdirs automatically.
45 qt5_foreach_target_subdir() {
46 [[ -z ${QT5_TARGET_SUBDIRS[@]} ]] && QT5_TARGET_SUBDIRS=("")
47
48 - local ret=0 subdir=
49 + local die_args=()
50 + [[ ${EAPI} != 5 ]] && die_args+=(-n)
51 +
52 + local subdir=
53 for subdir in "${QT5_TARGET_SUBDIRS[@]}"; do
54 if [[ ${EBUILD_PHASE} == test ]]; then
55 subdir=tests/auto${subdir#src}
56 [[ -d ${S}/${subdir} ]] || continue
57 fi
58
59 - mkdir -p "${QT5_BUILD_DIR}/${subdir}" || die
60 - pushd "${QT5_BUILD_DIR}/${subdir}" >/dev/null || die
61 + local msg="Running $* ${subdir:+in ${subdir}}"
62 + einfo "${msg}"
63
64 - einfo "Running $* ${subdir:+in ${subdir}}"
65 - "$@"
66 - ((ret+=$?))
67 + mkdir -p "${QT5_BUILD_DIR}/${subdir}" || die "${die_args[@]}" || return $?
68 + pushd "${QT5_BUILD_DIR}/${subdir}" >/dev/null || die "${die_args[@]}" || return $?
69
70 - popd >/dev/null || die
71 - done
72 + "$@" || die "${die_args[@]}" "${msg} failed" || return $?
73
74 - return ${ret}
75 + popd >/dev/null || die "${die_args[@]}" || return $?
76 + done
77 }
78
79 # @FUNCTION: qt5_symlink_tools_to_build_dir