Browse Source

bin/build-packages: clean up mess with verifysource.log: give it a proper name from the start

Erich Eckner 3 months ago
parent
commit
3741a72e96
1 changed files with 5 additions and 13 deletions
  1. 5
    13
      bin/build-packages

+ 5
- 13
bin/build-packages View File

@@ -494,13 +494,11 @@ while [ "${count}" -ne 0 ] && \
494 494
         verifysource_trial=0
495 495
         while [ ${verifysource_trial} -lt 5 ]; do
496 496
           verifysource_trial=$((verifysource_trial + 1))
497
-          mv \
498
-            "${tmp_dir}/verifysource.log" \
499
-            "$(
497
+          log_file="${tmp_dir}/$(
500 498
               date -u --iso-8601=seconds | \
501 499
                 cut -d+ -f1
502
-            ).build-log" 2>/dev/null || true
503
-          if CARCH="${arch}" makepkg --verifysource 2> "${tmp_dir}/verifysource.log"; then
500
+            ).build-log"
501
+          if CARCH="${arch}" makepkg --verifysource 2> "${log_file}"; then
504 502
             success=true
505 503
             break
506 504
           fi
@@ -512,7 +510,7 @@ while [ "${count}" -ne 0 ] && \
512 510
                 s/^.* FAILED (unknown public key \([0-9A-F]\{16\}\)).*$/0x\1/
513 511
                 T
514 512
                 p
515
-              ' "${tmp_dir}/verifysource.log"
513
+              ' "${log_file}"
516 514
             )
517 515
             if [ -n "${missing_keys}" ]; then
518 516
               if gpg --recv-keys "${missing_keys}"; then
@@ -524,7 +522,7 @@ while [ "${count}" -ne 0 ] && \
524 522
 
525 523
           # download the repository key from github
526 524
           if [ ${verifysource_trial} -eq 2 ]; then
527
-            if grep -q ' FAILED (unknown public key \([0-9A-F]\{16\}\))' -- "${tmp_dir}/verifysource.log"; then
525
+            if grep -q ' FAILED (unknown public key \([0-9A-F]\{16\}\))' -- "${log_file}"; then
528 526
               # TODO: get the name of the key file from its finger print or
529 527
               # some other information inside the repository
530 528
               if makepkg --printsrcinfo | \
@@ -597,12 +595,6 @@ while [ "${count}" -ne 0 ] && \
597 595
             verifysource_trial=$((verifysource_trial + 1))
598 596
           fi
599 597
         done
600
-        mv \
601
-          "${tmp_dir}/verifysource.log" \
602
-          "$(
603
-            date -u --iso-8601=seconds | \
604
-              cut -d+ -f1
605
-          ).build-log" 2>/dev/null || true
606 598
 
607 599
         if ${success}; then
608 600
           echo 'building' > "${tmp_dir}/.ping-build-master"