]> git.ipfire.org Git - thirdparty/nftables.git/commitdiff
check-tree.sh: check and flag /bin/sh usage
authorFlorian Westphal <fw@strlen.de>
Tue, 24 Oct 2023 10:37:47 +0000 (12:37 +0200)
committerFlorian Westphal <fw@strlen.de>
Tue, 24 Oct 2023 10:47:00 +0000 (12:47 +0200)
Almost all shell tests use /bin/bash already.

In some cases we've had shell tests use /bin/sh, but still having
a bashism.  This causes failures on systems where sh is dash or another,
strict bourne shell.

Flag those via check-tree.sh.

Signed-off-by: Florian Westphal <fw@strlen.de>
tools/check-tree.sh

index c3aaa08d05ceb88b8f28290cdbd2ddb2063b1941..e3ddf8bdea5824f341535fc575e91ce066b9435e 100755 (executable)
@@ -68,6 +68,7 @@ if [ "${#SHELL_TESTS[@]}" -eq 0 ] ; then
 fi
 for t in "${SHELL_TESTS[@]}" ; do
        check_shell_dumps "$t"
+       head -n 1 "$t" |grep -q  '^#!/bin/sh' && echo "$t uses sh instead of bash" && EXIT_CODE=1
 done
 
 ##############################################################################