1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-07-07 14:21:48 +02:00

Specialize LocalOverlayStore::queryPathFromHashPart

With test
This commit is contained in:
John Ericson 2023-05-09 10:40:10 -04:00
parent ddaf2750b5
commit e7c3399ed2
3 changed files with 20 additions and 0 deletions

View file

@ -60,6 +60,14 @@ nix-store --verify-path --store "$storeA" "$path"
# Verifying path in merged-store
nix-store --verify-path --store "$storeB" "$path"
hashPart=$(echo $path | sed "s^$NIX_STORE_DIR/^^" | sed 's/-.*//')
# Lower store can find from hash part
[[ $(nix store --store $storeA path-from-hash-part $hashPart) == $path ]]
# merged store can find from hash part
[[ $(nix store --store $storeB path-from-hash-part $hashPart) == $path ]]
### Do a redundant add
# upper layer should not have it