1- # shellcheck disable=SC2154,SC2034
1+ # shellcheck shell=bash disable=SC2154,SC2034,SC2148
22find_or_install ()
33{
44 package=" $1 "
@@ -28,9 +28,9 @@ find_or_install()
2828 done
2929
3030 if [[ " $package " == " $executable " ]]; then
31- printf " $this_script : Checking whether $executable is in the PATH..."
31+ printf " %s : Checking whether %s is in the PATH..." " $this_script " " $executable "
3232 else
33- printf " $this_script : Checking whether $package executable $executable is in the PATH..."
33+ printf " %s : Checking whether %s executable $executable is in the PATH..." " $this_script " " $package "
3434 fi
3535 if type " $executable " >& /dev/null; then
3636 printf " yes.\n"
@@ -43,7 +43,7 @@ find_or_install()
4343
4444 package_install_path=$( ./build.sh -P " $package " )
4545
46- printf " Checking whether $executable is in $package_install_path ..."
46+ printf " Checking whether %s is in %s ..." " $executable " " $package_install_path "
4747 if [[ -x " $package_install_path /bin/$executable " ]]; then
4848 printf " yes.\n"
4949 script_installed_package=true
@@ -110,7 +110,7 @@ find_or_install()
110110 # Every branch that discovers an acceptable pre-existing installation must set the
111111 # MPIFC, MPICC, and MPICXX environment variables. Every branch must also manage the
112112 # dependency stack.
113-
113+
114114 # If the user specified a Fortran compiler, verify that mpif90 wraps the specified compiler
115115 if [[ ! -z " ${arg_M:- } " ]]; then
116116
@@ -159,33 +159,33 @@ find_or_install()
159159 printf " yes.\n"
160160
161161 if [[ ! -z " ${arg_f:- } " ]]; then
162-
162+
163163 info " -f (or --with-fortran) argument detected with value ${arg_f} "
164- printf " yes.\n $this_script : Using the specified $executable .\n"
164+ printf " yes.\n %s : Using the specified %s .\n" " $this_script " " $executable "
165165 export MPIFC=mpif90
166166 export MPICC=mpicc
167167 export MPICXX=mpicxx
168-
168+
169169 # Halt the recursion
170170 stack_push dependency_pkg " none"
171171 stack_push dependency_exe " none"
172172 stack_push dependency_path " none"
173173
174174 else
175175
176- echo -e " $this_script : Checking whether $executable in PATH wraps gfortran version ` ./build.sh -V gcc` or later... "
176+ echo -e " $this_script : Checking whether $executable in PATH wraps gfortran version $( ./build.sh -V gcc) or later... "
177177 $executable acceptable_compiler.f90 -o acceptable_compiler
178178 $executable print_true.f90 -o print_true
179179 acceptable=$( ./acceptable_compiler)
180180 is_true=$( ./print_true)
181181 rm acceptable_compiler print_true
182-
182+
183183 if [[ " $acceptable " == " $is_true " ]]; then
184- printf " yes.\n $this_script : Using the $executable found in the PATH.\n"
184+ printf " yes.\n %s : Using the $executable found in the PATH.\n" " $this_script "
185185 export MPIFC=mpif90
186186 export MPICC=mpicc
187187 export MPICXX=mpicxx
188-
188+
189189 # Halt the recursion
190190 stack_push dependency_pkg " none"
191191 stack_push dependency_exe " none"
@@ -261,7 +261,7 @@ find_or_install()
261261 stack_push dependency_path " none"
262262
263263 elif [[ " $package_in_path " == " true" ]]; then
264- echo -e " $this_script : Checking whether $executable in PATH is version ` ./build.sh -V gcc` or later..."
264+ echo -e " $this_script : Checking whether $executable in PATH is version $( ./build.sh -V gcc) or later..."
265265 $executable -o acceptable_compiler acceptable_compiler.f90
266266 $executable -o print_true print_true.f90
267267 is_true=$( ./print_true)
@@ -576,8 +576,8 @@ find_or_install()
576576
577577
578578 # Strip trailing package name and version number, if present, from installation path
579- default_package_version=$( ./build.sh -V ${package} )
580- package_install_prefix=" ${package_install_path% ${package} / ${arg_I:- ${default_package_version} } * } "
579+ default_package_version=$( ./build.sh -V " ${package} " )
580+ package_install_prefix=" ${package_install_path% ${package} / ${arg_I:- ${default_package_version} } * } "
581581
582582 echo -e " $this_script : Downloading, building, and installing $package \n"
583583 echo " $this_script : Build command: FC=$FC CC=$CC CXX=$CXX ./build.sh -p $package -i $package_install_prefix -j $num_threads "
0 commit comments