From 1a9bd105d9905b451ca24625dcb4dae0bd9ebfb0 Mon Sep 17 00:00:00 2001 From: Chris Hanson Date: Fri, 27 Jan 2017 20:46:57 -0800 Subject: [PATCH] Fix regexp bug in previous change. Add run-time diagnostics. --- etc/run-three-stages | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/etc/run-three-stages b/etc/run-three-stages index 0e24f3765..f1ef7d458 100755 --- a/etc/run-three-stages +++ b/etc/run-three-stages @@ -46,19 +46,22 @@ if [[ ${1} = -n ]]; then declare -r NORUN=t shift else - declare -r NORUN= + declare -r NORUN=nil fi -if [[ ${1} =~ -?([[:digit:]]+) ]]; then +if [[ ${1} =~ ^-?([[:digit:]]+)$ ]]; then declare -ri MAX_STAGE=${BASH_REMATCH[1]} shift else declare -ri MAX_STAGE=3 fi -[[ -n ${NORUN} ]] && echo "MAX_STAGE =" "${MAX_STAGE}" CONFIG_ARGS=("${@}") +echo "NORUN = " "${NORUN}" +echo "MAX_STAGE =" "${MAX_STAGE}" +echo "CONFIG_ARGS =" "${CONFIG_ARGS[@]}" + # Hack for cph if which cpx > /dev/null; then : ${COPY:="cpx -sq"} @@ -73,7 +76,7 @@ run_stage () find_stage stage$((N-1)) echo "MIT_SCHEME_EXE =" "${MIT_SCHEME_EXE}" echo "MITSCHEME_LIBRARY_PATH =" "${MITSCHEME_LIBRARY_PATH}" - [[ -n ${NORUN} ]] && return 0 + [[ ${NORUN} = t ]] && return 0 rm -rf ${STAGE} ${COPY} src ${STAGE} (set -e; cd ${STAGE}; ./Setup.sh && ./configure "${CONFIG_ARGS[@]}" && make) -- 2.25.1