From 8e653e40c6e4af12273155e73249f1b4e964eb71 Mon Sep 17 00:00:00 2001 From: Kir Kolyshkin Date: Mon, 10 Mar 2025 13:57:57 -0700 Subject: [PATCH] script/setup_host_fedora.sh: use bash arrays This makes the code more robust and allows to remove the "shellcheck disable=SC2086" annotation. Signed-off-by: Kir Kolyshkin --- script/setup_host_fedora.sh | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/script/setup_host_fedora.sh b/script/setup_host_fedora.sh index 7a1cfa7a0..46d240409 100755 --- a/script/setup_host_fedora.sh +++ b/script/setup_host_fedora.sh @@ -1,12 +1,11 @@ #!/bin/bash set -eux -o pipefail -DNF_OPTS="-y --setopt=install_weak_deps=False --setopt=tsflags=nodocs --exclude=kernel,kernel-core" -RPMS="bats git-core glibc-static golang jq libseccomp-devel make" +DNF=(dnf -y --setopt=install_weak_deps=False --setopt=tsflags=nodocs --exclude="kernel,kernel-core") +RPMS=(bats git-core glibc-static golang jq libseccomp-devel make) # Work around dnf mirror failures by retrying a few times. for i in $(seq 0 2); do sleep "$i" - # shellcheck disable=SC2086 - dnf $DNF_OPTS update && dnf $DNF_OPTS install $RPMS && break + "${DNF[@]}" update && "${DNF[@]}" install "${RPMS[@]}" && break done dnf clean all