Remove $NIX_DB_DIR
This variable has no reason to exist, given $NIX_STATE_DIR.
This commit is contained in:
parent
be64fbb501
commit
2fad86f361
12 changed files with 11 additions and 30 deletions
|
|
@ -12,7 +12,6 @@ fi
|
|||
export NIX_LOCALSTATE_DIR=$TEST_ROOT/var
|
||||
export NIX_LOG_DIR=$TEST_ROOT/var/log/nix
|
||||
export NIX_STATE_DIR=$TEST_ROOT/var/nix
|
||||
export NIX_DB_DIR=$TEST_ROOT/db
|
||||
export NIX_CONF_DIR=$TEST_ROOT/etc
|
||||
export NIX_MANIFESTS_DIR=$TEST_ROOT/var/nix/manifests
|
||||
export _NIX_TEST_SHARED=$TEST_ROOT/shared
|
||||
|
|
@ -51,12 +50,10 @@ clearStore() {
|
|||
chmod -R +w "$NIX_STORE_DIR"
|
||||
rm -rf "$NIX_STORE_DIR"
|
||||
mkdir "$NIX_STORE_DIR"
|
||||
rm -rf "$NIX_DB_DIR"
|
||||
mkdir "$NIX_DB_DIR"
|
||||
rm -rf "$NIX_STATE_DIR"
|
||||
mkdir "$NIX_STATE_DIR"
|
||||
nix-store --init
|
||||
clearProfiles
|
||||
rm -f "$NIX_STATE_DIR"/gcroots/auto/*
|
||||
rm -f "$NIX_STATE_DIR"/gcroots/ref
|
||||
}
|
||||
|
||||
clearCache() {
|
||||
|
|
|
|||
|
|
@ -8,8 +8,7 @@ deps="$(nix-store -qR $TEST_ROOT/result)"
|
|||
|
||||
nix-store --dump-db > $TEST_ROOT/dump
|
||||
|
||||
rm -rf $NIX_DB_DIR
|
||||
mkdir $NIX_DB_DIR
|
||||
rm -rf $NIX_STATE_DIR/db
|
||||
|
||||
nix-store --load-db < $TEST_ROOT/dump
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,5 @@
|
|||
source common.sh
|
||||
|
||||
echo "NIX_STORE_DIR=$NIX_STORE_DIR NIX_DB_DIR=$NIX_DB_DIR"
|
||||
|
||||
test -n "$TEST_ROOT"
|
||||
if test -d "$TEST_ROOT"; then
|
||||
chmod -R u+w "$TEST_ROOT"
|
||||
|
|
@ -13,7 +11,6 @@ mkdir "$NIX_STORE_DIR"
|
|||
mkdir "$NIX_LOCALSTATE_DIR"
|
||||
mkdir -p "$NIX_LOG_DIR"/drvs
|
||||
mkdir "$NIX_STATE_DIR"
|
||||
mkdir "$NIX_DB_DIR"
|
||||
mkdir "$NIX_CONF_DIR"
|
||||
|
||||
cat > "$NIX_CONF_DIR"/nix.conf <<EOF
|
||||
|
|
@ -28,6 +25,6 @@ EOF
|
|||
nix-store --init
|
||||
|
||||
# Did anything happen?
|
||||
test -e "$NIX_DB_DIR"/db.sqlite
|
||||
test -e "$NIX_STATE_DIR"/db/db.sqlite
|
||||
|
||||
echo 'Hello World' > ./dummy
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ echo "collecting garbage..."
|
|||
ln -sfn $reference "$NIX_STATE_DIR"/gcroots/ref
|
||||
nix-store --gc
|
||||
|
||||
if [ -n "$(type -p sqlite3)" -a "$(sqlite3 $NIX_DB_DIR/db.sqlite 'select count(*) from Refs')" -ne 0 ]; then
|
||||
if [ -n "$(type -p sqlite3)" -a "$(sqlite3 $NIX_STATE_DIR/db/db.sqlite 'select count(*) from Refs')" -ne 0 ]; then
|
||||
echo "referrers not cleaned up"
|
||||
exit 1
|
||||
fi
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ clearStore
|
|||
|
||||
startDaemon
|
||||
|
||||
$SHELL ./user-envs.sh
|
||||
storeCleared=1 $SHELL ./user-envs.sh
|
||||
|
||||
nix-store --dump-db > $TEST_ROOT/d1
|
||||
NIX_REMOTE= nix-store --dump-db > $TEST_ROOT/d2
|
||||
|
|
|
|||
|
|
@ -1,6 +1,9 @@
|
|||
source common.sh
|
||||
|
||||
clearStore
|
||||
if [ -z "$storeCleared" ]; then
|
||||
clearStore
|
||||
fi
|
||||
|
||||
clearProfiles
|
||||
|
||||
# Query installed: should be empty.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue