about summary refs log tree commit diff
path: root/src/libexpr/get-drvs.cc
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2012-11-26T16·39+0100
committerEelco Dolstra <eelco.dolstra@logicblox.com>2012-11-26T16·41+0100
commit408a7bfac1f4282ff6647696dfbc7988eed3a2ca (patch)
treeaf5c0c212e1a718240d855ef22930b7c1503d0cd /src/libexpr/get-drvs.cc
parent8d8d47abd2a66898aa5d8999fcd75b29991e529d (diff)
nix-instantiate: Fix read-only evaluation
Diffstat (limited to 'src/libexpr/get-drvs.cc')
-rw-r--r--src/libexpr/get-drvs.cc11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/libexpr/get-drvs.cc b/src/libexpr/get-drvs.cc
index f9e7dc6dbe3e..2ee55bdcaea0 100644
--- a/src/libexpr/get-drvs.cc
+++ b/src/libexpr/get-drvs.cc
@@ -28,6 +28,17 @@ string DrvInfo::queryOutPath(EvalState & state) const
 }
 
 
+string DrvInfo::queryOutputName(EvalState & state) const
+{
+    if (outputName == "" && attrs) {
+        Bindings::iterator i = attrs->find(state.sOutputName);
+        PathSet context;
+        (string &) outputName = i != attrs->end() ? state.coerceToString(*i->value, context) : "";
+    }
+    return outputName;
+}
+
+
 MetaInfo DrvInfo::queryMetaInfo(EvalState & state) const
 {
     if (metaInfoRead) return meta;