Readability and code quality improvements in check-tools
#!/bin/bash
-set -e
+set -eu
# CHECK TOOLS
# Checks for missing system compilers and tools
-TOOLS=( ant autoconf make javac $CC swig zsh )
-declare -a MISSING
+TOOLS=( ant autoconf make javac ${CC:-} swig zsh )
+declare -a MISSING=()
for T in ${TOOLS[@]}
do
@@ -16,7 +16,7 @@ do
fi
done
-if (( ${#MISSING} ))
+if (( ${#MISSING[@]} != 0 ))
then
echo "This system is missing the following required tools:"
for T in ${MISSING[@]}
@@ -26,4 +26,5 @@ then
exit 1
fi
-exit
+# All tools must have been found- exit with success.
+exit 0
