From 1b85d86fafaaf8ae865e95155e2c4134654b14b4 Mon Sep 17 00:00:00 2001 From: Chris Hanson Date: Wed, 11 Jan 2017 00:14:34 -0800 Subject: [PATCH] Fix code that looks for default STAGE0 to check /usr/local. --- etc/run-three-stages | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/etc/run-three-stages b/etc/run-three-stages index b100324d3..ff7a0274f 100755 --- a/etc/run-three-stages +++ b/etc/run-three-stages @@ -83,7 +83,8 @@ find_stage () { find_build_stage "${1}" && return 0 if [[ ${1} == stage0 ]]; then - find_dist_stage "${1}" && return 0 + find_dist_stage $(pwd)/"${1}" && return 0 + find_dist_stage /usr/local && return 0 find_build_stage "${STAGE0}" && return 0 fi echo "Unable to find ${1} executable" >&2 @@ -104,8 +105,12 @@ find_build_stage () find_dist_stage () { - local STAGE=$(pwd)/${1} - local LIBDIR=${STAGE}/lib/mit-scheme* + local STAGE=${1} + local LIBDIRS=(${STAGE}/lib/mit-scheme*) + if (( ${#LIBDIRS[@]} < 1 )); then + return 1 + fi + local LIBDIR=${LIBDIRS[0]} if [[ -x ${STAGE}/bin/mit-scheme && -f ${LIBDIR}/all.com ]]; then export MIT_SCHEME_EXE=${STAGE}/bin/mit-scheme export MITSCHEME_LIBRARY_PATH=${LIBDIR} -- 2.25.1