commit 58365dc2f65379da59a4248d0f5b2a3e7ae47edb from: Thomas Adam date: Mon Nov 22 22:02:42 2021 UTC portable: running tests when shell is dash Ubuntu's default shell is dash, when using /bin/sh. The portable nature of got is such that "$OSTYPE" to determine the host type (linux, bsd, etc.) is bash-specific and is not part of POSIX. autotools already provide a mechanism for determining the underlying platform type, and PLATFORM is already a subst value. Therefore, let the -portable parts of the regress test-suite use $PLATFORM to look at the underlying OS type. The tests themselves already expect /bin/sh to be POSIX-compliant in all other areas, so there should be no need to change the #! lines. commit - 98182bd0510e52dd5b397e4d797a3f06b9a91a55 commit + 58365dc2f65379da59a4248d0f5b2a3e7ae47edb blob - 167f75b9cfd9e96f7b54ba71b702446f1b304e51 blob + 5512a52281c0ee03946db793d6cf3bc079bef0f4 --- Makefile.am +++ Makefile.am @@ -17,7 +17,8 @@ GOT_TEST_ROOT=/tmp tests: $(TEST_TARGETS) regress-cmdline: - (cd $(top_builddir)/regress/cmdline || exit $$?; \ + (export PLATFORM=@PLATFORM@; \ + cd $(top_builddir)/regress/cmdline || exit $$?; \ ./checkout.sh -r "$(GOT_TEST_ROOT)"; \ ./update.sh -r "$(GOT_TEST_ROOT)"; \ ./status.sh -r "$(GOT_TEST_ROOT)"; \ blob - 2b9c219181faf1e6ff070cc5d50165ed2ef06211 blob + 3e0b190072d11c5feb95bd3cb149b3635c85b9e8 --- regress/cmdline/common.sh +++ regress/cmdline/common.sh @@ -29,7 +29,7 @@ export MALLOC_OPTIONS=S date() { DATECMD="date" - [ "$OSTYPE" != "linux-gnu" ] && DATECMD="gdate" + [ "$PLATFORM" != "linux" ] && DATECMD="gdate" command "$DATECMD" "$@" } @@ -37,7 +37,7 @@ date() ln() { LNCMD="ln" - [ "$OSTYPE" != "linux-gnu" ] && LNCMD="gln" + [ "$PLATFORM" != "linux" ] && LNCMD="gln" command "$LNCMD" "$@" } @@ -45,7 +45,7 @@ ln() sed() { SEDCMD="sed" - [ "$OSTYPE" == "linux-gnu" ] && { + [ "$PLATFORM" = "linux" ] && { set -- "$@" [ $# -ge 4 ] && { shift 2