From 52835dcf106f8f7daad6621cfb3fa7777663f545 Mon Sep 17 00:00:00 2001 From: Deepak Majeti Date: Fri, 1 Mar 2024 09:03:29 +0530 Subject: [PATCH] improve script --- scripts/setup-centos8.sh | 12 ++++++++---- scripts/setup-macos.sh | 8 ++++---- scripts/setup-ubuntu.sh | 7 ++++--- 3 files changed, 16 insertions(+), 11 deletions(-) diff --git a/scripts/setup-centos8.sh b/scripts/setup-centos8.sh index 5f216779d050c..71afe0cf1f756 100755 --- a/scripts/setup-centos8.sh +++ b/scripts/setup-centos8.sh @@ -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]}") @@ -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 ) diff --git a/scripts/setup-macos.sh b/scripts/setup-macos.sh index 9bdf07c3bd09d..48f60dbf0c256 100755 --- a/scripts/setup-macos.sh +++ b/scripts/setup-macos.sh @@ -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 ) diff --git a/scripts/setup-ubuntu.sh b/scripts/setup-ubuntu.sh index a628da00aea42..f73dcb6de9c5b 100755 --- a/scripts/setup-ubuntu.sh +++ b/scripts/setup-ubuntu.sh @@ -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 )