1
0
mirror of git://git.gnupg.org/gnupg.git synced 2024-09-21 15:01:41 +02:00

speedo: Make use of wget more robust

* build-aux/getswdb.sh: Add option --wgetopt.
* build-aux/speedo.mk (WGETOPT): New.
(getswdb_options): Pass to getswdb.
(unpack): Use wget with new options.
This commit is contained in:
Werner Koch 2024-09-19 16:31:55 +02:00
parent f6858322a3
commit 94a7a67473
No known key found for this signature in database
GPG Key ID: E3FDFF218E45B72B
2 changed files with 15 additions and 5 deletions

View File

@ -40,6 +40,7 @@ Options:
(default if not used in the GnuPG tree)
--find-sha1sum Print the name of the sha1sum utility
--find-sha256sum Print the name of the sha256sum utility
--wgetopt STRING Pass STRING as options to wget
--help Print this help.
Example:
@ -53,6 +54,7 @@ EOF
#
# Parse options
#
WGETOPT=
skip_download=no
skip_verify=no
skip_selfcheck=no
@ -91,6 +93,9 @@ while test $# -gt 0; do
--find-sha256sum)
find_sha256sum=yes
;;
--wgetopt|--wgetopt=*)
WGETOPT=$optarg
;;
--info)
info_mode=yes
;;
@ -192,12 +197,12 @@ else
exit 1
fi
if ! $WGET -q -O swdb.lst "$urlbase/swdb.lst" ; then
if ! $WGET ${WGETOPT} -q -O swdb.lst "$urlbase/swdb.lst" ; then
echo "download of swdb.lst failed." >&2
exit 1
fi
if [ $skip_verify = no ]; then
if ! $WGET -q -O swdb.lst.sig "$urlbase/swdb.lst.sig" ; then
if ! $WGET ${WGETOPT} -q -O swdb.lst.sig "$urlbase/swdb.lst.sig" ; then
echo "download of swdb.lst.sig failed." >&2
exit 1
fi
@ -235,13 +240,13 @@ download_pkg () {
local url="$1"
local file="${url##*/}"
if ! $WGET -q -O - "$url" >"${file}.tmp" ; then
if ! $WGET ${WGETOPT} -q -O - "$url" >"${file}.tmp" ; then
echo "download of $file failed." >&2
[ -f "${file}.tmp" ] && rm "${file}.tmp"
return 1
fi
if [ $skip_verify = no ]; then
if ! $WGET -q -O - "${url}.sig" >"${file}.tmpsig" ; then
if ! $WGET ${WGETOPT} -q -O - "${url}.sig" >"${file}.tmpsig" ; then
echo "download of $file.sig failed." >&2
[ -f "${file}.tmpsig" ] && rm "${file}.tmpsig"
return 1

View File

@ -185,6 +185,10 @@ MAKE_J = $(shell if command -v nproc >/dev/null 2>&1; then \
nproc; else echo 6; \
fi)
# Extra options for wget(1)
WGETOPT= --retry-connrefused --retry-on-host-error
# Name to use for the w32 installer and sources
@ -309,6 +313,7 @@ endif
ifeq ($(SELFCHECK),0)
getswdb_options += --skip-selfcheck
endif
getswdb_options += --wgetopt="$(WGETOPT)"
ifeq ($(UPD_SWDB),1)
SWDB := $(shell $(topsrc)/build-aux/getswdb.sh $(getswdb_options) && echo okay)
ifeq ($(strip $(SWDB)),)
@ -862,7 +867,7 @@ $(stampdir)/stamp-$(1)-00-unpack: $(stampdir)/stamp-directories
[ -f tmp.tgz ] && rm tmp.tgz; \
case "$$$${tar}" in \
/*) $$$${pretar} < $$$${tar} | tar xf - ;; \
*) wget -q -O - $$$${tar} | tee tmp.tgz \
*) wget $(WGETOPT) -q -O - $$$${tar} | tee tmp.tgz \
| $$$${pretar} | tar x$$$${opt}f - ;; \
esac; \
if [ -f tmp.tgz ]; then \