From 822c6ca4e883fb8a7b9f50ce131445cfb34e786d Mon Sep 17 00:00:00 2001 From: "Yann Esposito (Yogsototh)" Date: Fri, 13 Apr 2012 14:23:50 +0200 Subject: [PATCH] Updated the download method depending on the ext --- scripts/functions | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/scripts/functions b/scripts/functions index 8208f1c..4f06c56 100644 --- a/scripts/functions +++ b/scripts/functions @@ -22,7 +22,14 @@ function clearEnvironment() { } function downloadAndExtract() { - mkdir -p $1 && curl $2 -o - | tar xzf - -C $1 + case $2 in + *.tar) options=xf ;; + *.tar.gz) options=xzf ;; + *.tar.bz2) options=xjf;; + *) error "Unknow format for $2; should be tar, tar.gz or tar.bz2" ;; + esac + + mkdir -p $1 && curl $2 -o - | tar $options - -C $1 } function configureMakeInstall() {