Skip to content

Commit 64212ec

Browse files
authored
etc: support common flag in orfs installer (#959)
1 parent bb9a355 commit 64212ec

File tree

1 file changed

+30
-8
lines changed

1 file changed

+30
-8
lines changed

etc/DependencyInstaller.sh

Lines changed: 30 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,8 @@ EOF
126126

127127
# default args
128128
OR_INSTALLER_ARGS=""
129+
#default option
130+
option="all"
129131

130132
# default values, can be overwritten by cmdline args
131133
while [ "$#" -gt 0 ]; do
@@ -135,9 +137,17 @@ while [ "$#" -gt 0 ]; do
135137
;;
136138
-base)
137139
OR_INSTALLER_ARGS="${OR_INSTALLER_ARGS} -base"
140+
if [[ "${option}" != "all" ]]; then
141+
echo "WARNING: previous argument -${option} will be overwritten with -base." >&2
142+
fi
143+
option="base"
138144
;;
139145
-common)
140146
OR_INSTALLER_ARGS="${OR_INSTALLER_ARGS} -common"
147+
if [[ "${option}" != "all" ]]; then
148+
echo "WARNING: previous argument -${option} will be overwritten with -common." >&2
149+
fi
150+
option="common"
141151
;;
142152
-local)
143153
OR_INSTALLER_ARGS="${OR_INSTALLER_ARGS} -local"
@@ -178,21 +188,33 @@ esac
178188
case "${os}" in
179189
"CentOS Linux" )
180190
_installORDependencies
181-
_installCentosPackages
182-
_installCommon
183-
_installCentosCleanUp
191+
if [[ "${option}" == "base" || "${option}" == "all" ]]; then
192+
_installCentosPackages
193+
_installCentosCleanUp
194+
fi
195+
if [[ "${option}" == "common" || "${option}" == "all" ]]; then
196+
_installCommon
197+
fi
184198
;;
185199
"Ubuntu" )
186200
version=$(awk -F= '/^VERSION_ID/{print $2}' /etc/os-release | sed 's/"//g')
187201
_installORDependencies
188-
_installUbuntuPackages "${version}"
189-
_installCommon
190-
_installUbuntuCleanUp
202+
if [[ "${option}" == "base" || "${option}" == "all" ]]; then
203+
_installUbuntuPackages "${version}"
204+
_installUbuntuCleanUp
205+
fi
206+
if [[ "${option}" == "common" || "${option}" == "all" ]]; then
207+
_installCommon
208+
fi
191209
;;
192210
"Darwin" )
193211
_installORDependencies
194-
_installDarwinPackages
195-
_installCommon
212+
if [[ "${option}" == "base" || "${option}" == "all" ]]; then
213+
_installDarwinPackages
214+
fi
215+
if [[ "${option}" == "common" || "${option}" == "all" ]]; then
216+
_installCommon
217+
fi
196218
;;
197219
*)
198220
echo "unsupported system: ${os}" >&2

0 commit comments

Comments
 (0)