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: Nick Bowler
Subject: Re: autoconf test for `ls -t` doesn't account for envar QUOTING_STYLE
Date: Wed, 24 Oct 2018 00:37:27 -0400

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



reply via email to

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