forked from kiss-community/kiss
kiss: improve compression (#110)
move compression to its own function use threads for (de)compression where possible drop some useless flags Reviewed-on: https://codeberg.org/kiss-community/kiss/pulls/110 Reviewed-by: phoebos <phoebos@noreply.codeberg.org> Co-authored-by: illiliti <illiliti@protonmail.com> Co-committed-by: illiliti <illiliti@protonmail.com>
This commit is contained in:
parent
ed4b6b7534
commit
b04a707130
32
kiss
32
kiss
@ -192,15 +192,26 @@ run_hook_pkg() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
compress() {
|
||||||
|
case $KISS_COMPRESS in
|
||||||
|
bz2) bzip2 -c ;;
|
||||||
|
gz) gzip -c ;;
|
||||||
|
lz) lzip -c ;;
|
||||||
|
lzma) lzma -cT0 ;;
|
||||||
|
xz) xz -cT0 ;;
|
||||||
|
zst) zstd -cT0 ;;
|
||||||
|
esac
|
||||||
|
}
|
||||||
|
|
||||||
decompress() {
|
decompress() {
|
||||||
case $1 in
|
case $1 in
|
||||||
*.tbz|*.bz2) bzip2 -d ;;
|
|
||||||
*.lzma) lzma -dc ;;
|
|
||||||
*.lz) lzip -dc ;;
|
|
||||||
*.tar) cat ;;
|
*.tar) cat ;;
|
||||||
*.tgz|*.gz) gzip -d ;;
|
*.tbz|*.bz2) bzip2 -dc ;;
|
||||||
*.xz|*.txz) xz -dc ;;
|
*.lz) lzip -dc ;;
|
||||||
*.zst) zstd -dc ;;
|
*.tgz|*.gz) gzip -dc ;;
|
||||||
|
*.lzma) lzma -dcT0 ;;
|
||||||
|
*.xz|*.txz) xz -dcT0 ;;
|
||||||
|
*.zst) zstd -dcT0 ;;
|
||||||
esac < "$1"
|
esac < "$1"
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -975,14 +986,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 in
|
tar cf - . | compress > "$_tar_file"
|
||||||
bz2) bzip2 -z ;;
|
|
||||||
gz) gzip -6 ;;
|
|
||||||
lzma) lzma -z ;;
|
|
||||||
lz) lzip -z ;;
|
|
||||||
xz) xz -z ;;
|
|
||||||
zst) zstd -z ;;
|
|
||||||
esac > "$_tar_file"
|
|
||||||
|
|
||||||
cd "$OLDPWD"
|
cd "$OLDPWD"
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user