From 932ea51c11f9a901d956551ef8d5f5a68be0c9b5 Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Thu, 18 May 2017 14:19:02 +0200 Subject: bin/build-packages: add option -x --- bin/build-packages | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/bin/build-packages b/bin/build-packages index 3b365c4..b960404 100755 --- a/bin/build-packages +++ b/bin/build-packages @@ -19,17 +19,19 @@ usage() { >&2 echo ' -n count: Build $count packages (if available), then exit.' >&2 echo ' $count=0 is interpreted as infinity.' >&2 echo ' The default is $count=1.' + >&2 echo ' -x: If package build fails, do not request new assignment(s).' [ -z "$1" ] && exit 1 || exit $1 } eval set -- "$( - getopt -o hn: \ + getopt -o hn:x \ --long help \ -n "$(basename "$0")" -- "$@" || \ echo usage )" count=1 +exit_after_failure=false while true do @@ -43,6 +45,9 @@ do [ ${count} -eq 0 ] && \ count=-1 ;; + -x) + exit_after_failure=true + ;; --) shift break @@ -121,6 +126,7 @@ while [ ${count} -ne 0 ]; do < 'package.tar' case $? in 0) + # upload successful break ;; 1) @@ -151,6 +157,10 @@ while [ ${count} -ne 0 ]; do -p "${master_build_server_port}" \ "${master_build_server_user}@${master_build_server}" \ 'return-assignment' "${package}" "${git_revision}" "${mod_git_revision}" "${repository}" 'ERROR' + if ${exit_after_failure}; then + >&2 echo 'Build failed, exiting now' + exit + fi fi continue -- cgit v1.2.3-70-g09d2