From 638ce339a52da893693f667c8b330a2adefdd92a Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Thu, 1 Jul 2004 14:25:26 +0000 Subject: [PATCH] * Nix-instantiate now accepts sets of derivations (just like nix-env). --- src/nix-instantiate/main.cc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/nix-instantiate/main.cc b/src/nix-instantiate/main.cc index 5ef6bd7d1..0a533d4c7 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; } }