From 62b36eba1183dcca45fc5f59be681958855d6fa6 Mon Sep 17 00:00:00 2001 From: Farid Zakaria Date: Sun, 28 Sep 2025 20:31:09 -0700 Subject: [PATCH] shellcheck fix: tests/functional/local-overlay-store/gc-inner.sh --- maintainers/flake-module.nix | 1 - .../local-overlay-store/gc-inner.sh | 21 ++++++++++--------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/maintainers/flake-module.nix b/maintainers/flake-module.nix index 3f38ffc7d..522e7cdb8 100644 --- a/maintainers/flake-module.nix +++ b/maintainers/flake-module.nix @@ -134,7 +134,6 @@ ''^tests/functional/local-overlay-store/delete-duplicate\.sh$'' ''^tests/functional/local-overlay-store/delete-refs-inner\.sh$'' ''^tests/functional/local-overlay-store/delete-refs\.sh$'' - ''^tests/functional/local-overlay-store/gc-inner\.sh$'' ''^tests/functional/logging\.sh$'' ''^tests/functional/misc\.sh$'' ''^tests/functional/multiple-outputs\.sh$'' diff --git a/tests/functional/local-overlay-store/gc-inner.sh b/tests/functional/local-overlay-store/gc-inner.sh index 687fed897..3e63c9398 100644 --- a/tests/functional/local-overlay-store/gc-inner.sh +++ b/tests/functional/local-overlay-store/gc-inner.sh @@ -21,24 +21,24 @@ outPath=$(nix-build ../hermetic.nix --no-out-link --arg busybox "$busybox" --arg # Set a GC root. mkdir -p "$stateB" rm -f "$stateB/gcroots/foo" -ln -sf $outPath "$stateB/gcroots/foo" +ln -sf "$outPath" "$stateB/gcroots/foo" -[ "$(nix-store -q --roots $outPath)" = "$stateB/gcroots/foo -> $outPath" ] +[ "$(nix-store -q --roots "$outPath")" = "$stateB/gcroots/foo -> $outPath" ] -nix-store --gc --print-roots | grep $outPath -nix-store --gc --print-live | grep $outPath -if nix-store --gc --print-dead | grep -E $outPath$; then false; fi +nix-store --gc --print-roots | grep "$outPath" +nix-store --gc --print-live | grep "$outPath" +if nix-store --gc --print-dead | grep -E "$outPath"$; then false; fi nix-store --gc --print-dead -expect 1 nix-store --delete $outPath +expect 1 nix-store --delete "$outPath" test -e "$storeBRoot/$outPath" shopt -s nullglob -for i in $storeBRoot/*; do +for i in "$storeBRoot"/*; do if [[ $i =~ /trash ]]; then continue; fi # compat with old daemon - touch $i.lock - touch $i.chroot + touch "$i".lock + touch "$i".chroot done nix-collect-garbage @@ -51,7 +51,8 @@ rm "$stateB/gcroots/foo" nix-collect-garbage # Check that the output has been GC'd. -test ! -e $outPath +test ! -e "$outPath" # Check that the store is empty. +# shellcheck disable=SC2012 [ "$(ls -1 "$storeBTop" | wc -l)" = "0" ]