From fa07558a069b974769e22ac944cfe21a69fb4485 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Tue, 7 Feb 2017 19:22:48 +0100 Subject: Provide default implementations for a couple of Store methods --- src/libstore/store-api.cc | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/libstore/store-api.cc') diff --git a/src/libstore/store-api.cc b/src/libstore/store-api.cc index a42d11834053..f98ba38406d1 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 Store::queryPathInfo(const Path & storePath) { std::promise> promise; -- cgit 1.4.1