scripts/functions: simplify wget vs. curl check

This commit is contained in:
Yann E. MORIN" 2009-12-29 22:11:09 +01:00
parent d691923e88
commit 2c077d6fac

View File

@ -353,11 +353,13 @@ _curl=$(CT_Which curl)
# Wrapper function to call one of curl or wget
# Usage: CT_DoGetFile <URL>
CT_DoGetFile() {
case "${_wget},${_curl}" in
,) CT_Abort "Could find neither wget nor curl";;
,*) CT_DoGetFileCurl "$1";;
*) CT_DoGetFileWget "$1";;
esac
if [ -n "${_curl}" ]; then
CT_DoGetFileCurl "$1"
elif [ -n "${_wget}" ]; then
CT_DoGetFileWget "$1"
else
CT_Abort "Could find neither wget nor curl"
fi
}
# This function tries to retrieve a tarball form a local directory