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: Ralf Wildenhues
Subject: Re: [RFC PATCH] m4sh: detect any shell that lacks ${a:-b} support
Date: Wed, 25 Aug 2010 07:37:41 +0200
User-agent: Mutt/1.5.20 (2010-04-22)

Hi Eric,

* Eric Blake wrote on Wed, Aug 25, 2010 at 12:22:00AM CEST:
> * lib/m4sugar/m4sh.m4 (_AS_SHELL_NULL_WORKS, _AS_SHELL_NULL_SPY):
> New macros.
> (AS_INIT): Use it.

> This is the cautious alternative.  If we go with this patch, then
> 2.68 will be released without any use of ${a:<op>b} (for <op> in
> -, +, =, ?), except for the spy; and assuming no bug reports,
> then 2.69 can go ahead and use it at will by deleting _AS_SHELL_NULL_SPY
> and by moving _AS_SHELL_NULL_WORKS from _AS_DETECT_SUGGESTED over
> to _AS_DETECT_REQUIRED.

The patch looks good to me barring the minor nit below.

> 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.

> 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!

> +# _AS_SHELL_NULL_SPY
> +# ------------------
> +# This temporary macro checks "in the wild" for shells that do not support
> +# null variable manipulation.  FIXME: remove in the next release after 2.68.
> +m4_defun([_AS_SHELL_NULL_SPY],
> +[_AS_DETECT_SUGGESTED([_AS_SHELL_NULL_WORKS])
> +_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?

Cheers,
Ralf



reply via email to

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