This commit is contained in:
fatalerrors
2026-07-08 18:12:27 +02:00
parent 70fc5c2f78
commit 022d4f9e77

View File

@@ -200,6 +200,7 @@ utaz()
printf "\t- tar.bz2, .tbz2\n" printf "\t- tar.bz2, .tbz2\n"
printf "\t- tar.xz, .txz\n" printf "\t- tar.xz, .txz\n"
printf "\t- tar.lz, .tlz\n" printf "\t- tar.lz, .tlz\n"
printf "\t- lzo\n"
printf "\t- rar\n" printf "\t- rar\n"
printf "\t- arj\n" printf "\t- arj\n"
printf "\t- lha, lzh\n" printf "\t- lha, lzh\n"
@@ -284,6 +285,9 @@ utaz()
extractor="_unxz" extractor="_unxz"
;; ;;
*.tar.lz|*.tlz) *.tar.lz|*.tlz)
extractor="_unlzip"
;;
*.lzo)
extractor="_unlzop" extractor="_unlzop"
;; ;;
*.tar) *.tar)
@@ -465,7 +469,7 @@ taz()
# shellcheck disable=SC2329 # shellcheck disable=SC2329
_dolz() _dolz()
{ {
local procopt="--threads $2" local procopt=(--threads "$2")
local command=plzip local command=plzip
command -v plzip >/dev/null 2>&1 || { command -v plzip >/dev/null 2>&1 || {
@@ -474,7 +478,7 @@ taz()
return 127 return 127
} }
command=lzip command=lzip
local procopt="" local procopt=()
[[ $2 -gt 1 ]] && [[ $2 -gt 1 ]] &&
disp W "lzip doesn't support multithreading, falling back to 1 thread." && disp W "lzip doesn't support multithreading, falling back to 1 thread." &&
disp W "Consider installing plzip to obtain multithreading abilities." disp W "Consider installing plzip to obtain multithreading abilities."
@@ -482,7 +486,7 @@ taz()
local opt=() local opt=()
[[ $4 ]] && opt=('-vv') [[ $4 ]] && opt=('-vv')
opt+=("$procopt") opt+=("${procopt[@]}")
# Compress with lzip (lzma) # Compress with lzip (lzma)
$command "${opt[@]}" --keep "-$3" "$1" $command "${opt[@]}" --keep "-$3" "$1"
@@ -493,7 +497,7 @@ taz()
# shellcheck disable=SC2329 # shellcheck disable=SC2329
_dogz() _dogz()
{ {
local procopt="--processes $2" local procopt=(--processes "$2")
local command=pigz local command=pigz
command -v pigz >/dev/null 2>&1 || { command -v pigz >/dev/null 2>&1 || {
@@ -502,7 +506,7 @@ taz()
return 127 return 127
} }
local command="gzip --compress" local command="gzip --compress"
local procopt="" local procopt=()
[[ $2 -gt 1 ]] && [[ $2 -gt 1 ]] &&
disp W "gzip doesn't support multithreading, falling back to 1 thread." && disp W "gzip doesn't support multithreading, falling back to 1 thread." &&
disp W "Consider installing pigz to obtain multithreading abilities." disp W "Consider installing pigz to obtain multithreading abilities."
@@ -510,7 +514,7 @@ taz()
local opt=() local opt=()
[[ $4 ]] && opt=('--verbose') [[ $4 ]] && opt=('--verbose')
opt+=("$procopt") opt+=("${procopt[@]}")
# Compress with gzip # Compress with gzip
$command "${opt[@]}" --keep "-$3" "$1" $command "${opt[@]}" --keep "-$3" "$1"
@@ -521,7 +525,7 @@ taz()
# shellcheck disable=SC2329 # shellcheck disable=SC2329
_dobz2() _dobz2()
{ {
local procopt="-p$2" local procopt=("-p$2")
local command=pbzip2 local command=pbzip2
command -v pbzip2 >/dev/null 2>&1 || { command -v pbzip2 >/dev/null 2>&1 || {
@@ -530,7 +534,7 @@ taz()
return 127 return 127
} }
local command=bzip2 local command=bzip2
local procopt="" local procopt=()
[[ $2 -gt 1 ]] && [[ $2 -gt 1 ]] &&
disp W "bzip2 doesn't support multithreading, falling back to 1 thread." && disp W "bzip2 doesn't support multithreading, falling back to 1 thread." &&
disp W "Consider installing pbzip2 to obtain multithreading abilities." disp W "Consider installing pbzip2 to obtain multithreading abilities."
@@ -538,7 +542,7 @@ taz()
local opt=() local opt=()
[[ $4 ]] && opt=('-v') [[ $4 ]] && opt=('-v')
opt+=("$procopt") opt+=("${procopt[@]}")
# Compress with bz2 # Compress with bz2
$command "${opt[@]}" --compress --keep "-$3" "$1" $command "${opt[@]}" --compress --keep "-$3" "$1"