diff options
author | Eelco Dolstra <e.dolstra@tudelft.nl> | 2003-10-16T16·29+0000 |
---|---|---|
committer | Eelco Dolstra <e.dolstra@tudelft.nl> | 2003-10-16T16·29+0000 |
commit | 0791282b2f42313c94dd9bc85b24428e585cd099 (patch) | |
tree | 38cb57ffea3c700aeed5836afd7927369782d315 /src/fix.cc | |
parent | ab5e8767fafb2d62213e3f1558ead2882bc65c05 (diff) |
* Substitutes and nix-pull now work again.
* Fixed a segfault caused by the buffering of stderr. * Fix now allows the specification of the full output path. This should be used with great care, since it by-passes the normal hash generation. * Incremented the version number to 0.4 (prerelease).
Diffstat (limited to 'src/fix.cc')
-rw-r--r-- | src/fix.cc | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/fix.cc b/src/fix.cc index cbf759b31763..c1f9c1ad68d0 100644 --- a/src/fix.cc +++ b/src/fix.cc @@ -299,6 +299,7 @@ static Expr evalExpr2(EvalState & state, Expr e) ne.type = NixExpr::neDerivation; ne.derivation.platform = SYSTEM; string name; + Path outPath; Hash outHash; bool outHashGiven = false; bnds = ATempty; @@ -327,6 +328,7 @@ static Expr evalExpr2(EvalState & state, Expr e) if (key == "build") ne.derivation.builder = s; if (key == "name") name = s; + if (key == "outPath") outPath = s; if (key == "id") { outHash = parseHash(s); outHashGiven = true; @@ -343,11 +345,13 @@ static Expr evalExpr2(EvalState & state, Expr e) if (name == "") throw badTerm("no package name specified", e); - /* Hash the Nix expression with no outputs to produce a - unique but deterministic path name for this package. */ + /* Determine the output path. */ if (!outHashGiven) outHash = hashPackage(state, ne); - Path outPath = - canonPath(nixStore + "/" + ((string) outHash).c_str() + "-" + name); + if (outPath == "") + /* Hash the Nix expression with no outputs to produce a + unique but deterministic path name for this package. */ + outPath = + canonPath(nixStore + "/" + ((string) outHash).c_str() + "-" + name); ne.derivation.env["out"] = outPath; ne.derivation.outputs.insert(outPath); |