scripts/functions: simplify wget vs. curl check
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