1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-09 03:56:01 +01:00

shellcheck fix: tests/functional/secure-drv-outputs.sh

This commit is contained in:
Farid Zakaria 2025-09-30 20:06:37 -07:00
parent 64d828b8c4
commit 1a5ccbeafc
2 changed files with 5 additions and 6 deletions

View file

@ -106,7 +106,6 @@
enable = true; enable = true;
excludes = [ excludes = [
# We haven't linted these files yet # We haven't linted these files yet
''^tests/functional/secure-drv-outputs\.sh$''
''^tests/functional/selfref-gc\.sh$'' ''^tests/functional/selfref-gc\.sh$''
''^tests/functional/shell\.shebang\.sh$'' ''^tests/functional/shell\.shebang\.sh$''
''^tests/functional/simple\.builder\.sh$'' ''^tests/functional/simple\.builder\.sh$''

View file

@ -13,20 +13,20 @@ clearStore
startDaemon startDaemon
# Determine the output path of the "good" derivation. # Determine the output path of the "good" derivation.
goodOut=$(nix-store -q $(nix-instantiate ./secure-drv-outputs.nix -A good)) goodOut=$(nix-store -q "$(nix-instantiate ./secure-drv-outputs.nix -A good)")
# Instantiate the "bad" derivation. # Instantiate the "bad" derivation.
badDrv=$(nix-instantiate ./secure-drv-outputs.nix -A bad) badDrv=$(nix-instantiate ./secure-drv-outputs.nix -A bad)
badOut=$(nix-store -q $badDrv) badOut=$(nix-store -q "$badDrv")
# Rewrite the bad derivation to produce the output path of the good # Rewrite the bad derivation to produce the output path of the good
# derivation. # derivation.
rm -f $TEST_ROOT/bad.drv rm -f "$TEST_ROOT"/bad.drv
sed -e "s|$badOut|$goodOut|g" < $badDrv > $TEST_ROOT/bad.drv sed -e "s|$badOut|$goodOut|g" < "$badDrv" > "$TEST_ROOT"/bad.drv
# Add the manipulated derivation to the store and build it. This # Add the manipulated derivation to the store and build it. This
# should fail. # should fail.
if badDrv2=$(nix-store --add $TEST_ROOT/bad.drv); then if badDrv2=$(nix-store --add "$TEST_ROOT"/bad.drv); then
nix-store -r "$badDrv2" nix-store -r "$badDrv2"
fi fi