aboutsummaryrefslogtreecommitdiff
path: root/src/libexpr/primops.cc
diff options
context:
space:
mode:
authorShea Levy <shea@shealevy.com>2015-07-23 09:48:03 -0400
committerEelco Dolstra <eelco.dolstra@logicblox.com>2015-07-23 17:04:07 +0200
commit39e27a04b8d1fc8251128b1f9f8f152b8c8a9b68 (patch)
tree0f9b47e38fbc40e0595dffe31c41611f709e3f6a /src/libexpr/primops.cc
parent1ed55234d9efce7d40c97ef1215090015d18498c (diff)
Importing derivations: Add name attribute to make a valid drv
Diffstat (limited to 'src/libexpr/primops.cc')
-rw-r--r--src/libexpr/primops.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/libexpr/primops.cc b/src/libexpr/primops.cc
index f555de73e..dd21bdc57 100644
--- a/src/libexpr/primops.cc
+++ b/src/libexpr/primops.cc
@@ -86,9 +86,11 @@ static void prim_scopedImport(EvalState & state, const Pos & pos, Value * * args
if (isStorePath(path) && store->isValidPath(path) && isDerivation(path)) {
Derivation drv = readDerivation(path);
Value & w = *state.allocValue();
- state.mkAttrs(w, 2 + drv.outputs.size());
+ state.mkAttrs(w, 3 + drv.outputs.size());
Value * v2 = state.allocAttr(w, state.sDrvPath);
mkString(*v2, path, singleton<PathSet>("=" + path));
+ v2 = state.allocAttr(w, state.sName);
+ mkString(*v2, drv.env["name"]);
Value * outputsVal =
state.allocAttr(w, state.symbols.create("outputs"));
state.mkList(*outputsVal, drv.outputs.size());