about summary refs log tree commit diff
path: root/src/libstore/store-api.cc
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2017-05-01T11·43+0200
committerEelco Dolstra <edolstra@gmail.com>2017-05-01T11·43+0200
commit0dddcf867a65723ddf96343dd694f970f2f9538a (patch)
tree5854dbe3300cc1f5fc21b8182fa612ef34632053 /src/libstore/store-api.cc
parentb0b81b75001d06fc38fc187969089a068ddf2ed2 (diff)
Add a dummy Store::buildPaths() method
This default implementation of buildPaths() does nothing if all
requested paths are already valid, and throws an "unsupported
operation" error otherwise. This fixes a regression introduced by
c30330df6f67c81986dfb124631bc756c8e58c0d in binary cache and legacy
SSH stores.
Diffstat (limited to 'src/libstore/store-api.cc')
-rw-r--r--src/libstore/store-api.cc11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/libstore/store-api.cc b/src/libstore/store-api.cc
index 835bbb90e0bb..850ea211dd50 100644
--- a/src/libstore/store-api.cc
+++ b/src/libstore/store-api.cc
@@ -523,6 +523,17 @@ const Store::Stats & Store::getStats()
 }
 
 
+void Store::buildPaths(const PathSet & paths, BuildMode buildMode)
+{
+    for (auto & path : paths)
+        if (isDerivation(path))
+            unsupported();
+
+    if (queryValidPaths(paths).size() != paths.size())
+        unsupported();
+}
+
+
 void copyStorePath(ref<Store> srcStore, ref<Store> dstStore,
     const Path & storePath, bool repair, bool dontCheckSigs)
 {