As in bug 5b42cf74aae3, libgpg-error-1.36/src/gpg-error-config-test.sh is a bash script with a #! line calling /bin/sh
If it is running on a system where #!/bin/sh is not bash then make check fails:
$ make check Making check in m4 make[1]: Entering directory `/var/tmp/libgpg-error-1.36/m4' make[1]: Nothing to be done for `check'. make[1]: Leaving directory `/var/tmp/libgpg-error-1.36/m4' Making check in src make[1]: Entering directory `/var/tmp/libgpg-error-1.36/src' make check-am make[2]: Entering directory `/var/tmp/libgpg-error-1.36/src' make check-TESTS make[3]: Entering directory `/var/tmp/libgpg-error-1.36/src' ./gpg-error-config-test.sh: bad substitution FAIL: gpg-error-config-test.sh ======================================= 1 of 1 test failed Please report to https://bugs.gnupg.org ======================================= make[3]: *** [check-TESTS] Error 1 make[3]: Leaving directory `/var/tmp/libgpg-error-1.36/src' make[2]: *** [check-am] Error 2 make[2]: Leaving directory `/var/tmp/libgpg-error-1.36/src' make[1]: *** [check] Error 2 make[1]: Leaving directory `/var/tmp/libgpg-error-1.36/src' make: *** [check-recursive] Error 1
(Tested on Solaris 10)
When the first line of src/gpg-error-config-test.sh is changed to #!/bin/bash the make check passes successfully.
It is not reasonable to assume (particularly if on a non-Linux system) that /bin/sh will always be bash.
/bin/sh is expected to represent a vanilla Bourne shell compatible shell.
It's OK for an OS to use a shell which provides a superset of Bourne shell functionality as /bin/bash, but not for a script to assume that /bin/sh will support features which are not available in Bourne shell.
The bulk of the script relies on more efficient and easier to work with bash specific syntax features, e.g.:
- srcdir=${0%/*} instead of srcdir=`dirname $0`
- $(cmd) instead of `cmd`
- if ! $CMD instead of $CMD; if [ $? != 1 ];
It would thus be simpler and more useful to declare src/gpg-error-config-test.sh to the shell as what it is (a bash script) rather than porting it to be a Bourne shell script.