1+ # shellcheck source=./ftp-url.sh
12source " ${OPENCOARRAYS_SRC_DIR:- } /prerequisites/build-functions/ftp-url.sh"
3+ # shellcheck source=./set_SUDO_if_needed_to_write_to_directory.sh
24source " ${OPENCOARRAYS_SRC_DIR:- } /prerequisites/build-functions/set_SUDO_if_needed_to_write_to_directory.sh"
35
46# Download pkg-config if the tar ball is not already in the present working directory
7+ # shellcheck disable=SC2154
58download_if_necessary ()
69{
710 download_path=" ${PWD} /downloads"
811 set_SUDO_if_needed_to_write_to_directory " ${download_path} "
9- if [ -f $url_tail ] || [ -d $url_tail ]; then
12+ if [ -f " $url_tail " ] || [ -d " $url_tail " ]; then
1013 info " Found '${url_tail} ' in ${PWD} ."
1114 info " If it resulted from an incomplete download, building ${package_name} could fail."
1215 info " Would you like to proceed anyway? (Y/n)"
13- read proceed
16+ read -r proceed
1417 if [[ " ${proceed} " == " n" || " ${proceed} " == " N" || " ${proceed} " == " no" ]]; then
1518 info " n"
1619 info " Please remove $url_tail and restart the installation to to ensure a fresh download." 1>&2
@@ -23,7 +26,7 @@ download_if_necessary()
2326 info " The default download mechanism for ${package_name} is ${fetch} ."
2427 info " Please either ensure that ${fetch} is installed and in your PATH"
2528 info " or download the ${package_name} source from "
26- info " ${package_url} "
29+ info " ${package_url} "
2730 # called_by_install_sh=`echo "$(ps -p $PPID -o args=)" | grep install.sh`
2831 info " Place the downloaded file in ${download_path} and restart this script."
2932 # if [[ ! -z $called_by_install_sh ]]; then
@@ -57,7 +60,7 @@ download_if_necessary()
5760 info " Download command: ${fetch} ${args} ${package_url} "
5861 info " Depending on the file size and network bandwidth, this could take several minutes or longer."
5962 pushd " ${download_path} "
60- " ${fetch} " " ${args} " " ${package_url} "
63+ " ${fetch} " " ${args} " " ${package_url} "
6164 popd
6265 if [[ " ${version_to_build} " == ' --avail' || " ${version_to_build} " == ' -a' ]]; then
6366 # In this case, args="ls" and the list of available versions has been printed so we can move on.
@@ -69,10 +72,10 @@ download_if_necessary()
6972 search_path=" ${download_path} /${url_tail} "
7073 fi
7174 if [ -f " ${search_path} " ] || [ -d " ${search_path} " ]; then
72- info " Download succeeded. The " ${package_name} " source is in the following location:"
75+ info " Download succeeded. The ${package_name} source is in the following location:"
7376 info " ${search_path} "
7477 else
75- info " Download failed. The " ${package_name} " source is not in the following, expected location:"
78+ info " Download failed. The ${package_name} source is not in the following, expected location:"
7679 info " ${search_path} "
7780 emergency " Aborting. [exit 110]"
7881 fi
0 commit comments