about summary refs log tree commit diff
path: root/src/nix-instantiate/nix-instantiate.cc
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2010-04-07T13·59+0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2010-04-07T13·59+0000
commit9a64454faae2ab4ccedeeaad85a0e094726b4765 (patch)
treeaaa6d45f3dcaeead309f86c10feb9c46b9f9d52b /src/nix-instantiate/nix-instantiate.cc
parentfc92244ba81d884e099d467a3b82fbdcbff7fc40 (diff)
* expr-to-xml -> value-to-xml.
Diffstat (limited to 'src/nix-instantiate/nix-instantiate.cc')
-rw-r--r--src/nix-instantiate/nix-instantiate.cc11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/nix-instantiate/nix-instantiate.cc b/src/nix-instantiate/nix-instantiate.cc
index 2f41fa81b513..ebf1be5b9649 100644
--- a/src/nix-instantiate/nix-instantiate.cc
+++ b/src/nix-instantiate/nix-instantiate.cc
@@ -7,7 +7,7 @@
 #include "parser.hh"
 #include "get-drvs.hh"
 #include "attr-path.hh"
-#include "expr-to-xml.hh"
+#include "value-to-xml.hh"
 #include "util.hh"
 #include "store-api.hh"
 #include "common-opts.hh"
@@ -75,10 +75,15 @@ void processExpr(EvalState & state, const Strings & attrPaths,
         std::cout << format("%1%\n") % canonicaliseExpr(e);
     else {
         Value v;
+        PathSet context;
         state.eval(e, v);
-        if (strict) state.strictForceValue(v);
         if (evalOnly)
-            std::cout << v << std::endl;
+            if (xmlOutput)
+                printValueAsXML(state, strict, v, std::cout, context);
+            else {
+                if (strict) state.strictForceValue(v);
+                std::cout << v << std::endl;
+            }
         else {
             DrvInfos drvs;
             getDerivations(state, v, "", autoArgs, drvs);