Gentoo Archives: gentoo-commits

From: Davide Pesavento <pesa@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/qt:master commit in: eclass/
Date: Mon, 28 Dec 2015 01:42:07
Message-Id: 1451265073.2f873589218b6ac68864c12a359b9b6f70978d49.pesa@gentoo
1 commit: 2f873589218b6ac68864c12a359b9b6f70978d49
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: Mon Dec 28 01:11:13 2015 +0000
6 URL: https://gitweb.gentoo.org/proj/qt.git/commit/?id=2f873589
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 eclass/qt5-build.eclass | 31 ++++++++++++++++---------------
13 1 file changed, 16 insertions(+), 15 deletions(-)
14
15 diff --git a/eclass/qt5-build.eclass b/eclass/qt5-build.eclass
16 index 7bac25e..9eb17b3 100644
17 --- a/eclass/qt5-build.eclass
18 +++ b/eclass/qt5-build.eclass
19 @@ -253,13 +253,11 @@ qt5-build_src_test() {
20 _EOF_
21 chmod +x "${testrunner}"
22
23 - local testcmd=(
24 - qt5_foreach_target_subdir emake TESTRUNNER="'${testrunner}'" check
25 - )
26 + set -- qt5_foreach_target_subdir emake TESTRUNNER="'${testrunner}'" check
27 if [[ ${VIRTUALX_REQUIRED} == test ]]; then
28 - virtx "${testcmd[@]}"
29 + virtx "$@"
30 else
31 - "${testcmd[@]}"
32 + "$@"
33 fi
34 }
35
36 @@ -424,28 +422,31 @@ qt5_prepare_env() {
37 # @FUNCTION: qt5_foreach_target_subdir
38 # @INTERNAL
39 # @DESCRIPTION:
40 -# Executes the arguments inside each directory listed in QT5_TARGET_SUBDIRS.
41 +# Executes the command given as argument from inside each directory
42 +# listed in QT5_TARGET_SUBDIRS. Handles autotests subdirs automatically.
43 qt5_foreach_target_subdir() {
44 [[ -z ${QT5_TARGET_SUBDIRS[@]} ]] && QT5_TARGET_SUBDIRS=("")
45
46 - local ret=0 subdir=
47 + local die_args=()
48 + [[ ${EAPI} != 5 ]] && die_args+=(-n)
49 +
50 + local subdir=
51 for subdir in "${QT5_TARGET_SUBDIRS[@]}"; do
52 if [[ ${EBUILD_PHASE} == test ]]; then
53 subdir=tests/auto${subdir#src}
54 [[ -d ${S}/${subdir} ]] || continue
55 fi
56
57 - mkdir -p "${QT5_BUILD_DIR}/${subdir}" || die
58 - pushd "${QT5_BUILD_DIR}/${subdir}" >/dev/null || die
59 + local msg="Running $* ${subdir:+in ${subdir}}"
60 + einfo "${msg}"
61
62 - einfo "Running $* ${subdir:+in ${subdir}}"
63 - "$@"
64 - ((ret+=$?))
65 + mkdir -p "${QT5_BUILD_DIR}/${subdir}" || die "${die_args[@]}" || return $?
66 + pushd "${QT5_BUILD_DIR}/${subdir}" >/dev/null || die "${die_args[@]}" || return $?
67
68 - popd >/dev/null || die
69 - done
70 + "$@" || die "${die_args[@]}" "${msg} failed" || return $?
71
72 - return ${ret}
73 + popd >/dev/null || die "${die_args[@]}" || return $?
74 + done
75 }
76
77 # @FUNCTION: qt5_symlink_tools_to_build_dir