From ea6fa45786557b8b66cc52e82a50db7ca612d308 Mon Sep 17 00:00:00 2001 From: frju365 Date: Mon, 26 Jun 2017 17:06:05 +0200 Subject: [PATCH] [Fix] _common.sh --- scripts/.fonctions | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/scripts/.fonctions b/scripts/.fonctions index 59c260b..218d720 100644 --- a/scripts/.fonctions +++ b/scripts/.fonctions @@ -27,3 +27,18 @@ CHECK_FINALPATH () { # Vérifie que le dossier de destination n'est pas déjà u false fi } + +GARRADIN_VERSION="0.7.7" +GARRADIN_SOURCE_URL="http://dev.kd2.org/garradin/files/garradin-${GARRADIN_VERSION}.tar.bz2" + +extract_source() { + local DESTDIR=$1 + + # retrieve and extract Garradin tarball + rc_tarball="${DESTDIR}/garradin.tar.gz" + sudo wget -q -O "$rc_tarball" "$GARRADIN_SOURCE_URL" \ + || ynh_die "Unable to download source tarball" + sudo tar -xf "$rc_tarball" -C "$DESTDIR" --strip-components 1 \ + || ynh_die "Unable to extract source tarball" + sudo rm "$rc_tarball" +}