1
0
Fork 0
mirror of git://git.gnupg.org/gnupg.git synced 2025-07-14 21:47:19 +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