diff options
author | Eelco Dolstra <e.dolstra@tudelft.nl> | 2010-03-31T15·38+0000 |
---|---|---|
committer | Eelco Dolstra <e.dolstra@tudelft.nl> | 2010-03-31T15·38+0000 |
commit | 3d94be61ea562dea2098b6570f711386179913ef (patch) | |
tree | 9afd60cf782d5824efc4bafba98af1ee6af937f4 /src/nix-instantiate | |
parent | 51876789131e81dca9807c00773158160c3824c2 (diff) |
* Implemented derivations.
Diffstat (limited to 'src/nix-instantiate')
-rw-r--r-- | src/nix-instantiate/nix-instantiate.cc | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/src/nix-instantiate/nix-instantiate.cc b/src/nix-instantiate/nix-instantiate.cc index 86bb1841b9a0..a71998de24d3 100644 --- a/src/nix-instantiate/nix-instantiate.cc +++ b/src/nix-instantiate/nix-instantiate.cc @@ -75,8 +75,23 @@ void processExpr(EvalState & state, const Strings & attrPaths, std::cout << format("%1%\n") % canonicaliseExpr(e); else { Value v; - state.strictEval(e, v); - std::cout << v << std::endl; + if (strict) state.strictEval(e, v); else state.eval(e, v); + if (evalOnly) + std::cout << v << std::endl; + else { + DrvInfos drvs; + getDerivations(state, v, "", autoArgs, drvs); + foreach (DrvInfos::iterator, i, drvs) { + Path drvPath = i->queryDrvPath(state); + if (gcRoot == "") + printGCWarning(); + else + drvPath = addPermRoot(drvPath, + makeRootName(gcRoot, rootNr), + indirectRoot); + std::cout << format("%1%\n") % drvPath; + } + } } #if 0 |