From 3747e3d944008dfdd1e5efbb52583f3218795ff3 Mon Sep 17 00:00:00 2001 From: Jeffrey Walton Date: Sun, 21 Jul 2019 03:19:14 -0400 Subject: [PATCH] Don't use BASH_SOURCE in cryptest.sh --- TestScripts/cryptest.sh | 18 +++++++++--------- cryptest.sh | 18 +++++++++--------- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/TestScripts/cryptest.sh b/TestScripts/cryptest.sh index 11a353b3..03833cd9 100755 --- a/TestScripts/cryptest.sh +++ b/TestScripts/cryptest.sh @@ -257,7 +257,7 @@ if [[ (-z "$TMPDIR") ]]; then TMPDIR="$HOME/tmp" else echo "Please set TMPDIR to a valid directory" - [[ "$0" = "${BASH_SOURCE[0]}" ]] && exit 1 || return 1 + exit 1 fi fi @@ -1949,19 +1949,19 @@ if true; then if [[ ("${PIPESTATUS[0]}" -ne "0") ]]; then echo "ERROR: failed to make cryptest.exe" | tee -a "$TEST_RESULTS" # Stop now if things are broke - [[ "$0" = "${BASH_SOURCE[0]}" ]] && exit 1 || return 1 + exit 1 else ./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS" if [[ ("${PIPESTATUS[0]}" -ne "0") ]]; then echo "ERROR: failed to execute validation suite" | tee -a "$TEST_RESULTS" # Stop now if things are broke - [[ "$0" = "${BASH_SOURCE[0]}" ]] && exit 1 || return 1 + exit 1 fi ./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS" if [[ ("${PIPESTATUS[0]}" -ne "0") ]]; then echo "ERROR: failed to execute test vectors" | tee -a "$TEST_RESULTS" # Stop now if things are broke - [[ "$0" = "${BASH_SOURCE[0]}" ]] && exit 1 || return 1 + exit 1 fi fi @@ -1983,19 +1983,19 @@ if true; then if [[ ("${PIPESTATUS[0]}" -ne "0") ]]; then echo "ERROR: failed to make cryptest.exe" | tee -a "$TEST_RESULTS" # Stop now if things are broke - [[ "$0" = "${BASH_SOURCE[0]}" ]] && exit 1 || return 1 + exit 1 else ./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS" if [[ ("${PIPESTATUS[0]}" -ne "0") ]]; then echo "ERROR: failed to execute validation suite" | tee -a "$TEST_RESULTS" # Stop now if things are broke - [[ "$0" = "${BASH_SOURCE[0]}" ]] && exit 1 || return 1 + exit 1 fi ./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS" if [[ ("${PIPESTATUS[0]}" -ne "0") ]]; then echo "ERROR: failed to execute test vectors" | tee -a "$TEST_RESULTS" # Stop now if things are broke - [[ "$0" = "${BASH_SOURCE[0]}" ]] && exit 1 || return 1 + exit 1 fi echo fi @@ -7168,7 +7168,7 @@ echo ############################################ # http://tldp.org/LDP/abs/html/exitcodes.html#EXITCODESREF if (( "$ECOUNT" == "0" )); then - [[ "$0" = "${BASH_SOURCE[0]}" ]] && exit 0 || return 0 + exit 0 else - [[ "$0" = "${BASH_SOURCE[0]}" ]] && exit 1 || return 1 + exit 1 fi diff --git a/cryptest.sh b/cryptest.sh index 11a353b3..03833cd9 100755 --- a/cryptest.sh +++ b/cryptest.sh @@ -257,7 +257,7 @@ if [[ (-z "$TMPDIR") ]]; then TMPDIR="$HOME/tmp" else echo "Please set TMPDIR to a valid directory" - [[ "$0" = "${BASH_SOURCE[0]}" ]] && exit 1 || return 1 + exit 1 fi fi @@ -1949,19 +1949,19 @@ if true; then if [[ ("${PIPESTATUS[0]}" -ne "0") ]]; then echo "ERROR: failed to make cryptest.exe" | tee -a "$TEST_RESULTS" # Stop now if things are broke - [[ "$0" = "${BASH_SOURCE[0]}" ]] && exit 1 || return 1 + exit 1 else ./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS" if [[ ("${PIPESTATUS[0]}" -ne "0") ]]; then echo "ERROR: failed to execute validation suite" | tee -a "$TEST_RESULTS" # Stop now if things are broke - [[ "$0" = "${BASH_SOURCE[0]}" ]] && exit 1 || return 1 + exit 1 fi ./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS" if [[ ("${PIPESTATUS[0]}" -ne "0") ]]; then echo "ERROR: failed to execute test vectors" | tee -a "$TEST_RESULTS" # Stop now if things are broke - [[ "$0" = "${BASH_SOURCE[0]}" ]] && exit 1 || return 1 + exit 1 fi fi @@ -1983,19 +1983,19 @@ if true; then if [[ ("${PIPESTATUS[0]}" -ne "0") ]]; then echo "ERROR: failed to make cryptest.exe" | tee -a "$TEST_RESULTS" # Stop now if things are broke - [[ "$0" = "${BASH_SOURCE[0]}" ]] && exit 1 || return 1 + exit 1 else ./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS" if [[ ("${PIPESTATUS[0]}" -ne "0") ]]; then echo "ERROR: failed to execute validation suite" | tee -a "$TEST_RESULTS" # Stop now if things are broke - [[ "$0" = "${BASH_SOURCE[0]}" ]] && exit 1 || return 1 + exit 1 fi ./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS" if [[ ("${PIPESTATUS[0]}" -ne "0") ]]; then echo "ERROR: failed to execute test vectors" | tee -a "$TEST_RESULTS" # Stop now if things are broke - [[ "$0" = "${BASH_SOURCE[0]}" ]] && exit 1 || return 1 + exit 1 fi echo fi @@ -7168,7 +7168,7 @@ echo ############################################ # http://tldp.org/LDP/abs/html/exitcodes.html#EXITCODESREF if (( "$ECOUNT" == "0" )); then - [[ "$0" = "${BASH_SOURCE[0]}" ]] && exit 0 || return 0 + exit 0 else - [[ "$0" = "${BASH_SOURCE[0]}" ]] && exit 1 || return 1 + exit 1 fi