aboutsummaryrefslogtreecommitdiff
path: root/src/libcmd
diff options
context:
space:
mode:
authorMatthew Bauer <mjbauer95@gmail.com>2021-04-21 15:26:14 -0500
committerMatthew Bauer <mjbauer95@gmail.com>2021-04-21 15:32:33 -0500
commit428062e578243336abeacb664bf3dba2674a546f (patch)
tree07d1e519c18d83197b3c61a612a06e0b87b7eb2b /src/libcmd
parent8d651a1f68c018b8a10dd37da81e9d3612073656 (diff)
Get deriver when passing --derivation
This makes Nix look up paths derivations when they are passed as a store paths. So: $ nix path-info --derivation /nix/store/0pisd259nldh8yfjvw663mspm60cn5v8-hello-2.10 now gives /nix/store/qp724w90516n4bk5r9gfb37vzmqdh3z7-hello-2.10.drv instead of "". If no deriver is available, Nix now errors instead of silently ignoring that argument.
Diffstat (limited to 'src/libcmd')
-rw-r--r--src/libcmd/installables.cc6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/libcmd/installables.cc b/src/libcmd/installables.cc
index e15addfae..06ef4c669 100644
--- a/src/libcmd/installables.cc
+++ b/src/libcmd/installables.cc
@@ -754,10 +754,8 @@ std::set<RealisedPath> toRealisedPaths(
if (mode == Realise::Nothing)
settings.readOnlyMode = true;
- for (auto & i : installables)
- for (auto & b : i->toDerivedPathsWithHints())
- if (auto bfd = std::get_if<DerivedPathWithHints::Built>(&b))
- res.insert(bfd->drvPath);
+ auto drvPaths = toDerivations(store, installables, true);
+ res.insert(drvPaths.begin(), drvPaths.end());
}
return res;