4646# shellcheck source=./use-case/bootstrap.sh
4747source " ${B3B_USE_CASE} /bootstrap.sh" " $@ "
4848
49-
50-
5149# Set up a function to call when receiving an EXIT signal to do some cleanup. Remove if
5250# not needed. Other signals can be trapped too, like SIGINT and SIGTERM.
5351function cleanup_before_exit () {
@@ -61,14 +59,15 @@ trap cleanup_before_exit EXIT # The signal is specified here. Could be SIGINT, S
6159export __flag_present=1
6260
6361# shellcheck disable=SC2154
64- if [[ " ${arg_l} " != " ${__flag_present} " && " ${arg_L} " != " ${__flag_present} " &&
65- " ${arg_v} " != " ${__flag_present} " && " ${arg_h} " != " ${__flag_present} " &&
66- -z " ${arg_D:- ${arg_p:- ${arg_P:- ${arg_U:- ${arg_V} } } } } " ]]; then
67- help " ${__base} : Insufficient arguments. Please pass either -D, -h, -l, -L, -p, -P, -U, -v, -V, or a longer equivalent."
62+ if [[ " ${arg_l} " != " ${__flag_present} " &&
63+ " ${arg_v} " != " ${__flag_present} " &&
64+ " ${arg_h} " != " ${__flag_present} " &&
65+ -z " ${arg_D:- ${arg_p:- ${arg_P:- ${arg_U:- ${arg_V:- ${arg_B} } } } } } " ]]; then
66+ help " ${__base} : Insufficient arguments. Please pass either -B, -D, -h, -l, -L, -p, -P, -U, -v, -V, or a longer equivalent."
6867fi
6968
70- # Suppress info and debug messages if -l, -P, -U, -V, -D, or their longer equivalent is present:
71- [[ " ${arg_l} " == " ${__flag_present} " || ! -z " ${arg_P:- ${arg_U:- ${arg_V:- ${arg_D} } } } " ]] && suppress_info_debug_messages
69+ # Suppress info and debug messages if -B, - l, -P, -U, -V, -D, or their longer equivalent is present:
70+ [[ " ${arg_l} " == " ${__flag_present} " || ! -z " ${arg_P:- ${arg_U:- ${arg_V:- ${arg_D:- ${arg_B} } } } } " ]] && suppress_info_debug_messages
7271
7372[ -z " ${LOG_LEVEL:- } " ] && emergency " Cannot continue without LOG_LEVEL. "
7473
@@ -90,6 +89,7 @@ info "__usage: ${__usage}"
9089info " LOG_LEVEL: ${LOG_LEVEL} "
9190
9291info " -b (--branch): ${arg_b} "
92+ info " -B (--list-branches): ${arg_B} "
9393info " -c (--with-c): ${arg_c} "
9494info " -C (--with-cxx): ${arg_C} "
9595info " -d (--debug): ${arg_d} "
@@ -101,7 +101,6 @@ info "-i (--install-prefix): ${arg_i} "
101101info " -j (--num-threads): ${arg_j} "
102102info " -I (--install-version): ${arg_I} "
103103info " -l (--list-packages): ${arg_l} "
104- info " -L (--list-branches): ${arg_L} "
105104info " -m (--with-cmake): ${arg_m} "
106105info " -M (--with-mpi): ${arg_M} "
107106info " -n (--no-color): ${arg_n} "
@@ -113,10 +112,12 @@ info "-v (--version): ${arg_v} "
113112info " -V (--print-version): ${arg_V} "
114113}
115114
116- # shellcheck source=./build-functions/set_or_print_default_version.sh
117- source " ${OPENCOARRAYS_SRC_DIR:- } /prerequisites/build-functions/set_or_print_default_version.sh"
118- set_or_print_default_version " ${@ } "
119- export version_to_build=" ${arg_I:- ${default_version} } "
115+ if [[ -z " ${arg_B} " ]]; then
116+ # shellcheck source=./build-functions/set_or_print_default_version.sh
117+ source " ${OPENCOARRAYS_SRC_DIR:- } /prerequisites/build-functions/set_or_print_default_version.sh"
118+ set_or_print_default_version " ${@ } "
119+ export version_to_build=" ${arg_I:- ${arg_b:- ${default_version} } } "
120+ fi
120121
121122# shellcheck source=./build-functions/set_or_print_downloader.sh
122123source " ${OPENCOARRAYS_SRC_DIR:- } /prerequisites/build-functions/set_or_print_downloader.sh"
@@ -128,20 +129,25 @@ set_or_print_url
128129
129130# shellcheck source=./build-functions/set_or_print_installation_path.sh
130131source " ${OPENCOARRAYS_SRC_DIR:- } /prerequisites/build-functions/set_or_print_installation_path.sh"
131- set_or_print_installation_path
132+
133+ if [[ -z " ${arg_B} " ]]; then
134+ set_or_print_installation_path
135+ fi
132136
133137# shellcheck source=./build-functions/download_if_necessary.sh
134138source " ${OPENCOARRAYS_SRC_DIR:- } /prerequisites/build-functions/download_if_necessary.sh"
135139download_if_necessary
136140
137- # shellcheck source=./build-functions/unpack_if_necessary.sh
138- source " ${OPENCOARRAYS_SRC_DIR:- } /prerequisites/build-functions/unpack_if_necessary.sh"
139- unpack_if_necessary
140-
141- # shellcheck source=./build-functions/set_compilers.sh
142- source " ${OPENCOARRAYS_SRC_DIR:- } /prerequisites/build-functions/set_compilers.sh"
143- set_compilers
144-
145- # shellcheck source=./build-functions/build_and_install.sh
146- source " ${OPENCOARRAYS_SRC_DIR:- } /prerequisites/build-functions/build_and_install.sh"
147- build_and_install
141+ if [[ -z " ${arg_B} " ]]; then
142+ # shellcheck source=./build-functions/unpack_if_necessary.sh
143+ source " ${OPENCOARRAYS_SRC_DIR:- } /prerequisites/build-functions/unpack_if_necessary.sh"
144+ unpack_if_necessary
145+
146+ # shellcheck source=./build-functions/set_compilers.sh
147+ source " ${OPENCOARRAYS_SRC_DIR:- } /prerequisites/build-functions/set_compilers.sh"
148+ set_compilers
149+
150+ # shellcheck source=./build-functions/build_and_install.sh
151+ source " ${OPENCOARRAYS_SRC_DIR:- } /prerequisites/build-functions/build_and_install.sh"
152+ build_and_install
153+ fi
0 commit comments