From bf751b95fe4368089a553565cc95968a4757fd5d Mon Sep 17 00:00:00 2001 From: "dylan.araps@gmail.com" Date: Mon, 14 Oct 2019 20:40:51 +0000 Subject: kiss: be more explicit (and less greedy) with tar archives. FossilOrigin-Name: a3c4b2e8124b2942e44f90040201ba69d5ebe04ca11cb9f6b140cdb4d15b577a --- kiss | 39 ++++++++++++++++++++++----------------- 1 file changed, 22 insertions(+), 17 deletions(-) (limited to 'kiss') 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|'') -- cgit v1.2.3