diff options
author | bill-auger <mr.j.spam.me@gmail.com> | 2022-08-29 15:45:54 -0400 |
---|---|---|
committer | bill-auger <mr.j.spam.me@gmail.com> | 2022-08-30 21:29:18 -0400 |
commit | 76857c2a966cd2d30bca73df9824decc8049195a (patch) | |
tree | f1718e32023fe29e7159b66f4337d44b3c1bf46e | |
parent | bc87081f08e91dc2c045c5e0b2cffa73e213a363 (diff) |
refactor mksource() procedure
-rw-r--r-- | makechrootpkg.in | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/makechrootpkg.in b/makechrootpkg.in index 32af2cc..bea5882 100644 --- a/makechrootpkg.in +++ b/makechrootpkg.in @@ -284,6 +284,7 @@ _chrootnamcap() { # - "N N" (n_srcs_required n_srcs_exist) VerifyLibreSources() ( + local is_sig_required=$( [[ -n "$1" ]] ; echo $(( ! $? )) ) local src_n src_file_url src_file repo local is_libre_src src_exists is_sig local n_srcs_required=0 @@ -297,18 +298,17 @@ VerifyLibreSources() src_file=${src_file_url##*/} for repo in "${MIRRORS[@]}" - do is_libre_src=$( [[ "$src_file_url" == "$repo"* ]] && echo 1 || echo 0 ) - src_exists=$( [[ -f "${src_file}" ]] && echo 1 || echo 0 ) - is_sig=$( [[ "${src_file/*.}" =~ (asc|sig) ]] && echo 1 || echo 0 ) - (( is_libre_src )) && n_srcs_required=$(( ++n_srcs_required )) && - (( src_exists || is_sig )) && n_srcs_exist=$(( ++n_srcs_exist )) + do is_libre_src=$( [[ "$src_file_url" == "$repo"* ]] ; echo $(( ! $? )) ) + src_exists=$( [[ -f "${src_file}" ]] ; echo $(( ! $? )) ) + is_sig=$( [[ "${src_file/*.}" =~ (asc|sig) ]] ; echo $(( ! $? )) ) + if (( is_libre_src )); then + n_srcs_required=$(( n_srcs_required + ( ! is_sig || is_sig_required ) )) + n_srcs_exist=$(( n_srcs_exist + ( src_exists ) )) + fi done done - - echo "${n_srcs_required} ${n_srcs_exist}" ) - # Usage: download_sources $copydir $makepkg_user # Globals: # - SRCDEST @@ -337,10 +337,14 @@ download_sources() { # There are multiple reasons for why the preceding `makepkg` invokation may have failed # (invalid checksums/sigs, download failure, borked PKGBUILD, etc); # so we must deduce the cause of failure here. - # The expected failure here, is invalid checksum(s) for the newly created libre sources. - # In that case, we inject the new checksum(s) into the PKGBUILD, + # The expected failure here, is a missing signature or an invalid checksum + # for the newly created libre source-ball. + # In that case, we inject the new checksum into the PKGBUILD, # then fork a new instance of libremakepkg, and exit this process. - n_libre_sources_out=$(VerifyLibreSources) + # The newly spawned instance of libremakepkg will not validate the GPG signature; + # because it was intentionally not created (librerelease will create it later). + is_new_srcball=$( [[ -f "$LIBRE_SRCBALL_CREATION_MARKER" ]] ; echo $(( ! $? )) ; ) + n_libre_sources_out=$(VerifyLibreSources $(( ! is_new_srcball))) n_libre_sources_required=${n_libre_sources_out% *} n_libre_sources_exist=${n_libre_sources_out#* } sums_msg="$(_ "Running \`updpkgsums\` to account for the newly created libre source-ball(s)")" |