summaryrefslogtreecommitdiffstats
path: root/build-aux
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>2024-09-19 16:31:55 +0200
committerWerner Koch <wk@gnupg.org>2024-09-19 16:33:27 +0200
commit8c0ac05f0602b8281eed04ba0ef5b82637663d27 (patch)
treed7aee10290f6c3b453b0583c2d0c07b7107a7f66 /build-aux
parentpo: Update Portuguese Translation. (diff)
downloadgnupg2-8c0ac05f0602b8281eed04ba0ef5b82637663d27.tar.xz
gnupg2-8c0ac05f0602b8281eed04ba0ef5b82637663d27.zip
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.
Diffstat (limited to 'build-aux')
-rwxr-xr-xbuild-aux/getswdb.sh13
-rw-r--r--build-aux/speedo.mk7
2 files changed, 15 insertions, 5 deletions
diff --git a/build-aux/getswdb.sh b/build-aux/getswdb.sh
index 0b97f0de5..5feaf8612 100755
--- a/build-aux/getswdb.sh
+++ b/build-aux/getswdb.sh
@@ -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
diff --git a/build-aux/speedo.mk b/build-aux/speedo.mk
index 5590b4051..b887c506a 100644
--- a/build-aux/speedo.mk
+++ b/build-aux/speedo.mk
@@ -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)),)
@@ -865,7 +870,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 \