aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2003-11-01 21:11:52 +0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2003-11-01 21:11:52 +0000
commit7de1b2a6980f71cfbf36f7250e247f6eafd763d9 (patch)
tree7f6a629abf4c5a9b4cf4a2b44ea9d6a9277829d6 /src
parent16104446712acf7e381039199eaf39dfa0fcea35 (diff)
* Print the exit code of the builder.
Diffstat (limited to 'src')
-rw-r--r--src/libnix/db.cc1
-rw-r--r--src/libnix/exec.cc12
2 files changed, 10 insertions, 3 deletions
diff --git a/src/libnix/db.cc b/src/libnix/db.cc
index 2f53ca3b5..c498fab74 100644
--- a/src/libnix/db.cc
+++ b/src/libnix/db.cc
@@ -251,7 +251,6 @@ void Database::close()
for (map<TableId, Db *>::iterator i = tables.begin();
i != tables.end(); i++)
{
- debug(format("closing table %1%") % i->first);
Db * db = i->second;
db->close(DB_NOSYNC);
delete db;
diff --git a/src/libnix/exec.cc b/src/libnix/exec.cc
index 4934712f9..00d9e6a0a 100644
--- a/src/libnix/exec.cc
+++ b/src/libnix/exec.cc
@@ -111,9 +111,17 @@ void runProgram(const string & program,
if (!WIFEXITED(status) || WEXITSTATUS(status) != 0) {
if (keepFailed) {
msg(lvlTalkative,
- format("build failed; keeping build directory `%1%'") % tmpDir);
+ format("program `%1%' failed; keeping build directory `%2%'")
+ % program % tmpDir);
delTmpDir.cancel();
}
- throw Error("unable to build package");
+ if (WIFEXITED(status))
+ throw Error(format("program `%1%' failed with exit code %2%")
+ % program % WEXITSTATUS(status));
+ else if (WIFSIGNALED(status))
+ throw Error(format("program `%1%' failed due to signal %2%")
+ % program % WTERMSIG(status));
+ else
+ throw Error(format("program `%1%' died abnormally") % program);
}
}