From 7c6ab83094f7346004bfa89e88ae6fea8097e699 Mon Sep 17 00:00:00 2001 From: Jessica Hamilton Date: Tue, 17 Sep 2024 00:02:15 +0000 Subject: [PATCH] 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 Haiku-Format: Haiku-format Bot Reviewed-by: Adrien Destugues --- build/jam/FileRules | 8 +++++++- configure | 6 ++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/build/jam/FileRules b/build/jam/FileRules index 261e9fcb68..1ffbfe6784 100644 --- a/build/jam/FileRules +++ b/build/jam/FileRules @@ -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)" } } diff --git a/configure b/configure index 675933f98c..ee26b1f9f6 100755 --- a/configure +++ b/configure @@ -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}" ;