cpt

[ARCHIVED] Carbs Packaging Tools
git clone git://git.ckyln.com/~cem/cpt.git
Log | Files | Refs | README | LICENSE

commit 66c363a3b8b26fb9fcd37b94ab7cf3b704f9fc05
parent 55e607720d0c237996cc1f9314c65ec24d87c08c
Author: Dylan Araps <dylan.araps@gmail.com>
Date:   Mon, 14 Oct 2019 23:40:52 +0300

kiss: be more explicit (and less greedy) with tar archives.

Diffstat:
Mkiss | 39++++++++++++++++++++++-----------------
1 file changed, 22 insertions(+), 17 deletions(-)

diff --git 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|'')