2024-05-28 19:43:04 +03:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
2014-02-26 18:47:54 +02:00
|
|
|
source common.sh
|
|
|
|
|
2021-07-26 07:54:55 +03:00
|
|
|
needLocalStore "--dump-db requires a local store"
|
|
|
|
|
2014-02-26 18:47:54 +02:00
|
|
|
clearStore
|
|
|
|
|
|
|
|
path=$(nix-build dependencies.nix -o $TEST_ROOT/result)
|
|
|
|
|
|
|
|
deps="$(nix-store -qR $TEST_ROOT/result)"
|
|
|
|
|
|
|
|
nix-store --dump-db > $TEST_ROOT/dump
|
|
|
|
|
2016-07-27 18:14:41 +03:00
|
|
|
rm -rf $NIX_STATE_DIR/db
|
2014-02-26 18:47:54 +02:00
|
|
|
|
|
|
|
nix-store --load-db < $TEST_ROOT/dump
|
|
|
|
|
|
|
|
deps2="$(nix-store -qR $TEST_ROOT/result)"
|
|
|
|
|
|
|
|
[ "$deps" = "$deps2" ];
|
|
|
|
|
|
|
|
nix-store --dump-db > $TEST_ROOT/dump2
|
|
|
|
cmp $TEST_ROOT/dump $TEST_ROOT/dump2
|