read_recap: Delete from %config
any status values missing from recap
This commit is contained in:
parent
c9cdb96086
commit
989f8be8c3
2 changed files with 7 additions and 2 deletions
|
@ -1633,6 +1633,7 @@ sub read_recap {
|
|||
%opt = ();
|
||||
$saved_recap = _read_config(\%recap, $globals, "##\\s*$program-$version\\s*", $file);
|
||||
%opt = %saved;
|
||||
$recap{$_} //= {} for keys(%config);
|
||||
for my $h (keys(%recap)) {
|
||||
next if !exists($config{$h});
|
||||
# Only status variables are copied from `%recap` into `%config` because the recap should
|
||||
|
@ -1647,9 +1648,14 @@ sub read_recap {
|
|||
# `$recap{$h}{'status-ipv4'}` directly.
|
||||
for my $v (qw(atime mtime wtime ipv4 ipv6 status-ipv4 status-ipv6
|
||||
warned-min-interval warned-min-error-interval)) {
|
||||
$config{$h}{$v} = $recap{$h}{$v} if exists($recap{$h}{$v});
|
||||
if (exists($recap{$h}{$v})) {
|
||||
$config{$h}{$v} = $recap{$h}{$v};
|
||||
} else {
|
||||
delete($config{$h}{$v});
|
||||
}
|
||||
}
|
||||
delete($recap{$h}) if !%{$recap{$h}};
|
||||
}
|
||||
}
|
||||
######################################################################
|
||||
## parse_assignments(string) return (rest, %variables)
|
||||
|
|
|
@ -137,7 +137,6 @@ my @test_cases = (
|
|||
'warned-min-error-interval' => $DOES_NOT_EXIST,
|
||||
# `var_a` should remain untouched.
|
||||
}},
|
||||
want_config_changes_TODO => "longstanding bug",
|
||||
},
|
||||
{
|
||||
desc => "non-recap vars are not loaded to %recap or copied to %config",
|
||||
|
|
Loading…
Reference in a new issue