aboutsummaryrefslogtreecommitdiff
path: root/kiss
diff options
context:
space:
mode:
authordylan.araps@gmail.com <dylan.araps@gmail.com>2019-10-14 20:40:51 +0000
committerdylan.araps@gmail.com <dylan.araps@gmail.com>2019-10-14 20:40:51 +0000
commitbf751b95fe4368089a553565cc95968a4757fd5d (patch)
treeae32a51cfc605d32e77890f22acfd38ebd7a4513 /kiss
parent8f1db937051afa06d984725899f8576f58f36392 (diff)
downloadcpt-bf751b95fe4368089a553565cc95968a4757fd5d.tar.gz
kiss: be more explicit (and less greedy) with tar archives.
FossilOrigin-Name: a3c4b2e8124b2942e44f90040201ba69d5ebe04ca11cb9f6b140cdb4d15b577a
Diffstat (limited to 'kiss')
-rwxr-xr-xkiss39
1 files changed, 22 insertions, 17 deletions
diff --git a/kiss b/kiss
index 91935b9..e4c4a3f 100755
--- a/kiss
+++ b/kiss
@@ -173,24 +173,29 @@ pkg_extract() {
while read -r src dest; do
mkdir -p "$mak_dir/$1/$dest" && cd "$mak_dir/$1/$dest"
- # Only 'tar' archives are currently supported for extraction.
- # Any other file-types are simply copied to '$mak_dir' which
- # allows for manual extraction.
- if [ -z "${src##*.tar*}" ] || [ -z "${src##*.tgz}" ]; then
- tar xf "$src_dir/$1/${src##*/}" --strip-components 1 \
- || die "$1" "Couldn't extract ${src##*/}"
-
- # Local file.
- elif [ -f "$repo_dir/$src" ]; then
- cp -f "$repo_dir/$src" .
+ case $src in
+ # Only 'tar' archives are currently supported for extraction.
+ # Any other file-types are simply copied to '$mak_dir' which
+ # allows for manual extraction.
+ *://*.tar|*://*.tar.??|*://*.tar.???|*://*.tar.????|*://*.tgz)
+ tar xf "$src_dir/$1/${src##*/}" --strip-components 1 ||
+ die "$1" "Couldn't extract ${src##*/}"
+ ;;
- # Remote file.
- elif [ -f "$src_dir/$1/${src##*/}" ]; then
- cp -f "$src_dir/$1/${src##*/}" .
+ *)
+ # Local file.
+ if [ -f "$repo_dir/$src" ]; then
+ cp -f "$repo_dir/$src" .
- else
- die "$1" "Local file $src not found"
- fi
+ # Remote file.
+ elif [ -f "$src_dir/$1/${src##*/}" ]; then
+ cp -f "$src_dir/$1/${src##*/}" .
+
+ else
+ die "$1" "Local file $src not found"
+ fi
+ ;;
+ esac
done < "$repo_dir/sources"
}
@@ -1019,7 +1024,7 @@ args() {
;;
v|version|-v|--version)
- log kiss 0.53.1
+ log kiss 0.53.2
;;
h|help|-h|--help|'')