mirror of
https://codeberg.org/kiss-community/kiss
synced 2024-09-30 21:40:55 -06:00
kiss: Drop $tar
This commit is contained in:
parent
68cbb2b68d
commit
87c4f2afc1
13
kiss
13
kiss
@ -329,10 +329,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
|
||||||
@ -602,7 +602,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 ;;
|
||||||
@ -1173,7 +1173,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
|
||||||
@ -1628,11 +1628,6 @@ main() {
|
|||||||
# POSIX correctness (grep quoted to avoid shellcheck false-positive).
|
# POSIX correctness (grep quoted to avoid shellcheck false-positive).
|
||||||
grep=$(command -v ggrep) || grep='grep'
|
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
|
# Figure out which 'sudo' command to use based on the user's choice or
|
||||||
# what is available on the system.
|
# what is available on the system.
|
||||||
su=${KISS_SU:-$(command -v sudo || command -v doas)} || su=su
|
su=${KISS_SU:-$(command -v sudo || command -v doas)} || su=su
|
||||||
|
Loading…
Reference in New Issue
Block a user