2222 --prereqs Display a list of prerequisite software.
2323 Default prefix='\$HOME/.local/bin'
2424 --verbose Show verbose build commands
25+ --yes Assume (yes) to all prompts for non-interactive build
2526
2627All unrecognized arguments will be passed to GASNet's configure.
2728
@@ -39,9 +40,6 @@ Some influential environment variables:
3940Use these variables to override the choices made by the installer or to help
4041it to find libraries and programs with nonstandard names/locations.
4142
42- For a non-interactive build with the 'yes' utility installed, execute
43- yes | ./install.sh
44-
4543Report bugs to fortran@lbl.gov or at https://go.lbl.gov/caffeine
4644
4745EOF
@@ -51,6 +49,7 @@ GCC_VERSION=${GCC_VERSION:=14}
5149GASNET_VERSION=" stable"
5250VERBOSE=" "
5351GASNET_CONDUIT=" ${GASNET_CONDUIT:- smp} "
52+ YES=false
5453
5554list_prerequisites ()
5655{
@@ -104,6 +103,9 @@ while [ "$1" != "" ]; do
104103 VERBOSE=" --verbose"
105104 set -x
106105 ;;
106+ -y | --yes)
107+ YES=" true"
108+ ;;
107109 * )
108110 # We pass the unmodified argument to GASNet configure
109111 # Quoting is believed sufficient for embedded whitespace but not quotes
@@ -196,6 +198,10 @@ CI=${CI:-"false"} # GitHub Actions workflows set CI=true
196198
197199exit_if_user_declines ()
198200{
201+ if [ $YES = true ]; then
202+ echo " 'yes' assumed (--yes option)"
203+ return
204+ fi
199205 if [ $CI = true ]; then
200206 echo " 'yes' assumed (GitHub Actions workflow detected)"
201207 return
@@ -498,7 +504,8 @@ if echo "--help -help --version -version --list -list new update list clean publ
498504 set -x
499505 exec \$ fpm "\$ fpm_sub_cmd" "\$ @"
500506elif echo "build test run install" | grep -w -q -e "\$ fpm_sub_cmd" ; then
501- sed -i 's/^link = .*\$ /$FPM_TOML_LINK_ENTRY /' $FPM_TOML
507+ sed -i.bak 's/^link = .*\$ /$FPM_TOML_LINK_ENTRY /' $FPM_TOML
508+ rm -f $FPM_TOML .bak # issue 282: this is the only portable way to use sed -i
502509 if test -n "$GASNET_RUNNER_ARG " && echo "test run" | grep -w -q -e "\$ fpm_sub_cmd" ; then
503510 set -- "--runner=$GASNET_RUNNER_ARG " "\$ @"
504511 fi
0 commit comments