diff --git a/scripts/build/termux_get_repo_files.sh b/scripts/build/termux_get_repo_files.sh index b8b3e4253..b6e595d29 100644 --- a/scripts/build/termux_get_repo_files.sh +++ b/scripts/build/termux_get_repo_files.sh @@ -25,11 +25,14 @@ termux_get_repo_files() { local TERMUX_REPO_NAME=$(echo ${TERMUX_REPO_URL[$idx-1]} | sed -e 's%https://%%g' -e 's%http://%%g' -e 's%/%-%g') local RELEASE_FILE=${TERMUX_COMMON_CACHEDIR}/${TERMUX_REPO_NAME}-${TERMUX_REPO_DISTRIBUTION[$idx-1]}-Release - termux_download "${TERMUX_REPO_URL[$idx-1]}/dists/${TERMUX_REPO_DISTRIBUTION[$idx-1]}/Release" \ - "$RELEASE_FILE" SKIP_CHECKSUM - - termux_download "${TERMUX_REPO_URL[$idx-1]}/dists/${TERMUX_REPO_DISTRIBUTION[$idx-1]}/Release.gpg" \ - "${RELEASE_FILE}.gpg" SKIP_CHECKSUM + local attempt + for attempt in {1..5}; do + termux_download "${TERMUX_REPO_URL[$idx-1]}/dists/${TERMUX_REPO_DISTRIBUTION[$idx-1]}/Release" \ + "$RELEASE_FILE" SKIP_CHECKSUM || sleep 30 && continue + termux_download "${TERMUX_REPO_URL[$idx-1]}/dists/${TERMUX_REPO_DISTRIBUTION[$idx-1]}/Release.gpg" \ + "${RELEASE_FILE}.gpg" SKIP_CHECKSUM || sleep 30 && continue + break + done gpg --verify "${RELEASE_FILE}.gpg" "$RELEASE_FILE"