summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordavidovski <david@davidovski.xyz>2022-05-25 22:32:48 +0100
committerdavidovski <david@davidovski.xyz>2022-05-25 22:32:48 +0100
commit6e0fd4047f5dbc3bff3c54b4b7fd016d343d3b1d (patch)
tree899b584fcbc1a782eaa7eaeaea16d205c29a74bb
parent0d1ab290178d113bd1ee808fb57b41b756ae0605 (diff)
fixed extract to work with other file extensions
-rw-r--r--xibuild.sh29
1 files changed, 18 insertions, 11 deletions
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 () {