Skip to content
Snippets Groups Projects
Commit b69e4693 authored by Eelco Dolstra's avatar Eelco Dolstra
Browse files

* In `nix-env', look for derivations inside attribute sets that have

  the `recurseForDerivations' attribute set to `true'.
parent 49ce8b57
No related branches found
No related tags found
No related merge requests found
...@@ -55,6 +55,7 @@ Expr evalFile(EvalState & state, const Path & path); ...@@ -55,6 +55,7 @@ Expr evalFile(EvalState & state, const Path & path);
/* Specific results. */ /* Specific results. */
string evalString(EvalState & state, Expr e); string evalString(EvalState & state, Expr e);
Path evalPath(EvalState & state, Expr e); Path evalPath(EvalState & state, Expr e);
bool evalBool(EvalState & state, Expr e);
ATermList evalList(EvalState & state, Expr e); ATermList evalList(EvalState & state, Expr e);
ATerm coerceToString(Expr e); ATerm coerceToString(Expr e);
......
...@@ -171,7 +171,21 @@ static void getDerivations(EvalState & state, Expr e, ...@@ -171,7 +171,21 @@ static void getDerivations(EvalState & state, Expr e,
for (ATermIterator i(drvMap.keys()); i; ++i) { for (ATermIterator i(drvMap.keys()); i; ++i) {
startNest(nest, lvlDebug, startNest(nest, lvlDebug,
format("evaluating attribute `%1%'") % aterm2String(*i)); format("evaluating attribute `%1%'") % aterm2String(*i));
getDerivation(state, drvMap.get(*i), drvs, doneExprs); if (getDerivation(state, drvMap.get(*i), drvs, doneExprs)) {
/* If the value of this attribute is itself an
attribute self, should we recurse into it?
=> Only if it has a `recurseForDerivations = true'
attribute. */
ATermList es;
Expr e = evalExpr(state, drvMap.get(*i));
if (matchAttrs(e, es)) {
ATermMap attrs;
queryAllAttrs(e, attrs, false);
if (attrs.get("recurseForDerivations") &&
evalBool(state, attrs.get("recurseForDerivations")))
getDerivations(state, e, drvs, doneExprs, attrPathRest);
}
}
} }
} else { } else {
Expr e2 = drvMap.get(attr); Expr e2 = drvMap.get(attr);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment