Test for curl or wget only once, not at each download.
author"Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Thu Jul 12 19:20:36 2007 +0000 (2007-07-12)
changeset 2410aa95f4eed31
parent 240 ac8b9eeefe80
child 242 8e5b994260d0
Test for curl or wget only once, not at each download.
scripts/functions
     1.1 --- a/scripts/functions	Thu Jul 12 15:40:50 2007 +0000
     1.2 +++ b/scripts/functions	Thu Jul 12 19:20:36 2007 +0000
     1.3 @@ -297,11 +297,11 @@
     1.4  	curl --ftp-pasv -O --retry 3 "$1" >/dev/null || curl -O --retry 3 "$1" >/dev/null || true
     1.5  }
     1.6  
     1.7 +_wget=`CT_Which wget`
     1.8 +_curl=`CT_Which curl`
     1.9  # Wrapper function to call one of curl or wget
    1.10  # Usage: CT_DoGetFile <URL>
    1.11  CT_DoGetFile() {
    1.12 -    local _wget=`CT_Which wget`
    1.13 -    local _curl=`CT_Which curl`
    1.14      case "${_wget},${_curl}" in
    1.15          ,)  CT_DoError "Could find neither wget nor curl";;
    1.16          ,*) CT_DoGetFileCurl "$1" 2>&1 |CT_DoLog ALL;;