Gentoo Archives: gentoo-dev

From: James Le Cuirot <chewi@g.o>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] [PATCH 1/2] waf-utils.eclass: Simplify output of configure command and arguments
Date: Thu, 10 Jan 2019 08:55:47
Message-Id: DD4C2E05-D765-41F9-9920-5A96BD097796@gentoo.org
In Reply to: Re: [gentoo-dev] [PATCH 1/2] waf-utils.eclass: Simplify output of configure command and arguments by "Michał Górny"
1 On 10 January 2019 03:33:56 GMT, "Michał Górny" <mgorny@g.o> wrote:
2 >On Wed, 2019-01-09 at 22:08 +0000, James Le Cuirot wrote:
3 >> We can just assign these to an array and echo before executing. Using
4 >> @Q makes Bash quote the output. This only works in Bash 4.4 and later
5 >> but on earlier versions, it simply doesn't quote.
6 >>
7 >> Signed-off-by: James Le Cuirot <chewi@g.o>
8 >> ---
9 >> eclass/waf-utils.eclass | 20 +++++++++++++-------
10 >> 1 file changed, 13 insertions(+), 7 deletions(-)
11 >>
12 >> diff --git a/eclass/waf-utils.eclass b/eclass/waf-utils.eclass
13 >> index 878068fc9f4f..8387829648a3 100644
14 >> --- a/eclass/waf-utils.eclass
15 >> +++ b/eclass/waf-utils.eclass
16 >> @@ -1,4 +1,4 @@
17 >> -# Copyright 1999-2015 Gentoo Foundation
18 >> +# Copyright 1999-2019 Gentoo Authors
19 >> # Distributed under the terms of the GNU General Public License v2
20 >>
21 >> # @ECLASS: waf-utils.eclass
22 >> @@ -84,13 +84,19 @@ waf-utils_src_configure() {
23 >> [[ -z ${NO_WAF_LIBDIR} ]] &&
24 >libdir=(--libdir="${EPREFIX}/usr/$(get_libdir)")
25 >>
26 >> tc-export AR CC CPP CXX RANLIB
27 >> - echo "CCFLAGS=\"${CFLAGS}\" LINKFLAGS=\"${CFLAGS} ${LDFLAGS}\"
28 >\"${WAF_BINARY}\" --prefix=${EPREFIX}/usr ${libdir[@]} $@ configure"
29 >>
30 >> - CCFLAGS="${CFLAGS}" LINKFLAGS="${CFLAGS} ${LDFLAGS}"
31 >"${WAF_BINARY}" \
32 >> - "--prefix=${EPREFIX}/usr" \
33 >> - "${libdir[@]}" \
34 >> - "${@}" \
35 >> - configure || die "configure failed"
36 >> + local CMD=(
37 >> + CCFLAGS="${CFLAGS}"
38 >> + LINKFLAGS="${CFLAGS} ${LDFLAGS}"
39 >> + "${WAF_BINARY}"
40 >> + "--prefix=${EPREFIX}/usr"
41 >> + "${libdir[@]}"
42 >> + "${@}"
43 >> + configure
44 >> + )
45 >> +
46 >> + echo "${CMD[@]@Q}"
47 >
48 >>&2
49 >
50 >> + env "${CMD[@]}" || die "configure failed"
51 >> }
52 >>
53 >> # @FUNCTION: waf-utils_src_compile
54
55 Obviously that wasn't there before but good call.
56 --
57 Sent from my Android device with K-9 Mail. Please excuse my brevity.