summaryrefslogtreecommitdiff
path: root/scripts/functions
diff options
context:
space:
mode:
authorYann E. MORIN" <yann.morin.1998@anciens.enib.fr>2009-12-29 21:11:09 (GMT)
committerYann E. MORIN" <yann.morin.1998@anciens.enib.fr>2009-12-29 21:11:09 (GMT)
commit2c077d6fac6a21227ddfd4b2403f24a8ad01dda1 (patch)
tree023f665b4a24936ef9fa9b4fb99bc612e4eed470 /scripts/functions
parentd691923e8865d08dda1c77f536cbcd5fa0b51bfd (diff)
scripts/functions: simplify wget vs. curl check
Diffstat (limited to 'scripts/functions')
-rw-r--r--scripts/functions12
1 files changed, 7 insertions, 5 deletions
diff --git a/scripts/functions b/scripts/functions
index 33a23a2..8d31872 100644
--- a/scripts/functions
+++ b/scripts/functions
@@ -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