mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-22 22:16:16 +02:00
Implement generic Store::queryValidPaths()
This commit is contained in:
parent
35db4f65a0
commit
c663b84573
3 changed files with 12 additions and 4 deletions
|
@ -54,9 +54,6 @@ public:
|
|||
|
||||
bool isValidPathUncached(const Path & path) override;
|
||||
|
||||
PathSet queryValidPaths(const PathSet & paths) override
|
||||
{ notImpl(); }
|
||||
|
||||
PathSet queryAllValidPaths() override
|
||||
{ notImpl(); }
|
||||
|
||||
|
|
|
@ -361,6 +361,17 @@ void Store::queryPathInfo(const Path & storePath,
|
|||
}
|
||||
|
||||
|
||||
PathSet Store::queryValidPaths(const PathSet & paths)
|
||||
{
|
||||
PathSet valid;
|
||||
|
||||
for (auto & path : paths)
|
||||
if (isValidPath(path)) valid.insert(path);
|
||||
|
||||
return valid;
|
||||
}
|
||||
|
||||
|
||||
/* Return a string accepted by decodeValidPathInfo() that
|
||||
registers the specified paths as valid. Note: it's the
|
||||
responsibility of the caller to provide a closure. */
|
||||
|
|
|
@ -306,7 +306,7 @@ protected:
|
|||
public:
|
||||
|
||||
/* Query which of the given paths is valid. */
|
||||
virtual PathSet queryValidPaths(const PathSet & paths) = 0;
|
||||
virtual PathSet queryValidPaths(const PathSet & paths);
|
||||
|
||||
/* Query the set of all valid paths. Note that for some store
|
||||
backends, the name part of store paths may be omitted
|
||||
|
|
Loading…
Reference in a new issue