Browse Source

bin/build-packages: download and check sources in a separate step

Erich Eckner 3 months ago
parent
commit
8e28653a9d
1 changed files with 31 additions and 19 deletions
  1. 31
    19
      bin/build-packages

+ 31
- 19
bin/build-packages View File

@@ -549,23 +549,36 @@ while [ "${count}" -ne 0 ] && \
549 549
         find . -maxdepth 1 -type f \( -name '*.pkg.tar.xz' -o -name '*.pkg.tar.xz.sig' \) -exec \
550 550
           rm {} \;
551 551
 
552
-        echo 'building' > "${tmp_dir}/.ping-build-master"
553
-        >&2 printf '%s: building package "%s" (revisions %s %s, repository %s, straw %s) for %s ...' \
554
-          "$(date +'%Y-%m-%d %T')" \
555
-          "${package}" \
556
-          "${git_revision}" \
557
-          "${mod_git_revision}" \
558
-          "${repository}" \
559
-          "${straw}" \
560
-          "${arch}"
561
-        # by piping the log, we don't see anything in the terminal,
562
-        # but all ways to duplicate the logs seem pretty elaborate
563
-        # shellcheck disable=SC2024,SC2086
564
-        if "${build_command}" ${outerParameters} -- ${middleParameters} -- ${innerParameters} > \
565
-          "$(
566
-            date -u --iso-8601=seconds | \
567
-              cut -d+ -f1
568
-          ).build-log" 2>&1; then
552
+        success=true
553
+
554
+        echo 'checking-source' > "${tmp_dir}/.ping-build-master"
555
+        if ! CARCH="${arch}" makepkg --verifysource; then
556
+          success=false
557
+        fi
558
+
559
+        if ${success}; then
560
+          echo 'building' > "${tmp_dir}/.ping-build-master"
561
+          >&2 printf '%s: building package "%s" (revisions %s %s, repository %s, straw %s) for %s ...' \
562
+            "$(date +'%Y-%m-%d %T')" \
563
+            "${package}" \
564
+            "${git_revision}" \
565
+            "${mod_git_revision}" \
566
+            "${repository}" \
567
+            "${straw}" \
568
+            "${arch}"
569
+          # by piping the log, we don't see anything in the terminal,
570
+          # but all ways to duplicate the logs seem pretty elaborate
571
+          # shellcheck disable=SC2024,SC2086
572
+          if ! "${build_command}" ${outerParameters} -- ${middleParameters} -- ${innerParameters} > \
573
+            "$(
574
+              date -u --iso-8601=seconds | \
575
+                cut -d+ -f1
576
+            ).build-log" 2>&1; then
577
+            success=false
578
+          fi
579
+        fi
580
+
581
+        if ${success}; then
569 582
           # build successful
570 583
           >&2 printf ' ok.\n'
571 584
           if [ "${build_command}" = 'makepkg' ]; then
@@ -654,7 +667,7 @@ while [ "${count}" -ne 0 ] && \
654 667
                 mkdir "${package_content_dir}/${pkgfile##*/}"
655 668
                 tar -C "${package_content_dir}/${pkgfile##*/}" -xJf "${pkgfile}" 2>/dev/null
656 669
                 # we rely on "${checksum}" not appearing in any objdump output
657
-                : ${checksum?umm, checksum is unset - this will break below sed-fu}
670
+                : "${checksum?umm, checksum is unset - this will break below sed-fu}"
658 671
                 # TODO: symbols may be in object files _inside_archives_
659 672
                 # In that case, we're interested in the object file's name,
660 673
                 # not the archive's file name
@@ -866,7 +879,6 @@ while [ "${count}" -ne 0 ] && \
866 879
                 exit ${err}
867 880
             esac
868 881
           done
869
-          success=true
870 882
           break
871 883
         fi
872 884
         echo 'failure' > "${tmp_dir}/.ping-build-master"