about summary refs log tree commit diff
path: root/src/libstore/local-binary-cache-store.cc
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2016-04-29T15·34+0200
committerEelco Dolstra <eelco.dolstra@logicblox.com>2016-04-29T15·34+0200
commit6963de209135d191bdb67cf126df4dda9b19d44e (patch)
tree1242ff282e81da3c24916e032f56b8c04f3e3ca9 /src/libstore/local-binary-cache-store.cc
parent0dd988d2e3653d81b7bda43e0618ce330553b7bc (diff)
nix verify --all: Support local binary caches
Diffstat (limited to 'src/libstore/local-binary-cache-store.cc')
-rw-r--r--src/libstore/local-binary-cache-store.cc14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/libstore/local-binary-cache-store.cc b/src/libstore/local-binary-cache-store.cc
index b6e72b0392..2c29449387 100644
--- a/src/libstore/local-binary-cache-store.cc
+++ b/src/libstore/local-binary-cache-store.cc
@@ -33,6 +33,20 @@ protected:
 
     std::shared_ptr<std::string> getFile(const std::string & path) override;
 
+    PathSet queryAllValidPaths() override
+    {
+        PathSet paths;
+
+        for (auto & entry : readDirectory(binaryCacheDir)) {
+            if (entry.name.size() != 40 ||
+                !hasSuffix(entry.name, ".narinfo"))
+                continue;
+            paths.insert(settings.nixStore + "/" + entry.name.substr(0, entry.name.size() - 8));
+        }
+
+        return paths;
+    }
+
 };
 
 void LocalBinaryCacheStore::init()