mirror of
https://github.com/NixOS/nix
synced 2025-07-07 01:51:47 +02:00
Fix recursive ingestion from lower store
This commit is contained in:
parent
e7c3399ed2
commit
5059be53b1
2 changed files with 17 additions and 5 deletions
|
@ -22,7 +22,8 @@ mkdir -p "$TEST_ROOT"/{store-a,store-b,merged-store/nix/store,workdir}
|
|||
nix-store --store "$storeA" --add dummy
|
||||
|
||||
# Build something in lower store
|
||||
path=$(nix-build ./hermetic.nix --arg busybox "$busybox" --arg seed 1 --store "$storeA" --no-out-link)
|
||||
drvPath=$(nix-instantiate --store $storeA ./hermetic.nix --arg busybox "$busybox" --arg seed 1)
|
||||
path=$(nix-store --store "$storeA" --realise $drvPath)
|
||||
|
||||
mount -t overlay overlay \
|
||||
-o lowerdir="$storeA/nix/store" \
|
||||
|
@ -38,9 +39,9 @@ cleanupOverlay () {
|
|||
trap cleanupOverlay EXIT
|
||||
|
||||
toRealPath () {
|
||||
storeDir=$1; shift
|
||||
storePath=$1; shift
|
||||
echo $storeDir$(echo $storePath | sed "s^$NIX_STORE_DIR^^")
|
||||
storeDir=$1; shift
|
||||
storePath=$1; shift
|
||||
echo $storeDir$(echo $storePath | sed "s^$NIX_STORE_DIR^^")
|
||||
}
|
||||
|
||||
### Check status
|
||||
|
@ -60,6 +61,12 @@ nix-store --verify-path --store "$storeA" "$path"
|
|||
# Verifying path in merged-store
|
||||
nix-store --verify-path --store "$storeB" "$path"
|
||||
|
||||
[[ \
|
||||
$(nix-store --store $storeA --query --outputs $drvPath) \
|
||||
== \
|
||||
$(nix-store --store $storeB --query --outputs $drvPath) \
|
||||
]]
|
||||
|
||||
hashPart=$(echo $path | sed "s^$NIX_STORE_DIR/^^" | sed 's/-.*//')
|
||||
|
||||
# Lower store can find from hash part
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue