archive: add zstd and use all available CPU cores

This commit is contained in:
Enno 2020-01-06 19:16:52 +01:00 committed by GitHub
parent 7e7e57c627
commit 6f9df3412f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 2 deletions

View File

@ -20,12 +20,13 @@ shift
case "${archive_name}" in
(*.tar.gz|*.tgz) tar -cvzf "${archive_name}" "${@}" ;;
(*.tar.bz|*.tar.bz2|*.tbz|*.tbz2) tar -cvjf "${archive_name}" "${@}" ;;
(*.tar.xz|*.txz) tar -J --help &>/dev/null && tar -cvJf "${archive_name}" "${@}" ;;
(*.tar.lzma|*.tlz) tar --lzma --help &>/dev/null && tar --lzma -cvf "${archive_name}" "${@}" ;;
(*.tar.xz|*.txz) tar -J --help &>/dev/null && env XZ_OPT=-T0 tar -cvJf "${archive_name}" "${@}" ;;
(*.tar.lzma|*.tlz) tar --lzma --help &>/dev/null && env XZ_OPT=-T0 tar --lzma -cvf "${archive_name}" "${@}" ;;
(*.tar) tar -cvf "${archive_name}" "${@}" ;;
(*.zip) zip -r "${archive_name}" "${@}" ;;
(*.rar) rar a "${archive_name}" "${@}" ;;
(*.7z) 7za a "${archive_name}" "${@}" ;;
(*.zst) zstd -c -T0 "${@}" -o "${archive_name}" ;;
(*.gz) print "${0}: .gz is only useful for single files, and does not capture permissions. Use .tar.gz" ;;
(*.bz|*.bz2) print "${0}: .bzip2 is only useful for single files, and does not capture permissions. Use .tar.bz2" ;;
(*.xz) print "${0}: .xz is only useful for single files, and does not capture permissions. Use .tar.xz" ;;