mirror of https://github.com/digint/btrbk
btrbk: tidy deprecation warnings
parent
c5cb919f6c
commit
687e0508b7
17
btrbk
17
btrbk
|
@ -4153,13 +4153,17 @@ sub append_config_option($$$$;@)
|
||||||
if($opt->{deprecated}) {
|
if($opt->{deprecated}) {
|
||||||
my $dh = $opt->{deprecated}{$value} // $opt->{deprecated}{DEFAULT} // {};
|
my $dh = $opt->{deprecated}{$value} // $opt->{deprecated}{DEFAULT} // {};
|
||||||
$dh = $opt->{deprecated}{MATCH} if($opt->{deprecated}{MATCH} && ($value =~ $opt->{deprecated}{MATCH}{regex}));
|
$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}) {
|
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;
|
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}) {
|
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:";
|
||||||
|
@ -4171,11 +4175,6 @@ sub append_config_option($$$$;@)
|
||||||
$config_override{snapshot_preserve_min} = 'all';
|
$config_override{snapshot_preserve_min} = 'all';
|
||||||
return $config;
|
return $config;
|
||||||
}
|
}
|
||||||
if(defined($dh->{replace_key})) {
|
|
||||||
$key = $dh->{replace_key};
|
|
||||||
$value = $dh->{replace_value};
|
|
||||||
WARN "Using \"$key $value\"";
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if($opt->{allow_multiple}) {
|
if($opt->{allow_multiple}) {
|
||||||
|
|
Loading…
Reference in New Issue