waf-utils.eclass: Simplify output of configure command and arguments
authorJames Le Cuirot <chewi@gentoo.org>
Wed, 9 Jan 2019 21:49:27 +0000 (21:49 +0000)
committerJames Le Cuirot <chewi@gentoo.org>
Sun, 13 Jan 2019 22:47:16 +0000 (22:47 +0000)
We can just assign these to an array and echo before executing. Using
@Q makes Bash quote the output. This only works in Bash 4.4 and later
but on earlier versions, it simply doesn't quote.

Signed-off-by: James Le Cuirot <chewi@gentoo.org>
eclass/waf-utils.eclass

index 878068fc9f4f1dd72a9c198783814151c03f15fb..dc21baafc9d20037aa8b18dee3c82cadb6633253 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright 1999-2015 Gentoo Foundation
+# Copyright 1999-2019 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 # @ECLASS: waf-utils.eclass
@@ -84,13 +84,19 @@ waf-utils_src_configure() {
        [[ -z ${NO_WAF_LIBDIR} ]] && libdir=(--libdir="${EPREFIX}/usr/$(get_libdir)")
 
        tc-export AR CC CPP CXX RANLIB
-       echo "CCFLAGS=\"${CFLAGS}\" LINKFLAGS=\"${CFLAGS} ${LDFLAGS}\" \"${WAF_BINARY}\" --prefix=${EPREFIX}/usr ${libdir[@]} $@ configure"
 
-       CCFLAGS="${CFLAGS}" LINKFLAGS="${CFLAGS} ${LDFLAGS}" "${WAF_BINARY}" \
-               "--prefix=${EPREFIX}/usr" \
-               "${libdir[@]}" \
-               "${@}" \
-               configure || die "configure failed"
+       local CMD=(
+               CCFLAGS="${CFLAGS}"
+               LINKFLAGS="${CFLAGS} ${LDFLAGS}"
+               "${WAF_BINARY}"
+               "--prefix=${EPREFIX}/usr"
+               "${libdir[@]}"
+               "${@}"
+               configure
+       )
+
+       echo "${CMD[@]@Q}" >&2
+       env "${CMD[@]}" || die "configure failed"
 }
 
 # @FUNCTION: waf-utils_src_compile