From f91afbcc27435bc98f4a80c7312984c64622330c Mon Sep 17 00:00:00 2001 From: =?utf8?q?R=C3=A9mi=20Denis-Courmont?= Date: Wed, 6 Jul 2011 10:42:11 +0300 Subject: [PATCH] contrib: fix curl usage and prefer curl over wget curl fits Makefile dependencies better, and supports FTP through HTTP proxies. --- contrib/src/main.mak | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/contrib/src/main.mak b/contrib/src/main.mak index c1c65e282d..66ba274afb 100644 --- a/contrib/src/main.mak +++ b/contrib/src/main.mak @@ -122,17 +122,16 @@ endif endif SVN ?= $(error subversion client (svn) not found!) -ifndef WGET -ifeq ($(shell wget --version >/dev/null 2>&1 || echo FAIL),) -WGET = wget --passive -c -endif -endif -ifndef WGET ifeq ($(shell curl --version >/dev/null 2>&1 || echo FAIL),) -WGET = curl -L -O -endif +download = curl -f -L -- "$(1)" > "$@" +else ifeq ($(shell wget --version >/dev/null 2>&1 || echo FAIL),) +download = rm -f $@.tmp && \ + wget --passive -c -p -O $@.tmp $(1) && \ + touch $@.tmp && \ + mv $@.tmp $@ +else +download = $(error Neither curl nor wget found!) endif -WGET ?= $(error Neither wget not curl found!) # # Common helpers @@ -160,10 +159,6 @@ else HOSTCONF += --with-pic endif -download = rm -f $@.tmp && \ - $(WGET) -p -O $@.tmp $(1) && \ - touch $@.tmp && \ - mv $@.tmp $@ download_git = \ rm -Rf $(@:.tar.xz=) && \ $(GIT) clone $(2:%=--branch %) $(1) $(@:.tar.xz=) && \ -- 2.39.5