about summary refs log tree commit diff
path: root/src/libexpr/primops.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/libexpr/primops.cc')
-rw-r--r--src/libexpr/primops.cc21
1 files changed, 16 insertions, 5 deletions
diff --git a/src/libexpr/primops.cc b/src/libexpr/primops.cc
index 013eba594743..da9d1e635811 100644
--- a/src/libexpr/primops.cc
+++ b/src/libexpr/primops.cc
@@ -94,6 +94,7 @@ static void processBinding(EvalState & state, Expr e, Derivation & drv,
 
     else if (matchAttrs(e, es)) {
         Expr a = queryAttr(e, "type");
+        
         if (a && evalString(state, a) == "derivation") {
             a = queryAttr(e, "drvPath");
             if (!a) throw Error("derivation name missing");
@@ -104,12 +105,22 @@ static void processBinding(EvalState & state, Expr e, Derivation & drv,
             /* !!! supports only single output path */
             Path outPath = evalPath(state, a);
 
-            StringSet ids;
-            ids.insert("out");
-            drv.inputDrvs[drvPath] = ids;
+            drv.inputDrvs[drvPath] = singleton<StringSet>("out");
+            ss.push_back(outPath);
+        }
+
+        else if (a && evalString(state, a) == "storePath") {
+
+            a = queryAttr(e, "outPath");
+            if (!a) throw Error("output path missing");
+            /* !!! supports only single output path */
+            Path outPath = evalPath(state, a);
+
+            drv.inputSrcs.insert(outPath);
             ss.push_back(outPath);
-        } else
-            throw Error("invalid derivation attribute");
+        }
+
+        else throw Error("invalid derivation attribute");
     }
 
     else if (matchPath(e, s)) {