aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xbuild12
1 files changed, 10 insertions, 2 deletions
diff --git a/build b/build
index 59a48c8..dc612b7 100755
--- a/build
+++ b/build
@@ -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}"