From 6e0fd4047f5dbc3bff3c54b4b7fd016d343d3b1d Mon Sep 17 00:00:00 2001 From: davidovski Date: Wed, 25 May 2022 22:32:48 +0100 Subject: fixed extract to work with other file extensions --- xibuild.sh | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) (limited to 'xibuild.sh') diff --git a/xibuild.sh b/xibuild.sh index b0ba56b..e20a349 100644 --- a/xibuild.sh +++ b/xibuild.sh @@ -70,11 +70,16 @@ EOF extract () { f=$1 - case "${f##*.}" in - "gz" ) tar -zxf $f;; - "lz" ) tar --lzip -xf "$f" ;; - "zip" ) unzip -qq -o $f ;; - * ) tar -xf $f ;; + case "${f}" in + *".tar"*) + case "${f##*.}" in + "gz" ) tar -zxf $f;; + "lz" ) tar --lzip -xf "$f" ;; + * ) tar -xf $f ;; + esac + ;; + *".tgz" ) tar -xf $f ;; + *".zip" ) unzip -qq -o $f ;; esac } @@ -97,23 +102,25 @@ fetch_source () { curl -SsL $1 > $downloaded extract $downloaded - [ "$(ls -1 | wc -l)" = "2" ] && - for file in */* */.*; do - echo $file | grep -q '\.$' || mv $file . - done; - } } xibuild_fetch () { cd $root/$build_dir [ ! -z "$SOURCE" ] && fetch_source $SOURCE $BRANCH + + [ "$(ls -1 | wc -l)" = "2" ] && + for file in */* */.*; do + echo $file | grep -q '\.$' || mv $file . + done; + for url in $ADDITIONAL; do case $url in http*|ftp*) fetch_source $url;; + *) fetch_source file://$src_dir/$url esac done - cp -r $src_dir/* $root/$build_dir/ + cp -r $src_dir/*.xibuild $root/$build_dir/ } xibuild_build () { -- cgit v1.2.1