mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2025-02-08 03:07:17 +02:00
Fix LocalOverlayStore::queryPathInfoUncached
, FIXME in test
This commit is contained in:
parent
5406256d78
commit
59a8099038
2 changed files with 14 additions and 12 deletions
|
@ -33,21 +33,24 @@ void LocalOverlayStore::queryPathInfoUncached(const StorePath & path,
|
||||||
|
|
||||||
auto callbackPtr = std::make_shared<decltype(callback)>(std::move(callback));
|
auto callbackPtr = std::make_shared<decltype(callback)>(std::move(callback));
|
||||||
|
|
||||||
// If we don't have it, check lower store
|
|
||||||
LocalStore::queryPathInfoUncached(path,
|
LocalStore::queryPathInfoUncached(path,
|
||||||
{[this, path, callbackPtr](std::future<std::shared_ptr<const ValidPathInfo>> fut) {
|
{[this, path, callbackPtr](std::future<std::shared_ptr<const ValidPathInfo>> fut) {
|
||||||
try {
|
try {
|
||||||
(*callbackPtr)(fut.get());
|
auto info = fut.get();
|
||||||
|
if (info)
|
||||||
|
return (*callbackPtr)(std::move(info));
|
||||||
} catch (...) {
|
} catch (...) {
|
||||||
lowerStore->queryPathInfo(path,
|
return callbackPtr->rethrow();
|
||||||
{[path, callbackPtr](std::future<ref<const ValidPathInfo>> fut) {
|
|
||||||
try {
|
|
||||||
(*callbackPtr)(fut.get().get_ptr());
|
|
||||||
} catch (...) {
|
|
||||||
callbackPtr->rethrow();
|
|
||||||
}
|
|
||||||
}});
|
|
||||||
}
|
}
|
||||||
|
// If we don't have it, check lower store
|
||||||
|
lowerStore->queryPathInfo(path,
|
||||||
|
{[path, callbackPtr](std::future<ref<const ValidPathInfo>> fut) {
|
||||||
|
try {
|
||||||
|
(*callbackPtr)(fut.get().get_ptr());
|
||||||
|
} catch (...) {
|
||||||
|
return callbackPtr->rethrow();
|
||||||
|
}
|
||||||
|
}});
|
||||||
}});
|
}});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -58,8 +58,7 @@ diff $(toRealPath "$storeA/nix/store" "$path") $(toRealPath "$TEST_ROOT/merged-s
|
||||||
nix-store --verify-path --store "$storeA" "$path"
|
nix-store --verify-path --store "$storeA" "$path"
|
||||||
|
|
||||||
# Verifying path in merged-store
|
# Verifying path in merged-store
|
||||||
# FIXME should succeed
|
nix-store --verify-path --store "$storeB" "$path"
|
||||||
expect 1 nix-store --verify-path --store "$storeB" "$path"
|
|
||||||
|
|
||||||
### Do a redundant add
|
### Do a redundant add
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue