build-package.sh: retry if metadata signature is bad

Do not fail immediately if signature is bad. This often happens when metadata
has been downloaded during repository update. Usually signature becomes fixed
in a few seconds, so we can rather wait than abort build immediately.
This commit is contained in:
Leonid Pliushch 2021-07-23 00:26:31 +03:00
parent 90c2f91830
commit f219100650
No known key found for this signature in database
GPG Key ID: 45F2964132545795
1 changed files with 6 additions and 3 deletions

View File

@ -31,7 +31,12 @@ termux_get_repo_files() {
"$RELEASE_FILE" SKIP_CHECKSUM && \
termux_download "${TERMUX_REPO_URL[$idx-1]}/dists/${TERMUX_REPO_DISTRIBUTION[$idx-1]}/Release.gpg" \
"${RELEASE_FILE}.gpg" SKIP_CHECKSUM; then
break
if gpg --verify "${RELEASE_FILE}.gpg" "$RELEASE_FILE"; then
break
else
rm "$RELEASE_FILE" "${RELEASE_FILE}.gpg"
fi
fi
download_attempts=$((download_attempts - 1))
@ -43,8 +48,6 @@ termux_get_repo_files() {
sleep 30
done
gpg --verify "${RELEASE_FILE}.gpg" "$RELEASE_FILE"
for arch in all $TERMUX_ARCH; do
local PACKAGES_HASH=$(./scripts/get_hash_from_file.py ${RELEASE_FILE} $arch ${TERMUX_REPO_COMPONENT[$idx-1]})
# If packages_hash = "" then the repo probably doesn't contain debs for $arch