From: R. Diez Date: Mon, 2 Dec 2024 16:01:25 +0000 (-0500) Subject: bootstrap: Disallow use of undefined shell variables, if possible. X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=71afdbc878cff0f085da216cbbfa8c721090b629;p=thirdparty%2Fautoconf.git bootstrap: Disallow use of undefined shell variables, if possible. --- diff --git a/bootstrap b/bootstrap index 700ec25d1..3b7c1db41 100755 --- a/bootstrap +++ b/bootstrap @@ -28,6 +28,9 @@ set -e (set -o pipefail 2> /dev/null) && set -o pipefail +# Error on undefined variables. +(set -u 2> /dev/null) && set -u + # Avoid problems due to various shell wrinkles. # We assume we have a shell new enough to implement unset correctly. (set -o posix 2> /dev/null) && set -o posix @@ -109,7 +112,7 @@ fi # Override SHELL. This is required on DJGPP so that Perl's system() # uses bash, not COMMAND.COM which doesn't quote arguments properly. # It's not used otherwise. -if test -n "$DJDIR"; then +if test -n "${DJDIR-}"; then BOOTSTRAP_SHELL=/dev/env/DJDIR/bin/bash.exe else BOOTSTRAP_SHELL=/bin/sh