diff options
author | Erich Eckner <git@eckner.net> | 2019-06-20 09:23:32 +0200 |
---|---|---|
committer | Erich Eckner <git@eckner.net> | 2019-06-20 09:25:05 +0200 |
commit | 8e28653a9d8461183ec8ac9d32edcc8067c90e5a (patch) | |
tree | 2649928a7777c86b5e905035273946b51504a8ac | |
parent | acbdc2c9608d0ae0d2ea73bf5f5034cdd719a6fd (diff) | |
download | builder-8e28653a9d8461183ec8ac9d32edcc8067c90e5a.tar.xz |
bin/build-packages: download and check sources in a separate step
-rwxr-xr-x | bin/build-packages | 50 |
1 files changed, 31 insertions, 19 deletions
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" |