diff options
author | Mark Ferrell <major@homeonderanged.org> | 2014-01-15 10:02:10 -0800 |
---|---|---|
committer | Mark Ferrell <major@homeonderanged.org> | 2014-01-15 10:02:10 -0800 |
commit | 23f0fc4e6fc8c3aa6d497eeeec1158881c05573b (patch) | |
tree | cff2cb2f44ee51298a94214dac682eb38e368bb4 | |
parent | 539129f44f0adf7d8c20875daacc3b3e33d58fdb (diff) |
Properly capture the exit status
* We use the 'tee' command to capture our output to the builder.log. The
problem is that 'tee' discards the exit status. Added a wrapper function to
capture the exit status and handed the output from the function to 'tee'.
* Fixes #52
-rwxr-xr-x | build | 12 |
1 files changed, 10 insertions, 2 deletions
@@ -358,5 +358,13 @@ done set -- ${packages} unset packages -# exec out to make with the appropriate Makefile -make ${MAKE_OPTS} -r -f "${BUILDER_MAKEFILE}" "${@}" 2>&1 | tee "${BUILDER_TMPDIR}/builder.log" +# The 'tee' command will discard the exit status from 'make', so we capture it +# via a wrapper function so we can exit properly. +build_make() +{ + BUILD_EXIT='0' + make -r -f "${BUILDER_MAKEFILE}" "${@}" + BUILD_EXIT="$?" +} +build_make "${@}" 2>&1 | tee "${BUILDER_TMPDIR}/builder.log" +exit "${BUILD_EXIT}" |