From eba6343c8555a34b9dc4fbaff97d8709d2b4ff62 Mon Sep 17 00:00:00 2001 From: Matthias Rampke Date: Sat, 13 Aug 2011 21:24:14 +0200 Subject: [PATCH] automatically find a download program to use --- summon-arm-toolchain | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/summon-arm-toolchain b/summon-arm-toolchain index f6826da..cbf50c1 100755 --- a/summon-arm-toolchain +++ b/summon-arm-toolchain @@ -105,9 +105,15 @@ STAMPS=${SUMMON_DIR}/stamps # Detects which tools and flags to use ############################################################################## -if ! which wget > /dev/null; then - echo "Please install wget" - exit 1 +# normalized fetching with whatever we can find +if which fetch > /dev/null; then + FETCHCMD="fetch -p" +elif which wget > /dev/null; then + FETCHCMD=wget +elif which curl > /dev/null; then + FETCHCMD="curl -O" +else + FETCHCMD=ftp # the only HTTP client on some BSD fi if [ USE_LINARO = 1 ]; then @@ -131,7 +137,7 @@ fi fetch() { if [ ! -e ${STAMPS}/$1.fetch ]; then log "Downloading $1 sources..." - wget -c $2 + ${FETCHCMD} $2 touch ${STAMPS}/$1.fetch fi } -- 2.25.1