kiss: Drop _tar() portability function. Thanks everyone.

This commit is contained in:
Dylan Araps 2020-05-18 22:55:57 +03:00
parent d4e6e14324
commit 0abc6be41d
No known key found for this signature in database
GPG Key ID: 46D62DD9F1DE636E
1 changed files with 4 additions and 14 deletions

18
kiss
View File

@ -64,16 +64,6 @@ as_root() {
esac esac
} }
_tar() {
# Some tar implementations support '-args' and some
# simply support 'args'. This will try '-args' and
# fallback to 'args'.
tar_cmd=$1
shift
tar "-$tar_cmd" "$@" || tar "$tar_cmd" "$@"
}
run_hook() { run_hook() {
# Provide a default post-build hook to remove files # Provide a default post-build hook to remove files
# and directories for things we don't support out of # and directories for things we don't support out of
@ -325,10 +315,10 @@ pkg_extract() {
*://*.tar|*://*.tar.??|*://*.tar.???|*://*.tar.????|*://*.t?z) *://*.tar|*://*.tar.??|*://*.tar.???|*://*.tar.????|*://*.t?z)
decompress "$src_dir/$1/${src##*/}" > .ktar decompress "$src_dir/$1/${src##*/}" > .ktar
_tar xf .ktar || tar xf .ktar ||
die "$1" "Couldn't extract ${src##*/}" 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, # Some tarballs contain './' as the top-level directory,
# we need to skip these occurances. # we need to skip these occurances.
[ -d "${dir#.}" ] || continue [ -d "${dir#.}" ] || continue
@ -609,7 +599,7 @@ pkg_tar() (
cd "$pkg_dir/$1" cd "$pkg_dir/$1"
# Create a tarball from the contents of the built package. # 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 ;; bz2) bzip2 -z ;;
gz) gzip -6 ;; gz) gzip -6 ;;
lzma) lzma -z ;; lzma) lzma -z ;;
@ -1195,7 +1185,7 @@ pkg_install() {
( (
cd "$tar_dir/$pkg_name" 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 # Naively assume that the existence of a manifest file is all