From 16d8e789495b3014a82f9dfcc4add4cbe88cb015 Mon Sep 17 00:00:00 2001 From: Zack Cerza Date: Thu, 31 Jul 2025 15:45:54 -0600 Subject: [PATCH] build_utils.sh: Fix shellcheck errors Signed-off-by: Zack Cerza --- scripts/build_utils.sh | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/scripts/build_utils.sh b/scripts/build_utils.sh index 598b1bf3..02d569a9 100755 --- a/scripts/build_utils.sh +++ b/scripts/build_utils.sh @@ -172,7 +172,7 @@ install_python_packages_no_binary () { pip_download $VENV setuptools pkgs=("${!1}") - for package in ${pkgs[@]}; do + for package in "${pkgs[@]}"; do echo $package # download packages to the local pip cache pip_download $VENV $package --no-binary=:all: @@ -234,7 +234,7 @@ install_python_packages () { pip_download $venv setuptools pkgs=("${!1}") - for package in ${pkgs[@]}; do + for package in "${pkgs[@]}"; do echo $package # download packages to the local pip cache pip_download $venv $package @@ -1004,10 +1004,11 @@ build_debs() { $venv/chacractl binary ${chacra_flags} create ${chacra_endpoint} # extract cephadm if it exists - if [ -f release/${vers}/cephadm_${vers}*.deb ] ; then - dpkg-deb --fsys-tarfile release/${vers}/cephadm_${vers}*.deb | tar -x -f - --strip-components=3 ./usr/sbin/cephadm + for file in release/${vers}/cephadm_${vers}*.deb; do + dpkg-deb --fsys-tarfile "$file" | tar -x -f - --strip-components=3 ./usr/sbin/cephadm echo cephadm | $venv/chacractl binary ${chacra_flags} create ${chacra_endpoint} - fi + break + done # write json file with build info cat > $WORKSPACE/repo-extra.json << EOF @@ -1772,7 +1773,7 @@ function ssh_exec() { if [[ ! -z $SSH_KNOWN_HOSTS_FILE ]]; then SSH_OPTS="$SSH_OPTS -o UserKnownHostsFile=$SSH_KNOWN_HOSTS_FILE" fi - timeout ${SSH_TIMEOUT:-"30s"} ssh -i ${SSH_KEY:-"$HOME/.ssh/id_rsa"} $SSH_OPTS ${SSH_USER}@${SSH_ADDRESS} ${@} || { + timeout ${SSH_TIMEOUT:-"30s"} ssh -i ${SSH_KEY:-"$HOME/.ssh/id_rsa"} $SSH_OPTS ${SSH_USER}@${SSH_ADDRESS} "${@}" || { EXIT_CODE=$? # By default, the "timeout" CLI tool always exits with 124 when the # timeout is exceeded. Unless "--preserve-status" argument is used, the -- 2.47.3