From b1d4c528c2c339b78ccb8f107dd4ce270b5466c7 Mon Sep 17 00:00:00 2001 From: Mark Feit Date: Thu, 12 Oct 2023 19:04:26 +0000 Subject: [PATCH] Check build exit status and return that instead of blindly succeeding. --- build | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/build b/build index e06066d..35a99ff 100755 --- a/build +++ b/build @@ -166,4 +166,17 @@ ${ECHO} ${SUDO} docker run \ || STATUS=$? # Docker exits with a 130 when systemd is stopped with SIGINT (halt). +# Anything else was a container problem, not a result of the build. [ $STATUS -eq 0 -o $STATUS -eq 130 ] || false + +# Check on the status of the build +STATUS_FILE="${BUILD_DIR}/DOSB/status" + +[ -e "${STATUS_FILE}" ] || die "Build produced no status." + +BUILD_STATUS=$(cat "${STATUS_FILE}") +if [ "${BUILD_STATUS}" -ne 0 ] +then + echo "Build failed" 1>&2 + exit "${BUILD_STATUS}" +fi