nixos/libvirt: fix shellcheck findings with enableStrictShellChecks enabled (#349620)

This commit is contained in:
Sandro 2024-11-12 19:18:26 +01:00 committed by GitHub
commit 681bc920f8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -426,9 +426,11 @@ in
libvirt/qemu/networks/*.xml \
libvirt/nwfilter/*.xml );
do
mkdir -p /var/lib/$(dirname $i) -m 755
if [ ! -e /var/lib/$i ]; then
cp -pd ${cfg.package}/var/lib/$i /var/lib/$i
# Intended behavior
# shellcheck disable=SC2174
mkdir -p "/var/lib/$(dirname "$i")" -m 755
if [ ! -e "/var/lib/$i" ]; then
cp -pd "${cfg.package}/var/lib/$i" "/var/lib/$i"
fi
done
@ -440,9 +442,7 @@ in
ln -s --force "$emulator" /run/${dirName}/nix-emulators/
done
for helper in bin/qemu-pr-helper; do
ln -s --force ${cfg.qemu.package}/$helper /run/${dirName}/nix-helpers/
done
ln -s --force ${cfg.qemu.package}/bin/qemu-pr-helper /run/${dirName}/nix-helpers/
${optionalString cfg.qemu.ovmf.enable (let
ovmfpackage = pkgs.buildEnv {