diff options
author | Eelco Dolstra <e.dolstra@tudelft.nl> | 2006-07-28T16·03+0000 |
---|---|---|
committer | Eelco Dolstra <e.dolstra@tudelft.nl> | 2006-07-28T16·03+0000 |
commit | 4661282fde9f37780877fbeeb34b06b0c221e6bf (patch) | |
tree | 234537580ad8a9f51b0738cd990aa35c31247b54 /src/libexpr/get-drvs.cc | |
parent | c11839d7b24993f9639d59f9fa3420e8ccc22e02 (diff) |
* `nix-instantiate ... --arg NAME VALUE': allow arguments to be passed
to functions from the command line. * nix-build: started removing backticks.
Diffstat (limited to 'src/libexpr/get-drvs.cc')
-rw-r--r-- | src/libexpr/get-drvs.cc | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/libexpr/get-drvs.cc b/src/libexpr/get-drvs.cc index 0afc7bd6d186..07dd88e4c7b8 100644 --- a/src/libexpr/get-drvs.cc +++ b/src/libexpr/get-drvs.cc @@ -121,9 +121,10 @@ static string addToPath(const string & s1, const string & s2) static void getDerivations(EvalState & state, Expr e, - const string & pathPrefix, DrvInfos & drvs, Exprs & doneExprs) + const string & pathPrefix, const ATermMap & autoArgs, + DrvInfos & drvs, Exprs & doneExprs) { - e = evalExpr(state, autoCallFunction(evalExpr(state, e))); + e = evalExpr(state, autoCallFunction(evalExpr(state, e), autoArgs)); /* Process the expression. */ ATermList es; @@ -152,7 +153,7 @@ static void getDerivations(EvalState & state, Expr e, queryAllAttrs(e, attrs, false); Expr e2 = attrs.get(toATerm("recurseForDerivations")); if (e2 && evalBool(state, e2)) - getDerivations(state, e, pathPrefix2, drvs, doneExprs); + getDerivations(state, e, pathPrefix2, autoArgs, drvs, doneExprs); } } } @@ -167,7 +168,7 @@ static void getDerivations(EvalState & state, Expr e, format("evaluating list element")); string pathPrefix2 = addToPath(pathPrefix, (format("%1%") % n).str()); if (getDerivation(state, *i, pathPrefix2, drvs, doneExprs)) - getDerivations(state, *i, pathPrefix2, drvs, doneExprs); + getDerivations(state, *i, pathPrefix2, autoArgs, drvs, doneExprs); } return; } @@ -177,8 +178,8 @@ static void getDerivations(EvalState & state, Expr e, void getDerivations(EvalState & state, Expr e, const string & pathPrefix, - DrvInfos & drvs) + const ATermMap & autoArgs, DrvInfos & drvs) { Exprs doneExprs; - getDerivations(state, e, pathPrefix, drvs, doneExprs); + getDerivations(state, e, pathPrefix, autoArgs, drvs, doneExprs); } |