From fdc9da034fd7e0cb9c5275209d991ed6ca38f1cc Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Fri, 14 Jul 2017 17:10:13 +0200 Subject: 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. --- src/nix/log.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/nix/log.cc') diff --git a/src/nix/log.cc b/src/nix/log.cc index ed610261d..62ae6b8fa 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); -- cgit v1.2.3