Skip to content

Commit e5b8dc7

Browse files
author
Damian Rouson
committed
remove -B/--list-branches option
The option was only ever useful for accessing GCC's subversion repository. GCC has transitioned to git.
1 parent abf9b5c commit e5b8dc7

File tree

7 files changed

+45
-66
lines changed

7 files changed

+45
-66
lines changed

install.sh

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -113,26 +113,23 @@ trap cleanup_before_exit EXIT # The signal is specified here. Could be SIGINT, S
113113
[ -z "${LOG_LEVEL:-}" ] && emergency "Cannot continue without LOG_LEVEL. "
114114

115115
# shellcheck disable=SC2154
116-
if [[ "${arg_v}" == "${__flag_present}" || "${arg_l}" == "${__flag_present}" || ! -z "${arg_P:-${arg_U:-${arg_V:-${arg_D:-${arg_B}}}}}" ]]; then
116+
if [[ "${arg_v}" == "${__flag_present}" || "${arg_l}" == "${__flag_present}" || ! -z "${arg_P:-${arg_U:-${arg_V:-${arg_D}}}}" ]]; then
117117
print_debug_only=7
118118
if [ "$(( LOG_LEVEL < print_debug_only ))" -ne 0 ]; then
119119
debug "Supressing info and debug messages: one of {-l, -v, -P, -U, -V, -D} present."
120120
suppress_info_debug_messages
121121
fi
122122
fi
123123

124-
[ ! -z "${arg_D}" ] && [ ! -z "${arg_P:-${arg_U:-${arg_V:-${arg_B}}}}" ] &&
124+
[ ! -z "${arg_D}" ] && [ ! -z "${arg_P:-${arg_U:-${arg_V}}}" ] &&
125125
emergency "Please pass only one of {-B, -D, -p, -P, -U, -V} or a longer equivalent (multiple detected). [exit 101]"
126126

127-
[ ! -z "${arg_P}" ] && [ ! -z "${arg_U:-${arg_V:-${arg_B}}}" ] &&
127+
[ ! -z "${arg_P}" ] && [ ! -z "${arg_U:-${arg_V}}" ] &&
128128
emergency "Please pass only one of {-B, -D, -p, -P, -U, -V} or a longer equivalent (multiple detected). [exit 102]"
129129

130-
[ ! -z "${arg_U}" ] && [ ! -z "${arg_V:-${arg_B}}" ] &&
130+
[ ! -z "${arg_U}" ] && [ ! -z "${arg_V}" ] &&
131131
emergency "Please pass only one of {-B, -D, -p, -P, -U, -V} or a longer equivalent (multiple detected). [exit 103]"
132132

133-
[ ! -z "${arg_V}" ] && [ ! -z "${arg_B}" ] &&
134-
emergency "Please pass only one of {-B, -D, -p, -P, -U, -V} or a longer equivalent (multiple detected). [exit 104]"
135-
136133
### Print bootstrapped magic variables to STDERR when LOG_LEVEL
137134
### is at the default value (6) or above.
138135
#####################################################################
@@ -146,7 +143,6 @@ info "__usage: ${__usage}"
146143
info "LOG_LEVEL: ${LOG_LEVEL}"
147144

148145
info "-b (--install-branch): ${arg_b}"
149-
info "-B (--list-branches): ${arg_B}"
150146
info "-c (--with-c): ${arg_c}"
151147
info "-C (--with-cxx): ${arg_C}"
152148
info "-d (--debug): ${arg_d}"
@@ -267,11 +263,10 @@ if [[ "${arg_v}" == "${__flag_present}" || "${arg_V}" == "opencoarrays" ]]; then
267263
echo "${opencoarrays_version//[[:space:]]/}"
268264
fi
269265

270-
elif [[ ! -z "${arg_D:-${arg_P:-${arg_U:-${arg_V:-${arg_B}}}}}" || "${arg_l}" == "${__flag_present}" ]]; then
266+
elif [[ ! -z "${arg_D:-${arg_P:-${arg_U:-${arg_V}}}}" || "${arg_l}" == "${__flag_present}" ]]; then
271267

272268
# Delegate to build.sh for the packages it builds
273-
build_arg=${arg_B:-${arg_D:-${arg_P:-${arg_U:-${arg_V:-${arg_p}}}}}}
274-
[ ! -z "${arg_B}" ] && build_flag="-B"
269+
build_arg=${arg_D:-${arg_P:-${arg_U:-${arg_V:-${arg_p}}}}}
275270
[ ! -z "${arg_D}" ] && build_flag="-D"
276271
[ ! -z "${arg_P}" ] && build_flag="-P"
277272
[ ! -z "${arg_U}" ] && build_flag="-U"

install.sh-usage

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
-b --install-branch [arg] Install the specified repository development branch (Examples: -b trunk or -b gcc-7-branch).
2-
-B --list-branches [arg] List the available branches in a package's repository (Currently only '-B gcc' is supported).
32
-c --with-c [arg] Use specified C compiler (Example: -c /usr/local/bin/gcc).
43
-C --with-cxx [arg] Use specified C++ compiler (Example: -C /usr/local/bin/g++).
5-
-d --debug Enable debug mode.
4+
-d --debug Enable debug mode.
65
-D --print-downloader [arg] Print download program for package specified in argument (Example: -D gcc).
76
-e --verbose Enable verbose mode, print script as it is executed.
87
-f --with-fortran [arg] Use specified Fortran compiler (Example: -f /usr/local/bin/gfortran).
98
-h --help Print this page.
10-
-i --install-prefix [arg] Install package in specified path. Default="${OPENCOARRAYS_SRC_DIR}/prerequisites/installations/${package_name:-}/${version_to_build:-}"
9+
-i --install-prefix [arg] Install package in specified path. Default="${OPENCOARRAYS_SRC_DIR}/prerequisites/installations/${package_name:-}/${version_to_build:-}"
1110
-I --install-version [arg] Install package version (Example: -I 7.2.0).
1211
-j --num-threads [arg] Number of threads to use when invoking make (Example: -j 8). Default="4"
1312
-l --list-packages Print packages this script can install.

prerequisites/build-functions/download_if_necessary.sh

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -96,22 +96,18 @@ download_if_necessary()
9696
pushd "${download_path}"
9797
"${fetch}" ${args[@]:-} "${package_url}"
9898
popd
99-
if [[ ! -z "${arg_B:-}" ]]; then
100-
return
99+
if [[ "${fetch}" == "git" ]]; then
100+
search_path="${download_path}/${package_name}"
101101
else
102-
if [[ "${fetch}" == "git" ]]; then
103-
search_path="${download_path}/${package_name}"
104-
else
105-
search_path="${download_path}/${url_tail}"
106-
fi
107-
if [[ -f "${search_path}" || -d "${search_path}" ]]; then
108-
info "Download succeeded. The ${package_name} source is in the following location:"
109-
info "${search_path}"
110-
else
111-
info "Download failed. The ${package_name} source is not in the following, expected location:"
112-
info "${search_path}"
113-
emergency "Aborting. [exit 110]"
114-
fi
102+
search_path="${download_path}/${url_tail}"
103+
fi
104+
if [[ -f "${search_path}" || -d "${search_path}" ]]; then
105+
info "Download succeeded. The ${package_name} source is in the following location:"
106+
info "${search_path}"
107+
else
108+
info "Download failed. The ${package_name} source is not in the following, expected location:"
109+
info "${search_path}"
110+
emergency "Aborting. [exit 110]"
115111
fi
116112
fi
117113
}

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:-${arg_B}}}}}}" # not needed for -l
16+
package_name="${arg_p:-${arg_D:-${arg_P:-${arg_U:-${arg_V}}}}}" # 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_downloader.sh

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@
66
set_or_print_downloader()
77
{
88
# Verify requirements
9-
[ ! -z "${arg_D}" ] && [ ! -z "${arg_p:-${arg_P:-${arg_U:-${arg_V:-${arg_B}}}}}" ] &&
9+
[ ! -z "${arg_D}" ] && [ ! -z "${arg_p:-${arg_P:-${arg_U:-${arg_V}}}}" ] &&
1010
emergency "Please pass only one of {-B, -D, -p, -P, -U, -V} or a longer equivalent (multiple detected)."
1111

12-
package_name="${arg_p:-${arg_D:-${arg_P:-${arg_U:-${arg_V:-${arg_B}}}}}}"
12+
package_name="${arg_p:-${arg_D:-${arg_P:-${arg_U:-${arg_V}}}}}"
1313

1414
if [[ "${package_name}" == "ofp" ]]; then
1515
"${OPENCOARRAYS_SRC_DIR}/prerequisites/install-ofp.sh" "${@}"
@@ -19,7 +19,7 @@ set_or_print_downloader()
1919
# Choose the first available download mechanism, prioritizing first any absolute requirement
2020
# (git for gcc development branches) and second robustness:
2121
info "Checking available download mechanisms: ftp, wget, and curl."
22-
info "\${package_name}=${package_name} \${arg_b:-\${arg_B:-}}=${arg_b:-${arg_B:-}}"
22+
info "\${package_name}=${package_name} \${arg_b:-}=${arg_b:-}"
2323

2424
if type curl &> /dev/null; then
2525
gcc_prereqs_fetch=curl
@@ -34,7 +34,7 @@ set_or_print_downloader()
3434
tried="curl, wget, and ftp"
3535
fi
3636

37-
if [[ "${package_name}" == "gcc" && ! -z "${arg_b:-${arg_B:-}}" ]]; then
37+
if [[ "${package_name}" == "gcc" && ! -z "${arg_b}" ]]; then
3838
if type git &> /dev/null; then
3939
fetch=git
4040
else
@@ -45,11 +45,7 @@ set_or_print_downloader()
4545
fi
4646

4747
if [[ -z "${fetch:-}" ]]; then
48-
if [[ -z "${arg_B:-}" ]]; then
49-
warning "No available download mechanism. Options tried: ${tried}"
50-
else
51-
emergency "No available download mechanism. Option tried: ${tried}"
52-
fi
48+
emergency "No available download mechanism. Option tried: ${tried}"
5349
fi
5450

5551
# If a printout of the download mechanism was requested, then print it and exit with normal status

prerequisites/build-functions/set_or_print_url.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@
55
set_or_print_url()
66
{
77
# Verify requirements
8-
[[ -n "${arg_U}" && -n "${arg_D:-${arg_p:-${arg_P:-${arg_V:-${arg_B}}}}}" ]] &&
8+
[[ -n "${arg_U}" && -n "${arg_D:-${arg_p:-${arg_P:-${arg_V}}}}" ]] &&
99
emergency "Please pass only one of {-B, -D, -p, -P, -U, -V} or a longer equivalent (multiple detected)."
1010

1111
# Get package name from argument passed with -p, -D, -P, -V, or -U
12-
package_to_build="${arg_p:-${arg_D:-${arg_P:-${arg_U:-${arg_V:-${arg_B}}}}}}"
12+
package_to_build="${arg_p:-${arg_D:-${arg_P:-${arg_U:-${arg_V}}}}}"
1313

1414
if [[ -n "${arg_u:-}" ]]; then
1515
# User specified a URL from which to download the package
@@ -20,7 +20,7 @@ else
2020
if [[ "${package_to_build}" == 'cmake' ]]; then
2121
major_minor="${version_to_build%.*}"
2222
elif [[ "${package_to_build}" == "gcc" ]]; then
23-
if [[ -z "${arg_b:-${arg_B}}" ]]; then
23+
if [[ -z "${arg_b}" ]]; then
2424
gcc_url_head="https://ftpmirror.gnu.org/gcc/gcc-${version_to_build}/"
2525
else
2626
gcc_url_head="git://gcc.gnu.org/git/"

prerequisites/build.sh

Lines changed: 17 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,12 @@ export __flag_present=1
6161
if [[ "${arg_l}" != "${__flag_present}" &&
6262
"${arg_v}" != "${__flag_present}" &&
6363
"${arg_h}" != "${__flag_present}" &&
64-
-z "${arg_D:-${arg_p:-${arg_P:-${arg_U:-${arg_V:-${arg_B}}}}}}" ]]; then
64+
-z "${arg_D:-${arg_p:-${arg_P:-${arg_U:-${arg_V}}}}}" ]]; then
6565
help "${__base}: Insufficient arguments. Please pass either -B, -D, -h, -l, -L, -p, -P, -U, -v, -V, or a longer equivalent."
6666
fi
6767

6868
# Suppress info and debug messages if -B, -l, -P, -U, -V, -D, or their longer equivalent is present:
69-
[[ "${arg_l}" == "${__flag_present}" || ! -z "${arg_P:-${arg_U:-${arg_V:-${arg_D:-${arg_B}}}}}" ]] && suppress_info_debug_messages
69+
[[ "${arg_l}" == "${__flag_present}" || ! -z "${arg_P:-${arg_U:-${arg_V:-${arg_D}}}}" ]] && suppress_info_debug_messages
7070

7171
[ -z "${LOG_LEVEL:-}" ] && emergency "Cannot continue without LOG_LEVEL. "
7272

@@ -88,7 +88,6 @@ info "__usage: ${__usage}"
8888
info "LOG_LEVEL: ${LOG_LEVEL}"
8989

9090
info "-b (--install-branch): ${arg_b} "
91-
info "-B (--list-branches): ${arg_B} "
9291
info "-c (--with-c): ${arg_c} "
9392
info "-C (--with-cxx): ${arg_C} "
9493
info "-d (--debug): ${arg_d} "
@@ -115,13 +114,11 @@ info "-y (--yes-to-all): ${arg_y} "
115114
info "-Z (--bootstrap): ${arg_Z} "
116115
}
117116

118-
if [[ -z "${arg_B}" ]]; then
119-
# shellcheck source=./build-functions/set_or_print_default_version.sh
120-
source "${OPENCOARRAYS_SRC_DIR:-}/prerequisites/build-functions/set_or_print_default_version.sh"
121-
# shellcheck disable=SC2119
122-
set_or_print_default_version
123-
export version_to_build="${arg_I:-${arg_b:-${default_version}}}"
124-
fi
117+
# shellcheck source=./build-functions/set_or_print_default_version.sh
118+
source "${OPENCOARRAYS_SRC_DIR:-}/prerequisites/build-functions/set_or_print_default_version.sh"
119+
# shellcheck disable=SC2119
120+
set_or_print_default_version
121+
export version_to_build="${arg_I:-${arg_b:-${default_version}}}"
125122

126123
# shellcheck source=./build-functions/set_or_print_downloader.sh
127124
source "${OPENCOARRAYS_SRC_DIR:-}/prerequisites/build-functions/set_or_print_downloader.sh"
@@ -135,9 +132,7 @@ set_or_print_url
135132
# shellcheck source=./build-functions/set_or_print_installation_path.sh
136133
source "${OPENCOARRAYS_SRC_DIR:-}/prerequisites/build-functions/set_or_print_installation_path.sh"
137134

138-
if [[ -z "${arg_B}" ]]; then
139-
set_or_print_installation_path
140-
fi
135+
set_or_print_installation_path
141136

142137
# shellcheck source=./build-functions/download_if_necessary.sh
143138
source "${OPENCOARRAYS_SRC_DIR:-}/prerequisites/build-functions/download_if_necessary.sh"
@@ -159,16 +154,14 @@ else
159154
export bootstrap_build="bootstrap"
160155
fi
161156

162-
if [[ -z "${arg_B}" ]]; then
163-
# shellcheck source=./build-functions/unpack_if_necessary.sh
164-
source "${OPENCOARRAYS_SRC_DIR:-}/prerequisites/build-functions/unpack_if_necessary.sh"
165-
unpack_if_necessary
157+
# shellcheck source=./build-functions/unpack_if_necessary.sh
158+
source "${OPENCOARRAYS_SRC_DIR:-}/prerequisites/build-functions/unpack_if_necessary.sh"
159+
unpack_if_necessary
166160

167-
# shellcheck source=./build-functions/set_compilers.sh
168-
source "${OPENCOARRAYS_SRC_DIR:-}/prerequisites/build-functions/set_compilers.sh"
169-
set_compilers
161+
# shellcheck source=./build-functions/set_compilers.sh
162+
source "${OPENCOARRAYS_SRC_DIR:-}/prerequisites/build-functions/set_compilers.sh"
163+
set_compilers
170164

171-
# shellcheck source=./build-functions/build_and_install.sh
172-
source "${OPENCOARRAYS_SRC_DIR:-}/prerequisites/build-functions/build_and_install.sh"
173-
build_and_install
174-
fi
165+
# shellcheck source=./build-functions/build_and_install.sh
166+
source "${OPENCOARRAYS_SRC_DIR:-}/prerequisites/build-functions/build_and_install.sh"
167+
build_and_install

0 commit comments

Comments
 (0)