mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-07-06 17:13:24 -05:00
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:
parent
ef1357fc8f
commit
09476e6bdd
1 changed files with 7 additions and 1 deletions
|
|
@ -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 =~ /-/;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue