From 87c4f2afc149c4f9f2340e762d081e94521c8e7a Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Wed, 13 May 2020 09:45:40 +0300 Subject: [PATCH] kiss: Drop $tar --- kiss | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/kiss b/kiss index 28bfc36..527795f 100755 --- a/kiss +++ b/kiss @@ -329,10 +329,10 @@ pkg_extract() { *://*.tar|*://*.tar.??|*://*.tar.???|*://*.tar.????|*://*.t?z) decompress "$src_dir/$1/${src##*/}" > .ktar - "$tar" xf .ktar || + tar xf .ktar || die "$1" "Couldn't extract ${src##*/}" - "$tar" tf .ktar | while IFS=/ read -r dir _; do + tar tf .ktar | while IFS=/ read -r dir _; do # Some tarballs contain './' as the top-level directory, # we need to skip these occurances. [ -d "${dir#.}" ] || continue @@ -602,7 +602,7 @@ pkg_tar() ( cd "$pkg_dir/$1" # Create a tarball from the contents of the built package. - "$tar" cf - . | case ${KISS_COMPRESS:=gz} in + tar cf - . | case ${KISS_COMPRESS:=gz} in bz2) bzip2 -z ;; gz) gzip -6 ;; lzma) lzma -z ;; @@ -1173,7 +1173,7 @@ pkg_install() { ( cd "$tar_dir/$pkg_name" - decompress "$tar_file" | "$tar" xf - + decompress "$tar_file" | tar xf - ) # Naively assume that the existence of a manifest file is all @@ -1628,11 +1628,6 @@ main() { # POSIX correctness (grep quoted to avoid shellcheck false-positive). grep=$(command -v ggrep) || grep='grep' - # Prefer libarchive tar or GNU tar if installed as they are much - # much faster than busybox's implementation. Very much worth it if - # you value performance. - tar=$(command -v bsdtar || command -v gtar) || tar=tar - # Figure out which 'sudo' command to use based on the user's choice or # what is available on the system. su=${KISS_SU:-$(command -v sudo || command -v doas)} || su=su