btrbk: tidy deprecation warnings

disable-ssh-password-prompt
Axel Burri 2022-07-27 18:20:33 +02:00
parent c5cb919f6c
commit 687e0508b7
1 changed files with 8 additions and 9 deletions

17
btrbk
View File

@ -4153,13 +4153,17 @@ sub append_config_option($$$$;@)
if($opt->{deprecated}) {
my $dh = $opt->{deprecated}{$value} // $opt->{deprecated}{DEFAULT} // {};
$dh = $opt->{deprecated}{MATCH} if($opt->{deprecated}{MATCH} && ($value =~ $opt->{deprecated}{MATCH}{regex}));
if(my $warn_msg = $dh->{warn}) {
WARN "Found deprecated option \"$key $value\" $error_statement: $warn_msg";
}
if($dh->{ABORT}) {
ERROR "Deprecated (incompatible) option \"$key\" found $error_statement, refusing to continue";
ERROR "Deprecated (incompatible) option \"$key\" found $error_statement, refusing to continue", $dh->{warn};
return undef;
}
my @wmsg = ("Found deprecated option \"$key $value\" $error_statement", $dh->{warn});
if(defined($dh->{replace_key})) {
$key = $dh->{replace_key};
$value = $dh->{replace_value};
push @wmsg, "Using \"$key $value\"";
}
WARN @wmsg;
if($dh->{FAILSAFE_PRESERVE}) {
unless($config_override{FAILSAFE_PRESERVE}) { # warn only once
WARN "Entering failsafe mode:";
@ -4171,11 +4175,6 @@ sub append_config_option($$$$;@)
$config_override{snapshot_preserve_min} = 'all';
return $config;
}
if(defined($dh->{replace_key})) {
$key = $dh->{replace_key};
$value = $dh->{replace_value};
WARN "Using \"$key $value\"";
}
}
if($opt->{allow_multiple}) {