1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-27 08:31:16 +02:00

Provide default implementations for a couple of Store methods

This commit is contained in:
Eelco Dolstra 2017-02-07 19:22:48 +01:00
parent ddb5577f2e
commit fa07558a06
No known key found for this signature in database
GPG key ID: 8170B4726D7198DE
4 changed files with 20 additions and 26 deletions

View file

@ -285,6 +285,19 @@ bool Store::isValidPath(const Path & storePath)
}
/* Default implementation for stores that only implement
queryPathInfoUncached(). */
bool Store::isValidPathUncached(const Path & path)
{
try {
queryPathInfo(path);
return true;
} catch (InvalidPath &) {
return false;
}
}
ref<const ValidPathInfo> Store::queryPathInfo(const Path & storePath)
{
std::promise<ref<ValidPathInfo>> promise;