about summary refs log tree commit diff
path: root/src/libexpr/common-opts.cc
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2010-05-12T22·13+0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2010-05-12T22·13+0000
commitaa45027818af8976dc73e6a299d5d918e5c51df1 (patch)
tree6086eb0642bc90477397169d0ee3993c1789200e /src/libexpr/common-opts.cc
parenta0e3b84fac56cad6377ecd1462058a6b29bb1ea8 (diff)
parent8032f26ca0bd2233de066ce5786ff976bbd641ae (diff)
* Sync with the trunk.
Diffstat (limited to 'src/libexpr/common-opts.cc')
-rw-r--r--src/libexpr/common-opts.cc15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/libexpr/common-opts.cc b/src/libexpr/common-opts.cc
index 0ef488373614..5a4856568b4b 100644
--- a/src/libexpr/common-opts.cc
+++ b/src/libexpr/common-opts.cc
@@ -2,7 +2,6 @@
 #include "../libmain/shared.hh"
 #include "util.hh"
 #include "parser.hh"
-#include "aterm.hh"
 
 
 namespace nix {
@@ -10,7 +9,7 @@ namespace nix {
 
 bool parseOptionArg(const string & arg, Strings::iterator & i,
     const Strings::iterator & argsEnd, EvalState & state,
-    ATermMap & autoArgs)
+    Bindings & autoArgs)
 {
     if (arg != "--arg" && arg != "--argstr") return false;
 
@@ -20,11 +19,13 @@ bool parseOptionArg(const string & arg, Strings::iterator & i,
     string name = *i++;
     if (i == argsEnd) throw error;
     string value = *i++;
-    
-    Expr e = arg == "--arg"
-        ? parseExprFromString(state, value, absPath("."))
-        : makeStr(value);
-    autoArgs.set(toATerm(name), e);
+
+    Value & v(autoArgs[state.symbols.create(name)].value);
+
+    if (arg == "--arg")
+        state.mkThunk_( v, parseExprFromString(state, value, absPath(".")));
+    else
+        mkString(v, value);
     
     return true;
 }