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