diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/libstore/binary-cache-store.hh | 3 | ||||
-rw-r--r-- | src/libstore/store-api.cc | 11 | ||||
-rw-r--r-- | src/libstore/store-api.hh | 2 |
3 files changed, 12 insertions, 4 deletions
diff --git a/src/libstore/binary-cache-store.hh b/src/libstore/binary-cache-store.hh index e369abe46d6f..574696cf3a1f 100644 --- a/src/libstore/binary-cache-store.hh +++ b/src/libstore/binary-cache-store.hh @@ -54,9 +54,6 @@ public: bool isValidPathUncached(const Path & path) override; - PathSet queryValidPaths(const PathSet & paths) override - { notImpl(); } - PathSet queryAllValidPaths() override { notImpl(); } diff --git a/src/libstore/store-api.cc b/src/libstore/store-api.cc index 74014b47e513..a830ae5bbd0c 100644 --- a/src/libstore/store-api.cc +++ b/src/libstore/store-api.cc @@ -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. */ diff --git a/src/libstore/store-api.hh b/src/libstore/store-api.hh index b876ffbba765..ce1583b0c6fa 100644 --- a/src/libstore/store-api.hh +++ b/src/libstore/store-api.hh @@ -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 |