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-02-07T18·22+0100
committerEelco Dolstra <edolstra@gmail.com>2017-02-07T18·29+0100
commitfa07558a069b974769e22ac944cfe21a69fb4485 (patch)
tree5456379ae95587db7766c14d31b2c313b09ee372 /src/libstore/store-api.cc
parentddb5577f2eb158279ee40219de409dcf1230aacc (diff)
Provide default implementations for a couple of Store methods
Diffstat (limited to 'src/libstore/store-api.cc')
-rw-r--r--src/libstore/store-api.cc13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/libstore/store-api.cc b/src/libstore/store-api.cc
index a42d118340..f98ba38406 100644
--- a/src/libstore/store-api.cc
+++ b/src/libstore/store-api.cc
@@ -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;