kernel generate-config.pl: Show all errors, not just the first

This makes it less frustrating to add a large group of kernel options
via boot.kernelPatches.*.extraConfig.

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
This commit is contained in:
Anders Kaseorg 2019-12-05 02:02:16 -08:00 committed by Bjørn Forsman
parent 9e144d5527
commit 04577a28d6

@ -136,10 +136,12 @@ while (<CONFIG>) {
}
close CONFIG;
my $ret = 0;
foreach my $name (sort (keys %answers)) {
my $f = $requiredAnswers{$name} && $ignoreConfigErrors ne "1"
? sub { die "error: " . $_[0]; } : sub { warn "warning: " . $_[0]; };
? sub { warn "error: " . $_[0]; $ret = -1; } : sub { warn "warning: " . $_[0]; };
&$f("unused option: $name\n") unless defined $config{$name};
&$f("option not set correctly: $name (wanted '$answers{$name}', got '$config{$name}')\n")
if $config{$name} && $config{$name} ne $answers{$name};
}
exit $ret;