[prev in list] [next in list] [prev in thread] [next in thread] 

List:       gentoo-dev
Subject:    Re: [gentoo-dev] [PATCH 1/2] waf-utils.eclass: Simplify output of configure command and arguments
From:       James Le Cuirot <chewi () gentoo ! org>
Date:       2019-01-10 8:55:37
Message-ID: DD4C2E05-D765-41F9-9920-5A96BD097796 () gentoo ! org
[Download RAW message or body]

On 10 January 2019 03:33:56 GMT, "Michał Górny" <mgorny@gentoo.org> wrote:
>On Wed, 2019-01-09 at 22:08 +0000, James Le Cuirot wrote:
>> 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 | 20 +++++++++++++-------
>>  1 file changed, 13 insertions(+), 7 deletions(-)
>> 
>> diff --git a/eclass/waf-utils.eclass b/eclass/waf-utils.eclass
>> index 878068fc9f4f..8387829648a3 100644
>> --- a/eclass/waf-utils.eclass
>> +++ b/eclass/waf-utils.eclass
>> @@ -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

Obviously that wasn't there before but good call.
-- 
Sent from my Android device with K-9 Mail. Please excuse my brevity.

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic