autoconf-patches
[Top][All Lists]
Advanced

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

Re: [RFC PATCH] m4sh: detect any shell that lacks ${a:-b} support


From: Eric Blake
Subject: Re: [RFC PATCH] m4sh: detect any shell that lacks ${a:-b} support
Date: Wed, 25 Aug 2010 08:08:09 -0600
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.8) Gecko/20100806 Fedora/3.1.2-1.fc13 Mnenhy/0.8.3 Thunderbird/3.1.2

On 08/24/2010 11:37 PM, Ralf Wildenhues wrote:
The more aggressive approach is to assume that all shells that
support shell functions also support : in variable substitutions;

I can't really judge this one well.  If Paul doesn't know, Sven
Mascheck's pages are a good indicator.

I think I'll go with the more aggressive patch and assume that : works based on [1]; hopefully enough people with alternate shells run the testsuite and point out any regressions (although such are unlikely to occur); I've already tested some older versions of ash, bash, zsh, posh, dash, yash, ksh, and Solaris /bin/sh.

[1] http://www.in-ulm.de/~mascheck/bourne/
says that System III added ${a:=b} at the same time as [!..] negated globbing, and that functions came later in SVR2.


Should we also update tests/m4sh.at to add a test next
to 'Negated classes in globbing' and 'Functions support'
to reiterate this spy in the autoconf testsuite?

Yes, that would be good.  Thanks!

Some of the comments in the existing tests are out of date, too. I guess that means I need to respin and re-post this patch with all of those fixes.

+_AS_RUN([_AS_SHELL_NULL_WORKS]) || {
+  echo No shell found that supports \${a:-b}.

Please quote {a:-b} otherwise there is the slight chance that the { }
get removed if there is a file named '$a:-b' in the current directory.
Also, output to stderr?

Sure. I was blindly copying from commit 734abde3, which was the last time we had a spy in autoconf code, and used stdout instead of stderr. But since I'm going to go with the more aggressive approach of assuming : works, we won't need the spy after all.

--
Eric Blake   address@hidden    +1-801-349-2682
Libvirt virtualization library http://libvirt.org



reply via email to

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