about summary refs log tree commit diff
path: root/src/libexpr
diff options
context:
space:
mode:
authorShea Levy <shea@shealevy.com>2011-09-16T11·30+0000
committerShea Levy <shea@shealevy.com>2011-09-16T11·30+0000
commitbf50d6ad3271aaa6ac93b68e99f5acb1d9a158c7 (patch)
tree74aec589a79a88afc932188138feff67a0c95b2d /src/libexpr
parentffa038f66dc0dfcfaf16c523830490bb606af04c (diff)
Add information about which output is active to drvPath's context
This will break things that depend on being able to just strip away an equals sign, so those have to be updated next
Diffstat (limited to 'src/libexpr')
-rw-r--r--src/libexpr/primops.cc10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/libexpr/primops.cc b/src/libexpr/primops.cc
index 121dbca9b36a..a752b9a5963e 100644
--- a/src/libexpr/primops.cc
+++ b/src/libexpr/primops.cc
@@ -455,8 +455,8 @@ static void prim_derivationStrict(EvalState & state, Value * * args, Value & v)
     drvHashes[drvPath] = hashDerivationModulo(*store, drv);
 
     state.mkAttrs(v, 1 + drv.outputs.size());
-    mkString(*state.allocAttr(v, state.sDrvPath), drvPath, singleton<PathSet>("=" + drvPath));
     foreach (DerivationOutputs::iterator, i, drv.outputs) {
+        mkString(*state.allocAttr(v, state.symbols.create(i->first + "DrvPath")), drvPath, singleton<PathSet>("=" + i->first + "=" + drvPath));
         /* The output path of an output X is ‘<X>Path’,
            e.g. ‘outPath’. */
         mkString(*state.allocAttr(v, state.symbols.create(i->first + "Path")),
@@ -1111,11 +1111,13 @@ void EvalState::createBaseEnv()
         attrValues = attrs: \
           map (name: builtins.getAttr name attrs) (builtins.attrNames attrs); \
         outputToAttrListElement = output: \
-          let outPath = builtins.getAttr (output + \"Path\") strict; in { \
+          let \
+            outPath = builtins.getAttr (output + \"Path\") strict; \
+            drvPath = builtins.getAttr (output + \"DrvPath\") strict; \
+          in { \
             name = output; \
             value = attrs // { \
-              drvPath = strict.drvPath; \
-              inherit outPath; \
+              inherit outPath drvPath; \
               type = \"derivation\"; \
               currentOutput = output; \
             } // outputsAttrs // { all = allList; }; \