Skip to content
Snippets Groups Projects
Commit aa0d358f authored by Maxim Cournoyer's avatar Maxim Cournoyer Committed by Adrien Béraud
Browse files

contrib: Streamline the wget options for downloading.

This brings wget performance up to par with that of curl, which makes
downloading the contrib sources via wget about a ~6X faster.  Wget is
now also made the preferred downloader, as it's a smaller than curl,
and is GNU.

* contrib/src/main.mak (download): Remove the -p option, not suitable
for single file downloads (it's meant for retrieving all the resources
of a web page).  This fixes a warning too.  Remove the --passive
option, which is not documented.  It's probably equivalent to
--passive-ftp, which is the default anyway.  Use --waitretry instead
of -w.  The later was causing the 10 s delay to be inserted on every
HTTP redirection, wasting time.

Change-Id: Ibcd6805c66da3fb0c3f37b7128a34cf6c269f400
parent 3fd44ec8
No related branches found
No related tags found
No related merge requests found
......@@ -249,20 +249,17 @@ SVN ?= $(error subversion client (svn) not found!)
ifeq ($(DISABLE_CONTRIB_DOWNLOADS),TRUE)
download = $(error Trying to download $(1) but DISABLE_CONTRIB_DOWNLOADS is TRUE, aborting.)
else ifeq ($(shell wget --version >/dev/null 2>&1 || echo FAIL),)
download = wget $(if ${BATCH_MODE},-nv) -t 4 --waitretry 10 -O "$@" "$(1)"
else ifeq ($(shell curl --version >/dev/null 2>&1 || echo FAIL),)
download = curl $(if ${BATCH_MODE},-sS) -f -L --retry-delay 10 --retry 4 -- "$(1)" > "$@"
else ifeq ($(shell wget --version >/dev/null 2>&1 || echo FAIL),)
download = rm -f $@.tmp && \
wget $(if ${BATCH_MODE},-nv) --passive -t 4 -w 10 -c -p -O $@.tmp "$(1)" && \
touch $@.tmp && \
mv $@.tmp $@
else ifeq ($(which fetch >/dev/null 2>&1 || echo FAIL),)
download = rm -f $@.tmp && \
fetch -p -o $@.tmp "$(1)" && \
touch $@.tmp && \
mv $@.tmp $@
else
download = $(error Neither curl nor wget found!)
download = $(error Neither wget nor curl found!)
endif
ifeq ($(shell which bzcat >/dev/null 2>&1 || echo FAIL),)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment