about summary refs log tree commit diff
path: root/src/libstore/local-fs-store.cc
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2017-03-13T13·07+0100
committerEelco Dolstra <edolstra@gmail.com>2017-03-15T15·48+0100
commit532d73d5d86c3d25d08a8d771a189708dac323e2 (patch)
treedc91152a6d74de4e928ee263b4bc1047c3bdba4a /src/libstore/local-fs-store.cc
parent5b86451f0279c384fb379fed9d2979d8025aa269 (diff)
BinaryCacheStore: Implement getBuildLog()
We assume that build logs are stored under log/<drv>, e.g.

  /nix/store/q7ab198v13p0f8x8wgnd75dva7d5mip6-friday-devil-0.1.1.1.drv

maps to

  https://cache.nixos.org/log/q7ab198v13p0f8x8wgnd75dva7d5mip6-friday-devil-0.1.1.1.drv
Diffstat (limited to 'src/libstore/local-fs-store.cc')
-rw-r--r--src/libstore/local-fs-store.cc6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/libstore/local-fs-store.cc b/src/libstore/local-fs-store.cc
index c5da73dba36c..002ee4a65ce2 100644
--- a/src/libstore/local-fs-store.cc
+++ b/src/libstore/local-fs-store.cc
@@ -95,7 +95,11 @@ std::shared_ptr<std::string> LocalFSStore::getBuildLog(const Path & path_)
     assertStorePath(path);
 
     if (!isDerivation(path)) {
-        path = queryPathInfo(path)->deriver;
+        try {
+            path = queryPathInfo(path)->deriver;
+        } catch (InvalidPath &) {
+            return nullptr;
+        }
         if (path == "") return nullptr;
     }