From 72a0182a63d504c21083cffbc4e53af8d48da506 Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Wed, 17 May 2017 11:22:37 +0200 Subject: bin/build-packages: handle failed uploads to the build master --- bin/build-packages | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) (limited to 'bin') diff --git a/bin/build-packages b/bin/build-packages index b265118..70676d5 100755 --- a/bin/build-packages +++ b/bin/build-packages @@ -7,8 +7,6 @@ # TODOs: # use different build commands for different repositories - do we need this actually? # send logs of failed builds -# handle failed uploads to the build master -# be more user friendly: let preset a limit on the number of packages being built . "${0%/*}/../conf/default.conf" @@ -107,17 +105,30 @@ while [ ${count} -ne 0 ]; do cd "${PKGBUILD%/*}" success=false for parameters in '' '-c'; do - rm -f *.pkg.tar.xz + rm -f *.pkg.tar.xz{,.sig} if staging-i486-build ${parameters}; then # build successful ls -1 *.pkg.tar.xz | \ xargs -rn1 gpg --detach-sign - tar -c *.pkg.tar.xz{,.sig} | \ + if ! tar -c *.pkg.tar.xz{,.sig} | \ ssh \ -i "${master_build_server_identity}" \ -p "${master_build_server_port}" \ "${master_build_server_user}@${master_build_server}" \ - 'return-assignment' "${package}" "${git_revision}" "${mod_git_revision}" "${repository}" + 'return-assignment' "${package}" "${git_revision}" "${mod_git_revision}" "${repository}"; then + case $? in + 1) + >&2 echo 'I was too slow, the package is outdated. I will continue ...' + ;; + 2) + >& echo "'return-assignment' reports a signature error." + exit 1 + ;; + *) + >&2 echo "unknown return code $? from 'return-assignment'" + exit 1 + esac + fi success=true break fi -- cgit v1.2.3-70-g09d2