aboutsummaryrefslogtreecommitdiff
path: root/src/libcmd/installables.cc
diff options
context:
space:
mode:
authorThéophane Hufschmitt <7226587+thufschmitt@users.noreply.github.com>2023-03-02 19:20:51 +0100
committerGitHub <noreply@github.com>2023-03-02 19:20:51 +0100
commit1f394d2107fd2de511ab95516c1ea77f31a2baaa (patch)
treefefb6d3346fca06513744ffd42d34ff1add0ca14 /src/libcmd/installables.cc
parent639659dec22ed0016ce83dce79ff2aa46d83b0ab (diff)
parent3a2b3af82428dd691b1871243e44daeff9920fb4 (diff)
Merge branch 'master' into paths-from-stdin
Diffstat (limited to 'src/libcmd/installables.cc')
-rw-r--r--src/libcmd/installables.cc9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/libcmd/installables.cc b/src/libcmd/installables.cc
index a67841bb6..7d444aac0 100644
--- a/src/libcmd/installables.cc
+++ b/src/libcmd/installables.cc
@@ -677,9 +677,12 @@ StorePathSet Installable::toDerivations(
for (const auto & b : i->toDerivedPaths())
std::visit(overloaded {
[&](const DerivedPath::Opaque & bo) {
- if (!useDeriver)
- throw Error("argument '%s' did not evaluate to a derivation", i->what());
- drvPaths.insert(getDeriver(store, *i, bo.path));
+ drvPaths.insert(
+ bo.path.isDerivation()
+ ? bo.path
+ : useDeriver
+ ? getDeriver(store, *i, bo.path)
+ : throw Error("argument '%s' did not evaluate to a derivation", i->what()));
},
[&](const DerivedPath::Built & bfd) {
drvPaths.insert(bfd.drvPath);