mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-10 00:08:07 +02:00
Test nix-store --optimise
This commit is contained in:
parent
fdff3a7eae
commit
19437785eb
1 changed files with 17 additions and 0 deletions
|
@ -18,6 +18,23 @@ if [ "$nlink" != 3 ]; then
|
|||
exit 1
|
||||
fi
|
||||
|
||||
outPath3=$(echo 'with import ./config.nix; mkDerivation { name = "foo3"; builder = builtins.toFile "builder" "mkdir $out; echo hello > $out/foo"; }' | nix-build - --no-out-link)
|
||||
|
||||
inode3="$(perl -e "print ((lstat('$outPath3/foo'))[1])")"
|
||||
if [ "$inode1" = "$inode3" ]; then
|
||||
echo "inodes match unexpectedly"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
nix-store --optimise
|
||||
|
||||
inode1="$(perl -e "print ((lstat('$outPath1/foo'))[1])")"
|
||||
inode3="$(perl -e "print ((lstat('$outPath3/foo'))[1])")"
|
||||
if [ "$inode1" != "$inode3" ]; then
|
||||
echo "inodes do not match"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
nix-store --gc
|
||||
|
||||
if [ -n "$(ls $NIX_STORE_DIR/.links)" ]; then
|
||||
|
|
Loading…
Reference in a new issue