On 01/14/2011 01:56 AM, Jim Meyering wrote:
>> line, so then it remains ''.  Shouldn't this be
>>
>>   : ${gnulib_path:=gnulib}
>>
>> (or equivalent if this method is not sufficiently portable) so that it
>> will be set to the default value if $gnulib_path is unset or empty,
>> not just if it is unset?  It looks to me that $gnulib_path will always
>> be set, to the default value of "gnulib" will never be used.
> 
> Here's a proposed patch.
> There may be another way to do it using something like := as you suggest,
> but using an explicit "test and set" seems safer, given the portability
> caveats in autoconf's shellology section.

: "${gnulib_path:=gnulib}"

is (believe it or not) portable.

: ${gnulib_path:=gnulib}

is also portable, but if $gnulib_path expands to any glob characters, it
wastes time doing unnecessary file name splitting.

> 
>  gnulib_path=`git_modules_config submodule.gnulib.path`
> -: ${gnulib_path=gnulib}
> +test -z "$gnulib_path" && gnulib_path=gnulib

This is less compact, but also portable, so no need to change it.

-- 
Eric Blake   [email protected]    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to