about summary refs log tree commit diff
path: root/src/nix-instantiate
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2004-07-01T14·25+0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2004-07-01T14·25+0000
commit638ce339a52da893693f667c8b330a2adefdd92a (patch)
tree97aa1c4288ba50f19e058f5d965942079fd1599a /src/nix-instantiate
parent292d6468ec73212a2ada3bd5f7f3f6e897f9086e (diff)
* Nix-instantiate now accepts sets of derivations (just like nix-env).
Diffstat (limited to 'src/nix-instantiate')
-rw-r--r--src/nix-instantiate/main.cc9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/nix-instantiate/main.cc b/src/nix-instantiate/main.cc
index 5ef6bd7d1b8b..0a533d4c7751 100644
--- a/src/nix-instantiate/main.cc
+++ b/src/nix-instantiate/main.cc
@@ -30,6 +30,8 @@ static void printNixExpr(EvalState & state, Expr e)
     ATMatcher m;
     ATermList es;
 
+    /* !!! duplication w.r.t. parseDerivations in nix-env */
+
     if (atMatch(m, e) >> "Attrs" >> es) {
         Expr a = queryAttr(e, "type");
         if (a && evalString(state, a) == "derivation") {
@@ -38,6 +40,13 @@ static void printNixExpr(EvalState & state, Expr e)
                 cout << format("%1%\n") % evalPath(state, a);
                 return;
             }
+            throw Error("bad derivation");
+        } else {
+            ATermMap drvMap;
+            queryAllAttrs(e, drvMap);
+            for (ATermIterator i(drvMap.keys()); i; ++i)
+                printNixExpr(state, evalExpr(state, drvMap.get(*i)));
+            return;
         }
     }