5
5
#
6
6
# - Build OpenCoarrays prerequisite packages and their prerequisites
7
7
#
8
- # Usage: LOG_LEVEL=7 B3B_USE_CASE=/opt/bash3boilerplate/src/use-case ./my-script.sh -f script_input.txt
8
+ # Usage: LOG_LEVEL=7 B3B_USE_CASE=/opt/bash3boilerplate/src/use-case ./my-script.sh -f script_input.txt
9
9
#
10
10
# More info:
11
11
#
28
28
# (1) Import several bash3boilerplate helper functions & default settings.
29
29
# (2) Set several variables describing the current file and its usage page.
30
30
# (3) Parse the usage information (default usage file name: current file's name with -usage appended).
31
- # (4) Parse the command line using the usage information.
31
+ # (4) Parse the command line using the usage information.
32
32
33
33
export __usage=" ${OPENCOARRAYS_SRC_DIR} /prerequisites/install-binary.sh-usage"
34
34
35
35
# ## Start of boilerplate -- do not edit this block #######################
36
36
if [[ ! -f " ${B3B_USE_CASE:- } /bootstrap.sh" ]]; then
37
- echo " Please set B3B_USE_CASE to the bash3boilerplate use-case directory path."
37
+ echo " Please set B3B_USE_CASE to the bash3boilerplate use-case directory path."
38
38
exit 1
39
39
elif [[ ! -d " ${OPENCOARRAYS_SRC_DIR:- } " ]]; then
40
- echo " Please set OPENCOARRAYS_SRC_DIR to the OpenCoarrays source directory path."
40
+ echo " Please set OPENCOARRAYS_SRC_DIR to the OpenCoarrays source directory path."
41
41
exit 2
42
42
else
43
+ # shellcheck source=./use-case/bootstrap.sh
43
44
source " ${B3B_USE_CASE} /bootstrap.sh" " $@ "
44
45
fi
45
46
# ## End of boilerplate -- start user edits below #########################
@@ -56,14 +57,14 @@ trap cleanup_before_exit EXIT # The signal is specified here. Could be SIGINT, S
56
57
# ####################################################################
57
58
58
59
export __flag_present=1
59
-
60
- if [[ " ${arg_l} " != " ${__flag_present} " && " ${arg_N} " != " ${__flag_present} " &&
60
+ # shellcheck disable=SC2154
61
+ if [[ " ${arg_l} " != " ${__flag_present} " && " ${arg_N} " != " ${__flag_present} " &&
61
62
" ${arg_v} " != " ${__flag_present} " && " ${arg_h} " != " ${__flag_present} " &&
62
63
-z " ${arg_D:- ${arg_p:- ${arg_P:- ${arg_U:- ${arg_V} } } } } " ]]; then
63
64
help " ${__base} : Insufficient arguments. Please pass either -D, -h, -N, -l, -p, -P, -U, -v, -V, or a longer equivalent."
64
65
fi
65
66
66
- # Suppress info and debug messages if -l, -P, -U, -V, -D, or their longer equivalent is present:
67
+ # Suppress info and debug messages if -l, -P, -U, -V, -D, or their longer equivalent is present:
67
68
[[ " ${arg_l} " == " ${__flag_present} " || ! -z " ${arg_P:- ${arg_U:- ${arg_V:- ${arg_D} } } } " ]] && suppress_info_debug_messages
68
69
69
70
[ -z " ${LOG_LEVEL:- } " ] && emergency " Cannot continue without LOG_LEVEL. "
73
74
[ ! -z " ${arg_P:- } " ] && [ ! -z " ${arg_U:- } " ] && emergency " Only specify one of -P, -U, -V, or their long-form equivalents."
74
75
[ ! -z " ${arg_U:- } " ] && [ ! -z " ${arg_V:- } " ] && emergency " Only specify one of -P, -U, -V, or their long-form equivalents."
75
76
76
- # ## Print bootstrapped magic variables to STDERR when LOG_LEVEL
77
+ # ## Print bootstrapped magic variables to STDERR when LOG_LEVEL
77
78
# ## is at the default value (6) or above.
78
79
# ####################################################################
79
-
80
+ # shellcheck disable=SC2154
81
+ {
80
82
info " __file: ${__file} "
81
83
info " __dir: ${__dir} "
82
84
info " __base: ${__base} "
@@ -93,35 +95,44 @@ info "-I (--install-version): ${arg_I} "
93
95
info " -l (--list-packages): ${arg_l} "
94
96
info " -n (--no-color): ${arg_n} "
95
97
info " -p (--package): ${arg_p} "
96
- info " -P (--print-path): ${arg_P} "
98
+ info " -P (--print-path): ${arg_P} "
97
99
info " -U (--print-url): ${arg_U} "
98
100
info " -v (--version): ${arg_v} "
99
101
info " -V (--print-version): ${arg_V} "
100
-
102
+ }
103
+ # shellcheck source=./install-binary-functions/set_or_print_default_version.sh
101
104
source " ${OPENCOARRAYS_SRC_DIR:- } /prerequisites/install-binary-functions/set_or_print_default_version.sh"
102
105
set_or_print_default_version
103
106
export version_to_build=" ${arg_I:- ${default_version} } "
104
107
108
+ # shellcheck source=./install-binary-functions/set_or_print_downloader.sh
105
109
source " ${OPENCOARRAYS_SRC_DIR:- } /prerequisites/install-binary-functions/set_or_print_downloader.sh"
106
110
set_or_print_downloader
107
111
112
+ # shellcheck source=./install-binary-functions/set_or_print_url.sh
108
113
source " ${OPENCOARRAYS_SRC_DIR:- } /prerequisites/install-binary-functions/set_or_print_url.sh"
109
114
set_or_print_url
110
115
116
+ # shellcheck source=./build-functions/set_or_print_installation_path.sh
111
117
source " ${OPENCOARRAYS_SRC_DIR:- } /prerequisites/build-functions/set_or_print_installation_path.sh"
112
118
set_or_print_installation_path
113
119
120
+ # shellcheck source=./build-functions/download_if_necessary.sh
114
121
source " ${OPENCOARRAYS_SRC_DIR:- } /prerequisites/build-functions/download_if_necessary.sh"
115
122
download_if_necessary
116
123
124
+ # shellcheck source=./build-functions/unpack_if_necessary.sh
117
125
source " ${OPENCOARRAYS_SRC_DIR:- } /prerequisites/build-functions/unpack_if_necessary.sh"
118
126
unpack_if_necessary
119
127
128
+ # shellcheck source=./install-binary-functions/set_or_print_csv_binary_names.sh
120
129
source " ${OPENCOARRAYS_SRC_DIR:- } /prerequisites/install-binary-functions/set_or_print_csv_binary_names.sh"
121
130
set_or_print_csv_binary_names
122
131
132
+ # shellcheck source=./build-functions/set_SUDO_if_needed_to_write_to_directory.sh
123
133
source " ${OPENCOARRAYS_SRC_DIR:- } /prerequisites/build-functions/set_SUDO_if_needed_to_write_to_directory.sh"
124
134
set_SUDO_if_needed_to_write_to_directory /opt
125
135
136
+ # shellcheck source=./install-binary-functions/move_binaries_to_install_path.sh
126
137
source " ${OPENCOARRAYS_SRC_DIR:- } /prerequisites/install-binary-functions/move_binaries_to_install_path.sh"
127
138
move_binaries_to_install_path
0 commit comments