From c362572c8185888695c812b124c7a6970f5a7ee4 Mon Sep 17 00:00:00 2001 From: bonachea Date: Tue, 30 Dec 2025 13:30:34 -0800 Subject: [PATCH 1/2] issue #94: Add install.sh --yes option to support non-interactive install --- install.sh | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/install.sh b/install.sh index fde5ec8e..717e1c96 100755 --- a/install.sh +++ b/install.sh @@ -22,6 +22,7 @@ USAGE: --prereqs Display a list of prerequisite software. Default prefix='\$HOME/.local/bin' --verbose Show verbose build commands + --yes Assume (yes) to all prompts for non-interactive build All unrecognized arguments will be passed to GASNet's configure. @@ -39,9 +40,6 @@ Some influential environment variables: Use these variables to override the choices made by the installer or to help it to find libraries and programs with nonstandard names/locations. -For a non-interactive build with the 'yes' utility installed, execute -yes | ./install.sh - Report bugs to fortran@lbl.gov or at https://go.lbl.gov/caffeine EOF @@ -51,6 +49,7 @@ GCC_VERSION=${GCC_VERSION:=14} GASNET_VERSION="stable" VERBOSE="" GASNET_CONDUIT="${GASNET_CONDUIT:-smp}" +YES=false list_prerequisites() { @@ -104,6 +103,9 @@ while [ "$1" != "" ]; do VERBOSE="--verbose" set -x ;; + -y | --yes) + YES="true" + ;; *) # We pass the unmodified argument to GASNet configure # Quoting is believed sufficient for embedded whitespace but not quotes @@ -196,6 +198,10 @@ CI=${CI:-"false"} # GitHub Actions workflows set CI=true exit_if_user_declines() { + if [ $YES = true ]; then + echo " 'yes' assumed (--yes option)" + return + fi if [ $CI = true ]; then echo " 'yes' assumed (GitHub Actions workflow detected)" return From bbfd2d11fff2031da2cbecbbc8c37d1c40691db8 Mon Sep 17 00:00:00 2001 From: bonachea Date: Tue, 30 Dec 2025 14:02:29 -0800 Subject: [PATCH 2/2] issue #282: spurious sed error from run-fpm.sh on macOS/BSD This problem was caused by a difference between the GNU/Linux and BSD/macOS implementations of `sed -i`. The former allows an optional suffix to `-i`, whereas the suffix is mandatory in the latter. --- install.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/install.sh b/install.sh index 717e1c96..317f6915 100755 --- a/install.sh +++ b/install.sh @@ -504,7 +504,8 @@ if echo "--help -help --version -version --list -list new update list clean publ set -x exec \$fpm "\$fpm_sub_cmd" "\$@" elif echo "build test run install" | grep -w -q -e "\$fpm_sub_cmd" ; then - sed -i 's/^link = .*\$/$FPM_TOML_LINK_ENTRY/' $FPM_TOML + sed -i.bak 's/^link = .*\$/$FPM_TOML_LINK_ENTRY/' $FPM_TOML + rm -f $FPM_TOML.bak # issue 282: this is the only portable way to use sed -i if test -n "$GASNET_RUNNER_ARG" && echo "test run" | grep -w -q -e "\$fpm_sub_cmd" ; then set -- "--runner=$GASNET_RUNNER_ARG" "\$@" fi