1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-25 14:51:16 +02:00
This commit is contained in:
Eelco Dolstra 2025-02-12 22:05:38 +01:00
parent 254b7afe66
commit 17d46041b8

View file

@ -73,13 +73,13 @@ test_tarball .gz gzip
# All entries in tree.tar.gz refer to the same file, and all have the same inode when unpacked by GNU tar. # All entries in tree.tar.gz refer to the same file, and all have the same inode when unpacked by GNU tar.
# We don't preserve the hard links, because that's an optimization we think is not worth the complexity, # We don't preserve the hard links, because that's an optimization we think is not worth the complexity,
# so we only make sure that the contents are copied correctly. # so we only make sure that the contents are copied correctly.
path="$(nix flake prefetch --json "tarball+file://$(pwd)/tree.tar.gz" | jq -r .storePath)" nix flake prefetch --json "tarball+file://$(pwd)/tree.tar.gz" --out-link "$TEST_ROOT/result"
[[ $(cat "$path/a/b/foo") = bar ]] [[ $(cat "$TEST_ROOT/result/a/b/foo") = bar ]]
[[ $(cat "$path/a/b/xyzzy") = bar ]] [[ $(cat "$TEST_ROOT/result/a/b/xyzzy") = bar ]]
[[ $(cat "$path/a/yyy") = bar ]] [[ $(cat "$TEST_ROOT/result/a/yyy") = bar ]]
[[ $(cat "$path/a/zzz") = bar ]] [[ $(cat "$TEST_ROOT/result/a/zzz") = bar ]]
[[ $(cat "$path/c/aap") = bar ]] [[ $(cat "$TEST_ROOT/result/c/aap") = bar ]]
[[ $(cat "$path/fnord") = bar ]] [[ $(cat "$TEST_ROOT/result/fnord") = bar ]]
# Test a tarball that has multiple top-level directories. # Test a tarball that has multiple top-level directories.
rm -rf "$TEST_ROOT/tar_root" rm -rf "$TEST_ROOT/tar_root"