Am 15.12.2012 15:27, schrieb David Champion:
> * On 15 Dec 2012, Oswald Buddenhagen wrote:
>> On Fri, Dec 14, 2012 at 06:10:21PM -0600, David Champion wrote:
>>> [...] note that the ${a#b} and ${a%b} family of parameter expressions
>>> is nonportable. These are commonly accepted bashisms [...]
>>>
>> wrong.
>> http://pubs.opengroup.org/onlinepubs/009695399/utilities/xcu_chap02.html
>> section 2.6.2
>>
>> or to quote
>> http://www.gnu.org/software/autoconf/manual/autoconf-2.67/html_node/Shell-Substitutions.html#Shell-Substitutions
>> "Posix requires support for these usages, but they do not work with many
>> traditional shells, e.g., Solaris 10 /bin/sh."
>>
>> iow, throwing around "bashism" is just FUD.
>> if mutts wants to keep supporting utterly retarded systems from the last
>> millenium that's fine with me, but get your facts straight.
>
> Facts now straightened. We do support "utterly retarded" systems. Have
> a better day tomorrow.
>
A fortnight has passed, and I propose to require a conforming shell, as
proposed earlier in this subthread.
This is bogofilter's configure.ac code, and for reference, check
Solaris's standards(5) manual page. Actually, we should be tweaking PATH
to read
PATH=/usr/xpg6/bin:/usr/xpg4/bin:/usr/ccs/bin:/usr/bin:/path/to/compiler/bin:...
but this was good enough for bogofilter because SHELL is available
throughout anything build-related as environment variable - warning,
some lines have been word-wrapped by copy&paste in Thunderbird.
dnl ...
dnl check for b0rked Solaris (and other shells) and find one that works
AC_MSG_CHECKING(for a working shell...)
for i in /usr/xpg6/bin/sh /usr/xpg4/bin/sh /usr/ccs/bin/sh /bin/sh
/usr/bin/sh /bin/ksh /bin/bash /usr/local/bin/bash ; do
$i -c 'if ! false ; then echo $(echo ok) ; fi' >config.$$ 2>/dev/null
j=`cat config.$$`
rm -f config.$$
if test "x$j" = "xok" ; then
SHELL=$i
AC_SUBST(SHELL)
break
fi
done
AC_MSG_RESULT($SHELL)
if test "x$SHELL" = "x" ; then
AC_MSG_ERROR(no SUS compliant shell found - on Solaris, install
SUNWxcu4)
fi
dnl ...
Perhaps the test (with the echo $(echo...) stuff needs to be extended to
check for the % and # parameter expansion modifiers, but I strongly
object to supporting utterly retarded shells and jumping through sed hoops.