Skip to content

Commit b14eb15

Browse files
authored
Merge pull request #283 from bonachea/issue-94
Install.sh tweaks
2 parents aaa23cb + bbfd2d1 commit b14eb15

1 file changed

Lines changed: 11 additions & 4 deletions

File tree

install.sh

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ USAGE:
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
2627
All unrecognized arguments will be passed to GASNet's configure.
2728
@@ -39,9 +40,6 @@ Some influential environment variables:
3940
Use these variables to override the choices made by the installer or to help
4041
it 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-
4543
Report bugs to fortran@lbl.gov or at https://go.lbl.gov/caffeine
4644
4745
EOF
@@ -51,6 +49,7 @@ GCC_VERSION=${GCC_VERSION:=14}
5149
GASNET_VERSION="stable"
5250
VERBOSE=""
5351
GASNET_CONDUIT="${GASNET_CONDUIT:-smp}"
52+
YES=false
5453

5554
list_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

197199
exit_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" "\$@"
500506
elif 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

Comments
 (0)