btrbk: allow compressors to not have a compression level

This commit assumes that a negative `level_min`-value, which would never really
make sense as it would result in an option `--#`, means that the compression
tool does not support any level options at all.

A negative `level_max`-value would in principle still allow to have no upper
limmit, and is therefore not checked for.

Signed-off-by: Christoph Anton Mitterer <mail@christoph.anton.mitterer.name>
pull/501/head
Christoph Anton Mitterer 2022-11-15 22:30:09 +01:00
parent af2d7b2c99
commit 1cd7a48a47
1 changed files with 3 additions and 1 deletions

4
btrbk
View File

@ -727,7 +727,9 @@ sub compress_cmd_text($;$)
WARN_ONCE "Compression level capped to maximum for '$cc->{name}': $cc->{level_max}";
$level = $cc->{level_max};
}
push @cmd, '-' . $level;
if($cc->{level_min} >= 0) {
push @cmd, '-' . $level;
}
}
if(defined($def->{threads}) && ($def->{threads} ne "default")) {
my $thread_opt = $cc->{threads};