From 8e28653a9d8461183ec8ac9d32edcc8067c90e5a Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Thu, 20 Jun 2019 09:23:32 +0200 Subject: bin/build-packages: download and check sources in a separate step --- bin/build-packages | 50 +++++++++++++++++++++++++++++++------------------- 1 file changed, 31 insertions(+), 19 deletions(-) (limited to 'bin/build-packages') diff --git a/bin/build-packages b/bin/build-packages index 2a87beb..1ed51d6 100755 --- a/bin/build-packages +++ b/bin/build-packages @@ -549,23 +549,36 @@ while [ "${count}" -ne 0 ] && \ find . -maxdepth 1 -type f \( -name '*.pkg.tar.xz' -o -name '*.pkg.tar.xz.sig' \) -exec \ rm {} \; - echo 'building' > "${tmp_dir}/.ping-build-master" - >&2 printf '%s: building package "%s" (revisions %s %s, repository %s, straw %s) for %s ...' \ - "$(date +'%Y-%m-%d %T')" \ - "${package}" \ - "${git_revision}" \ - "${mod_git_revision}" \ - "${repository}" \ - "${straw}" \ - "${arch}" - # by piping the log, we don't see anything in the terminal, - # but all ways to duplicate the logs seem pretty elaborate - # shellcheck disable=SC2024,SC2086 - if "${build_command}" ${outerParameters} -- ${middleParameters} -- ${innerParameters} > \ - "$( - date -u --iso-8601=seconds | \ - cut -d+ -f1 - ).build-log" 2>&1; then + success=true + + echo 'checking-source' > "${tmp_dir}/.ping-build-master" + if ! CARCH="${arch}" makepkg --verifysource; then + success=false + fi + + if ${success}; then + echo 'building' > "${tmp_dir}/.ping-build-master" + >&2 printf '%s: building package "%s" (revisions %s %s, repository %s, straw %s) for %s ...' \ + "$(date +'%Y-%m-%d %T')" \ + "${package}" \ + "${git_revision}" \ + "${mod_git_revision}" \ + "${repository}" \ + "${straw}" \ + "${arch}" + # by piping the log, we don't see anything in the terminal, + # but all ways to duplicate the logs seem pretty elaborate + # shellcheck disable=SC2024,SC2086 + if ! "${build_command}" ${outerParameters} -- ${middleParameters} -- ${innerParameters} > \ + "$( + date -u --iso-8601=seconds | \ + cut -d+ -f1 + ).build-log" 2>&1; then + success=false + fi + fi + + if ${success}; then # build successful >&2 printf ' ok.\n' if [ "${build_command}" = 'makepkg' ]; then @@ -654,7 +667,7 @@ while [ "${count}" -ne 0 ] && \ mkdir "${package_content_dir}/${pkgfile##*/}" tar -C "${package_content_dir}/${pkgfile##*/}" -xJf "${pkgfile}" 2>/dev/null # we rely on "${checksum}" not appearing in any objdump output - : ${checksum?umm, checksum is unset - this will break below sed-fu} + : "${checksum?umm, checksum is unset - this will break below sed-fu}" # TODO: symbols may be in object files _inside_archives_ # In that case, we're interested in the object file's name, # not the archive's file name @@ -866,7 +879,6 @@ while [ "${count}" -ne 0 ] && \ exit ${err} esac done - success=true break fi echo 'failure' > "${tmp_dir}/.ping-build-master" -- cgit v1.2.3-54-g00ecf