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.
This commit is contained in:
Eelco Dolstra 2017-07-14 17:10:13 +02:00
parent 3908d3929c
commit fdc9da034f
No known key found for this signature in database
GPG key ID: 8170B4726D7198DE
3 changed files with 29 additions and 28 deletions

View file

@ -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);