btrbk: fix regression: wrong deprecation warnings

Warning for btrfs_commit_delete is always printed, regardless of the
(possibly valid) values.

regression in btrbk-0.32.3

   687e0508b7 btrbk: tidy deprecation warnings
pull/491/head
Axel Burri 2022-08-20 14:24:17 +02:00
parent 411034e93f
commit 116aface3c
1 changed files with 3 additions and 2 deletions

5
btrbk
View File

@ -4095,13 +4095,14 @@ sub append_config_option($$$$;@)
ERROR "Deprecated (incompatible) option \"$key\" found $error_statement, refusing to continue", $dh->{warn}; ERROR "Deprecated (incompatible) option \"$key\" found $error_statement, refusing to continue", $dh->{warn};
return undef; return undef;
} }
my @wmsg = ("Found deprecated option \"$key $value\" $error_statement", $dh->{warn}); my @wmsg;
push @wmsg, "Found deprecated option \"$key $value\" $error_statement", $dh->{warn} if($dh->{warn});
if(defined($dh->{replace_key})) { if(defined($dh->{replace_key})) {
$key = $dh->{replace_key}; $key = $dh->{replace_key};
$value = $dh->{replace_value}; $value = $dh->{replace_value};
push @wmsg, "Using \"$key $value\""; push @wmsg, "Using \"$key $value\"";
} }
WARN @wmsg; WARN @wmsg if(@wmsg);
if($dh->{FAILSAFE_PRESERVE}) { if($dh->{FAILSAFE_PRESERVE}) {
unless($config_override{FAILSAFE_PRESERVE}) { # warn only once unless($config_override{FAILSAFE_PRESERVE}) { # warn only once
WARN "Entering failsafe mode:"; WARN "Entering failsafe mode:";