Gentoo Archives: gentoo-dev

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

Attachments

File name MIME type
signature.asc application/pgp-signature

Replies