From cc78f0b20c7ae43a20f22e3a01aa0c76ab5cac33 Mon Sep 17 00:00:00 2001 From: Christian Helmuth Date: Fri, 3 Mar 2017 08:53:02 +0100 Subject: [PATCH] tool: second try on failing check of file-based port We call curl a second time if the first check fails. This gives download sites time to reconsider their response and helps, for example, to check the qemu-usb port. --- tool/ports/mk/check.mk | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tool/ports/mk/check.mk b/tool/ports/mk/check.mk index 76169a5a0..691c8f3b5 100644 --- a/tool/ports/mk/check.mk +++ b/tool/ports/mk/check.mk @@ -54,8 +54,13 @@ check: $(DOWNLOADS) # # Check plain remote file # +# We call curl a second time if the first check fails. This gives download +# sites time to reconsider their response and helps, for example, to check the +# qemu-usb port. +# +CURL_CMD = curl -f -L -k -r -2 --max-time 15 --retry 2 $(URL($*)) > /dev/null 2>&1 %.file: - $(VERBOSE)curl -f -L -k -r -2 --max-time 15 --retry 2 $(URL($*)) > /dev/null 2>&1 + $(VERBOSE)$(CURL_CMD) || (sleep 1; $(CURL_CMD)) %.archive: %.file $(VERBOSE)true