summaryrefslogtreecommitdiff
path: root/bin/build-packages
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2017-07-07 14:48:52 +0200
committerErich Eckner <git@eckner.net>2017-07-07 14:48:52 +0200
commitdd1cf581ca9d07b80bc9c0ff7b39bf5dcadfe682 (patch)
treebb8dce3327defec0f313143ac21d7a6fc74a0bf6 /bin/build-packages
parent34fce4bc2864aca33a5c5f86bf4b790ce79ed087 (diff)
downloadbuilder-dd1cf581ca9d07b80bc9c0ff7b39bf5dcadfe682.tar.xz
bin/build-packages: try with-build-support at some point if build fails
Diffstat (limited to 'bin/build-packages')
-rwxr-xr-xbin/build-packages123
1 files changed, 64 insertions, 59 deletions
diff --git a/bin/build-packages b/bin/build-packages
index 43ab26d..9c7e788 100755
--- a/bin/build-packages
+++ b/bin/build-packages
@@ -195,67 +195,72 @@ while [ ${count} -ne 0 ]; do
tar -xz --overwrite -f "${source_name}" --exclude PKGBUILD --strip-components=1 || true
fi
- for parameters in '' '-c'; do
- rm -f *".pkg.tar.xz" *".pkg.tar.xz.sig"
-
- >&2 printf 'building package "%s" ...' "${package}"
- # by piping the log, we don't see anything in the terminal,
- # but all ways to duplicate the logs seem pretty elaborate
- if staging-i686-build ${parameters} > \
- "$(
- date -u --iso-8601=seconds | \
- cut -d+ -f1
- ).build-log" 2>&1; then
- # build successful
- >&2 printf ' ok.\n'
- ls -1 *.pkg.tar.xz | \
- xargs -rn1 gpg --local-user="${package_key}" --detach-sign || \
- bail_out
- tar -cf 'package.tar' $(
- ls -1 | \
- grep '\.pkg\.tar\.xz\(\.sig\)\?$' | \
- grep -v -- '-debug-'
- ) || \
- bail_out
- while true; do
- err=0
- 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}" \
- < 'package.tar' || \
- err=$?
- case ${err} in
- 0)
- # upload successful
- break
- ;;
- 1)
- >&2 echo '"return-assignment" was running already.'
- wait_some_time 15
- ;;
- 2)
- >&2 echo 'I was too slow, the package is outdated. I will continue ...'
- break
- ;;
- 3)
- >&2 echo "'return-assignment' reports a signature error."
- bail_out 1
- ;;
- 4)
- >&2 echo "'return-assignment' reports too many or missing packages."
- bail_out 1
- ;;
- *)
- >&2 echo "unknown return code ${err} from 'return-assignment'"
- bail_out 1
- esac
- done
- success=true
+ for build_command in 'staging-i686-build' 'staging-with-build-support-i686-build'; do
+ for parameters in '' '-c'; do
+ rm -f *".pkg.tar.xz" *".pkg.tar.xz.sig"
+
+ >&2 printf 'building package "%s" ...' "${package}"
+ # by piping the log, we don't see anything in the terminal,
+ # but all ways to duplicate the logs seem pretty elaborate
+ if "${build_command}" ${parameters} > \
+ "$(
+ date -u --iso-8601=seconds | \
+ cut -d+ -f1
+ ).build-log" 2>&1; then
+ # build successful
+ >&2 printf ' ok.\n'
+ ls -1 *.pkg.tar.xz | \
+ xargs -rn1 gpg --local-user="${package_key}" --detach-sign || \
+ bail_out
+ tar -cf 'package.tar' $(
+ ls -1 | \
+ grep '\.pkg\.tar\.xz\(\.sig\)\?$' | \
+ grep -v -- '-debug-'
+ ) || \
+ bail_out
+ while true; do
+ err=0
+ 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}" \
+ < 'package.tar' || \
+ err=$?
+ case ${err} in
+ 0)
+ # upload successful
+ break
+ ;;
+ 1)
+ >&2 echo '"return-assignment" was running already.'
+ wait_some_time 15
+ ;;
+ 2)
+ >&2 echo 'I was too slow, the package is outdated. I will continue ...'
+ break
+ ;;
+ 3)
+ >&2 echo "'return-assignment' reports a signature error."
+ bail_out 1
+ ;;
+ 4)
+ >&2 echo "'return-assignment' reports too many or missing packages."
+ bail_out 1
+ ;;
+ *)
+ >&2 echo "unknown return code ${err} from 'return-assignment'"
+ bail_out 1
+ esac
+ done
+ success=true
+ break
+ fi
+ >&2 printf ' failed.\n'
+ done
+ if ${success}; then
break
fi
- >&2 printf ' failed.\n'
done
if ${success}; then
break