diff options
author | Eelco Dolstra <e.dolstra@tudelft.nl> | 2005-03-24T17·46+0000 |
---|---|---|
committer | Eelco Dolstra <e.dolstra@tudelft.nl> | 2005-03-24T17·46+0000 |
commit | c6178f0b038097584cbbac970ebdb3772de27763 (patch) | |
tree | f1786c81a1db945ed4f126fc114af62518cc74cd /src/libstore/build.cc | |
parent | d1487d9015222c33680c7727c31e3b499c620610 (diff) |
* Create missing log and temproots directories automatically (reported
by Rob).
Diffstat (limited to 'src/libstore/build.cc')
-rw-r--r-- | src/libstore/build.cc | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/libstore/build.cc b/src/libstore/build.cc index fd104dffd977..4c03da3e2c39 100644 --- a/src/libstore/build.cc +++ b/src/libstore/build.cc @@ -1211,10 +1211,16 @@ void DerivationGoal::computeClosure() } +static string drvsLogDir = "drvs"; + + void DerivationGoal::openLogFile() { /* Create a log file. */ - Path logFileName = nixLogDir + "/drvs/" + baseNameOf(drvPath); + Path dir = (format("%1%/%2%") % nixLogDir % drvsLogDir).str(); + createDirs(dir); + + Path logFileName = (format("%1%/%2%") % dir % baseNameOf(drvPath)).str(); fdLogFile = open(logFileName.c_str(), O_CREAT | O_WRONLY | O_TRUNC, 0666); if (fdLogFile == -1) |