From 1cd7a48a474afce969208376c3dbb329c3e5ba61 Mon Sep 17 00:00:00 2001 From: Christoph Anton Mitterer Date: Tue, 15 Nov 2022 22:30:09 +0100 Subject: [PATCH] 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 --- btrbk | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/btrbk b/btrbk index e0bffd1..bc9f708 100755 --- a/btrbk +++ b/btrbk @@ -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};