about summary refs log tree commit diff
path: root/src/libstore/build.cc
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2012-05-29T20·42-0400
committerEelco Dolstra <eelco.dolstra@logicblox.com>2012-05-29T20·42-0400
commit2c26985835cf82ed5d2979c3a400f72f6aeba32f (patch)
tree364273cc2613dab8ab578c7cb27e468dcfbe9f86 /src/libstore/build.cc
parent8058dab26e90db54708d4c698db843dd703ecbb2 (diff)
Add option ‘build-keep-log’ to enable/disable writing of build logs
Fixes #26.
Diffstat (limited to 'src/libstore/build.cc')
-rw-r--r--src/libstore/build.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/libstore/build.cc b/src/libstore/build.cc
index 789a7f617c2c..985ea5e98e05 100644
--- a/src/libstore/build.cc
+++ b/src/libstore/build.cc
@@ -2032,6 +2032,8 @@ string drvsLogDir = "drvs";
 
 Path DerivationGoal::openLogFile()
 {
+    if (!queryBoolSetting("build-keep-log", true)) return "";
+    
     /* Create a log file. */
     Path dir = (format("%1%/%2%") % nixLogDir % drvsLogDir).str();
     createDirs(dir);
@@ -2071,7 +2073,8 @@ void DerivationGoal::handleChildOutput(int fd, const string & data)
     {
         if (verbosity >= buildVerbosity)
             writeToStderr((unsigned char *) data.data(), data.size());
-        writeFull(fdLogFile, (unsigned char *) data.data(), data.size());
+        if (fdLogFile != -1)
+            writeFull(fdLogFile, (unsigned char *) data.data(), data.size());
     }
 
     if (hook && fd == hook->fromHook.readSide)