about summary refs log tree commit diff
path: root/src/exec.cc
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2003-08-19T09·04+0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2003-08-19T09·04+0000
commit2de850479101e5a378c87d1392ea03c63ce224cf (patch)
tree4a7782e4ec3439cc73311d68e272546c486f9116 /src/exec.cc
parent31e4aa64396858e3b6ef8477397c84cbd80670fc (diff)
* Delete the temporary directories of failed builds by default, and an
  option `--keep-failed' to override this behaviour.

Diffstat (limited to 'src/exec.cc')
-rw-r--r--src/exec.cc6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/exec.cc b/src/exec.cc
index d82f5effaaea..fdfb467cca71 100644
--- a/src/exec.cc
+++ b/src/exec.cc
@@ -122,7 +122,11 @@ void runProgram(const string & program,
         throw Error("unable to wait for child");
     
     if (!WIFEXITED(status) || WEXITSTATUS(status) != 0) {
-        delTmpDir.cancel();
+	if (keepFailed) {
+	    msg(lvlTalkative, 
+		format("build failed; keeping build directory `%1%'") % tmpDir);
+	    delTmpDir.cancel();
+	}
         throw Error("unable to build package");
     }
 }