Skip to content

Commit 8e653e4

Browse files
committed
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 <kolyshkin@gmail.com>
1 parent a76a136 commit 8e653e4

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

script/setup_host_fedora.sh

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
#!/bin/bash
22
set -eux -o pipefail
3-
DNF_OPTS="-y --setopt=install_weak_deps=False --setopt=tsflags=nodocs --exclude=kernel,kernel-core"
4-
RPMS="bats git-core glibc-static golang jq libseccomp-devel make"
3+
DNF=(dnf -y --setopt=install_weak_deps=False --setopt=tsflags=nodocs --exclude="kernel,kernel-core")
4+
RPMS=(bats git-core glibc-static golang jq libseccomp-devel make)
55
# Work around dnf mirror failures by retrying a few times.
66
for i in $(seq 0 2); do
77
sleep "$i"
8-
# shellcheck disable=SC2086
9-
dnf $DNF_OPTS update && dnf $DNF_OPTS install $RPMS && break
8+
"${DNF[@]}" update && "${DNF[@]}" install "${RPMS[@]}" && break
109
done
1110
dnf clean all
1211

0 commit comments

Comments
 (0)