diff options
author | Eelco Dolstra <e.dolstra@tudelft.nl> | 2004-07-01 14:25:26 +0000 |
---|---|---|
committer | Eelco Dolstra <e.dolstra@tudelft.nl> | 2004-07-01 14:25:26 +0000 |
commit | 638ce339a52da893693f667c8b330a2adefdd92a (patch) | |
tree | 97aa1c4288ba50f19e058f5d965942079fd1599a /src | |
parent | 292d6468ec73212a2ada3bd5f7f3f6e897f9086e (diff) | |
download | guix-638ce339a52da893693f667c8b330a2adefdd92a.tar.gz |
* Nix-instantiate now accepts sets of derivations (just like nix-env).
Diffstat (limited to 'src')
-rw-r--r-- | src/nix-instantiate/main.cc | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/nix-instantiate/main.cc b/src/nix-instantiate/main.cc index 5ef6bd7d1b..0a533d4c77 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; } } |