bug-autoconf
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: autoconf test for `ls -t` doesn't account for envar QUOTING_STYLE


From: Cathy Garrett
Subject: Re: autoconf test for `ls -t` doesn't account for envar QUOTING_STYLE
Date: Wed, 24 Oct 2018 00:49:50 -0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1

On 10/24/18 12:37 AM, Nick Bowler wrote:
> On 10/23/18, Cathy Garrett <address@hidden> wrote:
>> I've found a bug in autoconf related to the ls command's environment
>> variable QUOTING_STYLE.
>>
>> By having QUOTING_STYLE=c in my environment, the following stanza fails.
>> The reason for the failure is in the code
> [...]
>>      set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
> [...]
>> if test "$*" != "X $srcdir/configure conftest.file" \
>>         && test "$*" != "X conftest.file $srcdir/configure"; then
>>
>> My ls is not aliased, but because of my use of the envar QUOTING_STYLE,
>> it makes $* look like this:
>>
>> X "./configure" "conftest.file"
> Oh lovely, so GNU coreutils grew a portability wart in that having this
> variable in the environment breaks longstanding unix tradition on how
> "ls" should behave, and presumably this is also at odds with the POSIX
> standard...
>
> I guess the portability section of the Autoconf manual needs an update.
>
> I suspect m4sh should forcibly unset this variable during shell init,
> like it does with CDPATH.  Unfortunately, if setting it to the empty
> string is bad, there is no portable way to unset variables...  maybe
> that doesn't matter for any system running suitably new versions of
> GNU ls.  Alternately, one could do something like (untested) early in
> configure:
>
>   test ! ${QUOTING_STYLE+y} || QUOTING_STYLE=literal
>
> to work around setting it to the empty string...
>
> Cheers,
>   Nick

I agree. QUOTING_STYLE envar is a bad idea. Nothing wrong with
--quoting_style= cmdline arg. At least then, if shoehorned into an
alias, at least the autoconf error message would still be right. In the
interrim, just adding a blurb about "it might be an alias for ls or the
QUOTING_STYLE envar" would be ample, in my opinion.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]