configure: detect supported retry flags for wget.

Some systems may be using wget2 symlinked to wget (Fedora,
currently), which doesn't support --retry-on-host-error.

Change-Id: I9fac080e7ac1cc4c39a03f6c27e9c42f8697ecff
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8336
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Haiku-Format: Haiku-format Bot <no-reply+haikuformatbot@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
This commit is contained in:
Jessica Hamilton 2024-09-17 00:02:15 +00:00 committed by Adrien Destugues
parent 66582b42a5
commit 7c6ab83094
2 changed files with 13 additions and 1 deletions

View File

@ -449,6 +449,12 @@ rule DownloadLocatedFile target : url : source
URL on $(target) = $(url) ;
if $(HOST_WGET_RETRY_ON_HOST_ERROR) {
WGET_RETRY_FLAGS on $(target) = "--retry-connrefused --retry-on-host-error" ;
} else {
WGET_RETRY_FLAGS on $(target) = "--retry-connrefused" ;
}
if $(source) {
Depends $(target) : $(source) ;
}
@ -467,7 +473,7 @@ if $(HAIKU_NO_DOWNLOADS) = 1 {
actions DownloadLocatedFile1
{
source="$(2)"
wget --retry-connrefused --retry-on-host-error --timeout 30 -O "$(1)" $(URL) || exit 1
wget $(WGET_RETRY_FLAGS) --timeout 30 -O "$(1)" $(URL) || exit 1
touch "$(1)"
}
}

6
configure vendored
View File

@ -907,6 +907,11 @@ case $PYTHON_VERSION in
;;
esac
# check if wget supports --retry-on-host-error
if wget --retry-on-host-error --version > /dev/null 2>&1; then
HOST_WGET_RETRY_ON_HOST_ERROR=1
fi
# check if nasm can actually output ELF files
# (the stock version in OSX can't)
# XXX: should probably only test for x86* arch
@ -1159,6 +1164,7 @@ HOST_OBJCOPY ?= ${HOST_GCC_OBJCOPY} ;
HOST_EXTENDED_REGEX_SED ?= ${HOST_EXTENDED_REGEX_SED} ;
HOST_SHA256 ?= ${HOST_SHA256} ;
HOST_PYTHON ?= ${HOST_PYTHON} ;
HOST_WGET_RETRY_ON_HOST_ERROR ?= ${HOST_WGET_RETRY_ON_HOST_ERROR} ;
HAIKU_NASM ?= ${HAIKU_NASM} ;
HAIKU_BUILD_ATTRIBUTES_DIR ?= "${HAIKU_BUILD_ATTRIBUTES_DIR}" ;