linux/generate-config: disallow conflicting answers on choice questions

These are order dependent and also wrong and bad and no.
This commit is contained in:
K900 2026-06-14 13:08:05 +03:00
commit 09476e6bdd

View file

@ -100,7 +100,13 @@ sub runConfig {
elsif ($line =~ /choice\[(.*)\]: ###$/) {
my $answer = "";
foreach my $name (keys %choices) {
$answer = $choices{$name} if ($answers{$name} || "") eq "y";
if (($answers{$name} || "") eq "y") {
if ($answer eq "") {
$answer = $choices{$name};
} else {
die "conflicting answers!"
}
}
}
print STDERR "CHOICE: $1, ANSWER: $answer\n" if $debug;
print OUT "$answer\n" if $1 =~ /-/;