From: Mark Wooding Date: Sat, 13 Feb 2016 19:33:40 +0000 (+0000) Subject: bin/mdw-sbuild-server: Catch failures from parallel builds. X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~mdw/git/profile/commitdiff_plain/01c036af371dd8f24268aabe7d009974866c1be3 bin/mdw-sbuild-server: Catch failures from parallel builds. The way the log messages were interleaved made catching errors difficult. Do something more complicated to make it work properly. --- diff --git a/bin/mdw-sbuild-server b/bin/mdw-sbuild-server index a1355b8..26043e6 100755 --- a/bin/mdw-sbuild-server +++ b/bin/mdw-sbuild-server @@ -235,23 +235,36 @@ case "$#,$1" in DSC = $dsc FIRST = $first REST = $rest -SBUILD = t=\$@; sbuild \\ - --dist=\$\${t%-*} --arch=\$\${t\#*-} \\ - --chroot=\$@ --verbose -TAGLINES = \\ - while IFS= read -r line; do printf "%s: %s\n" "\$@" "\$\$line"; done +sbuild-wrap = \\ + t=\$@; \\ + { echo started >build-status.\$\$t; \\ + sbuild \\ + --dist=\$\${t%-*} --arch=\$\${t\#*-} \\ + --chroot=\$@ --verbose \$1 \$(DSC); \\ + rc=\$\$?; case \$\$rc in \\ + 0) echo ok >build-status.\$\$t ;; \\ + *) echo failed rc=\$\$rc >build-status.\$\$t ;; \\ + esac; } | \\ + while IFS= read -r line; do \\ + printf "%s: %s\n" "\$\$t" "\$\$line"; \\ + done; \\ + read st _ build-status.$i; done + ## And we're ready to go. mkfifo pipeout cat pipeout& catpid=$! set +e; make -fbuild.mk $parallel $makeopts -k all >pipeout rc=$?; set -e wait $! - rm build.mk pipeout + rm build.mk pipeout build-status.* find . -maxdepth 1 -type l -exec rm {} \; exit $rc ;;