From 09476e6bdd0d7327d7b41e683a3ee7520ce05346 Mon Sep 17 00:00:00 2001 From: K900 Date: Sun, 14 Jun 2026 13:08:05 +0300 Subject: [PATCH] linux/generate-config: disallow conflicting answers on choice questions These are order dependent and also wrong and bad and no. --- pkgs/os-specific/linux/kernel/generate-config.pl | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/pkgs/os-specific/linux/kernel/generate-config.pl b/pkgs/os-specific/linux/kernel/generate-config.pl index 57d3ab739cb6..18d1f2150562 100644 --- a/pkgs/os-specific/linux/kernel/generate-config.pl +++ b/pkgs/os-specific/linux/kernel/generate-config.pl @@ -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 =~ /-/;