Skip to content

Commit 07288cd

Browse files
author
Damian Rouson
committed
Fix './install.sh -B gcc' behavior: lists branches
1 parent 91acb92 commit 07288cd

File tree

3 files changed

+14
-13
lines changed

3 files changed

+14
-13
lines changed

prerequisites/build-functions/download_if_necessary.sh

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,11 @@ download_if_necessary()
2525
args=("clone")
2626
;;
2727
"svn" )
28-
case "${arg_B:-}" in
29-
"gcc")
28+
case "${arg_B:-}" in
29+
"gcc")
3030
args=("ls")
31-
;;
32-
*)
31+
;;
32+
*)
3333
args=("checkout")
3434
;;
3535
esac
@@ -39,18 +39,18 @@ download_if_necessary()
3939
case "${first_three_characters}" in
4040
"ftp" )
4141
args=("-LO" "-u" "anonymous: ")
42-
;;
42+
;;
4343
"htt" )
4444
args=("-LO")
45-
;;
45+
;;
4646
*)
4747
emergency "download_if_necessary.sh: Unrecognized URL."
4848
;;
4949
esac
5050
;;
5151
*)
5252
emergency "download_if_necessary.sh: Unrecognized \${fetch}=${fetch}."
53-
;;
53+
;;
5454
esac
5555

5656
case "${gcc_prereqs_fetch}" in
@@ -62,13 +62,14 @@ download_if_necessary()
6262
;;
6363
"curl" )
6464
gcc_prereqs_fetch_args=("-LO" "-u" "anonymous: ")
65-
;;
65+
;;
6666
*)
6767
emergency "download_if_necessary.sh: Unrecognized \${gcc_prereqs_fetch}=${gcc_prereqs_fetch}."
6868
;;
6969
esac
70-
71-
if [[ -f "${download_path}/${url_tail}" || -d "${download_path}/${url_tail##*branches/}" ]]; then
70+
71+
72+
if [[ -f "${download_path}/${url_tail}" || -d "${download_path}/${url_tail##*branches/}" && ! -z ${url_tail##*branches/} ]]; then
7273
info "Found '${url_tail##*branches/}' in ${download_path}."
7374
info "If it resulted from an incomplete download, building ${package_name} could fail."
7475
if [[ "${arg_y}" == "${__flag_present}" ]]; then

prerequisites/build-functions/set_or_print_default_version.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ set_or_print_default_version()
1313
echo "This script can build the following packages:"
1414
fi
1515
# Get package name from argument passed with -p, -V, -D, or -U
16-
package_name="${arg_p:-${arg_D:-${arg_P:-${arg_U:-${arg_V}}}}}" # not needed for -l
16+
package_name="${arg_p:-${arg_D:-${arg_P:-${arg_U:-${arg_V:-${arg_B}}}}}}" # not needed for -l
1717

1818
if [[ "${package_name}" == "ofp" ]]; then
1919
"${OPENCOARRAYS_SRC_DIR}/prerequisites/install-ofp.sh" "${@}"

prerequisites/build-functions/set_or_print_url.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,10 @@ else
5353
# Set differing tails for GCC release downloads versus development branch checkouts
5454
if [[ "${package_to_build}" == 'gcc' ]]; then
5555
if [[ "${fetch}" == 'svn' ]]; then
56-
if [[ "${version_to_build}" == "trunk" ]]; then
56+
if [[ "${version_to_build:-}" == "trunk" ]]; then
5757
gcc_tail="${version_to_build}"
5858
else
59-
gcc_tail="branches/${version_to_build}"
59+
gcc_tail="branches/${version_to_build:-}"
6060
fi
6161
else
6262
gcc_tail="gcc-${version_to_build}.tar.gz"

0 commit comments

Comments
 (0)