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 e4aa97cba..80d42d96f 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)),) @@ -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 \