Skip to content

Commit

Permalink
improve script
Browse files Browse the repository at this point in the history
  • Loading branch information
majetideepak committed Mar 1, 2024
1 parent 7b210f9 commit 52835dc
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 11 deletions.
12 changes: 8 additions & 4 deletions scripts/setup-centos8.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
# $ scripts/setup-macos.sh install_googletest install_fmt
#

set -eufx -o pipefail
set -efx -o pipefail
# Some of the packages must be build with the same compiler flags
# so that some low level types are the same size. Also, disable warnings.
SCRIPTDIR=$(dirname "${BASH_SOURCE[0]}")
Expand Down Expand Up @@ -206,14 +206,18 @@ function install_velox_deps {
(return 2> /dev/null) && return # If script was sourced, don't run commands.

(
if [ "${INSTALL_PREREQUISITES:-Y}" == "Y" ]; then
echo "Installing build dependencies"
run_and_time install_build_prerequisites
fi
# Activate gcc9; enable errors on unset variables afterwards.
source /opt/rh/gcc-toolset-9/enable || exit 1
set -u
if [[ $# -ne 0 ]]; then
for cmd in "$@"; do
run_and_time "${cmd}"
done
else
if [ "${INSTALL_PREREQUISITES:-Y}" == "Y" ]; then
run_and_time install_build_prerequisites
fi
install_velox_deps
fi
)
Expand Down
8 changes: 4 additions & 4 deletions scripts/setup-macos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -142,16 +142,16 @@ function install_velox_deps {
(return 2> /dev/null) && return # If script was sourced, don't run commands.

(
echo "Installing mac dependencies"
if [ "${INSTALL_PREREQUISITES:-Y}" == "Y" ]; then
echo "Installing build dependencies"
run_and_time install_build_prerequisites
fi
update_brew
if [[ $# -ne 0 ]]; then
for cmd in "$@"; do
run_and_time "${cmd}"
done
else
if [ "${INSTALL_PREREQUISITES:-Y}" == "Y" ]; then
run_and_time install_build_prerequisites
fi
install_velox_deps
fi
)
Expand Down
7 changes: 4 additions & 3 deletions scripts/setup-ubuntu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -150,14 +150,15 @@ function install_velox_deps {
(return 2> /dev/null) && return # If script was sourced, don't run commands.

(
if [ "${INSTALL_PREREQUISITES:-Y}" == "Y" ]; then
echo "Installing build dependencies"
run_and_time install_build_prerequisites
fi
if [[ $# -ne 0 ]]; then
for cmd in "$@"; do
run_and_time "${cmd}"
done
else
if [ "${INSTALL_PREREQUISITES:-Y}" == "Y" ]; then
run_and_time install_build_prerequisites
fi
install_velox_deps
fi
)
Expand Down

0 comments on commit 52835dc

Please sign in to comment.