aboutsummaryrefslogtreecommitdiff
path: root/src/libexpr
diff options
context:
space:
mode:
authorShea Levy <shea@shealevy.com>2011-11-06 06:28:20 +0000
committerShea Levy <shea@shealevy.com>2011-11-06 06:28:20 +0000
commitaf2e53fd481994cca46b9c003a6a8eae50cf951c (patch)
treea48f614d74b2e5c1e9b9fa91a6f8481f8d874f35 /src/libexpr
parent981edeab7b6b415c71d3421da6967ec7fc232e54 (diff)
Include all outputs of derivations in the closure of explicitly-passed derivation paths
This required adding a queryOutputDerivationNames function in the store API
Diffstat (limited to 'src/libexpr')
-rw-r--r--src/libexpr/primops.cc10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/libexpr/primops.cc b/src/libexpr/primops.cc
index 2a3f1e2c3..ce0b9e8b0 100644
--- a/src/libexpr/primops.cc
+++ b/src/libexpr/primops.cc
@@ -347,6 +347,7 @@ static void prim_derivationStrict(EvalState & state, Value * * args, Value & v)
derivation. */
foreach (PathSet::iterator, i, context) {
Path path = *i;
+ bool explicitlyPassed = false;
/* Paths marked with `=' denote that the path of a derivation
is explicitly passed to the builder. Since that allows the
@@ -361,8 +362,10 @@ static void prim_derivationStrict(EvalState & state, Value * * args, Value & v)
foreach (PathSet::iterator, j, refs) {
drv.inputSrcs.insert(*j);
if (isDerivation(*j))
- drv.inputDrvs[*j] = singleton<StringSet>("out");
+ drv.inputDrvs[*j] = store -> queryDerivationOutputNames(*j);
}
+
+ explicitlyPassed = true;
}
/* See prim_unsafeDiscardOutputDependency. */
@@ -376,7 +379,10 @@ static void prim_derivationStrict(EvalState & state, Value * * args, Value & v)
debug(format("derivation uses `%1%'") % path);
if (!useDrvAsSrc && isDerivation(path))
- drv.inputDrvs[path] = singleton<StringSet>("out");
+ if (explicitlyPassed)
+ drv.inputDrvs[path] = store -> queryDerivationOutputNames(path);
+ else
+ drv.inputDrvs[path] = singleton<StringSet>("out");
else
drv.inputSrcs.insert(path);
}