about summary refs log tree commit diff
path: root/src/nix/log.cc
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2017-07-14T15·10+0200
committerEelco Dolstra <edolstra@gmail.com>2017-07-14T16·29+0200
commitfdc9da034fd7e0cb9c5275209d991ed6ca38f1cc (patch)
tree43b8592e523540b47c9b80e1bb0c83178c408437 /src/nix/log.cc
parent3908d3929ceb07cee5983fa647817f0e7aecbd97 (diff)
Avoid a call to derivationFromPath()
This doesn't work in read-only mode, ensuring that operations like

  nix path-info --store https://cache.nixos.org -S nixpkgs.hello

(asking for the closure size of nixpkgs.hello in cache.nixos.org) work
when nixpkgs.hello doesn't exist in the local store.
Diffstat (limited to '')
-rw-r--r--src/nix/log.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/nix/log.cc b/src/nix/log.cc
index ed610261d1..62ae6b8fac 100644
--- a/src/nix/log.cc
+++ b/src/nix/log.cc
@@ -28,7 +28,8 @@ struct CmdLog : InstallablesCommand
         subs.push_front(store);
 
         for (auto & inst : installables) {
-            for (auto & path : inst->toBuildable()) {
+            for (auto & b : inst->toBuildable()) {
+                auto path = b.second.drvPath != "" ? b.second.drvPath : b.first;
                 bool found = false;
                 for (auto & sub : subs) {
                     auto log = sub->getBuildLog(path);