scripts/functions: simplify wget vs. curl check
author"Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Tue Dec 29 22:11:09 2009 +0100 (2009-12-29)
changeset 1668383c37e754df
parent 1667 a5020a1facff
child 1669 61edd9d19e3c
scripts/functions: simplify wget vs. curl check
scripts/functions
     1.1 --- a/scripts/functions	Tue Dec 29 21:16:51 2009 +0100
     1.2 +++ b/scripts/functions	Tue Dec 29 22:11:09 2009 +0100
     1.3 @@ -353,11 +353,13 @@
     1.4  # Wrapper function to call one of curl or wget
     1.5  # Usage: CT_DoGetFile <URL>
     1.6  CT_DoGetFile() {
     1.7 -    case "${_wget},${_curl}" in
     1.8 -        ,)  CT_Abort "Could find neither wget nor curl";;
     1.9 -        ,*) CT_DoGetFileCurl "$1";;
    1.10 -        *)  CT_DoGetFileWget "$1";;
    1.11 -    esac
    1.12 +    if   [ -n "${_curl}" ]; then
    1.13 +        CT_DoGetFileCurl "$1"
    1.14 +    elif [ -n "${_wget}" ]; then
    1.15 +        CT_DoGetFileWget "$1"
    1.16 +    else
    1.17 +        CT_Abort "Could find neither wget nor curl"
    1.18 +    fi
    1.19  }
    1.20  
    1.21  # This function tries to retrieve a tarball form a local directory