From b69e4693287d481ee75f948227a2c508391ef055 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Thu, 23 Mar 2006 16:43:07 +0000 Subject: * In `nix-env', look for derivations inside attribute sets that have the `recurseForDerivations' attribute set to `true'. --- src/libexpr/get-drvs.cc | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'src/libexpr/get-drvs.cc') diff --git a/src/libexpr/get-drvs.cc b/src/libexpr/get-drvs.cc index ff38ff794812..78edbd392d19 100644 --- a/src/libexpr/get-drvs.cc +++ b/src/libexpr/get-drvs.cc @@ -171,7 +171,21 @@ static void getDerivations(EvalState & state, Expr e, for (ATermIterator i(drvMap.keys()); i; ++i) { startNest(nest, lvlDebug, 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 { Expr e2 = drvMap.get(attr); -- cgit 1.4.1