bugfix
This commit is contained in:
@@ -182,6 +182,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"
|
||||||
@@ -266,6 +267,9 @@ utaz()
|
|||||||
extractor="_unxz"
|
extractor="_unxz"
|
||||||
;;
|
;;
|
||||||
*.tar.lz|*.tlz)
|
*.tar.lz|*.tlz)
|
||||||
|
extractor="_unlzip"
|
||||||
|
;;
|
||||||
|
*.lzo)
|
||||||
extractor="_unlzop"
|
extractor="_unlzop"
|
||||||
;;
|
;;
|
||||||
*.tar)
|
*.tar)
|
||||||
@@ -444,7 +448,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 || {
|
||||||
@@ -453,7 +457,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."
|
||||||
@@ -461,7 +465,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"
|
||||||
@@ -471,7 +475,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 || {
|
||||||
@@ -480,7 +484,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."
|
||||||
@@ -488,7 +492,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"
|
||||||
@@ -498,7 +502,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 || {
|
||||||
@@ -507,7 +511,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."
|
||||||
@@ -515,7 +519,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"
|
||||||
|
|||||||
Reference in New Issue
Block a user