Skip to content

Commit

Permalink
kconfig: Check for if conditions in Kconfig for localmodconfig
Browse files Browse the repository at this point in the history
The streamline_config.pl misses the if conditions for checking
dependencies. For Kconfigs with the following construct:

 if MEDIA_SUPPORT

 config VIDEO_DEV

 [...]

If VIDEO_DEV was enabled, the script will miss the fact that MEDIA_SUPPORT
is also needed.

This patch changes streamline_config.pl to include if conditions into
the dependencies of configs.

Reported-by: Anton Blanchard <anton@sambo.org>
Tested-by: Anton Blanchard <anton@sambo.org>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
  • Loading branch information
Steven Rostedt authored and rostedt committed Jan 6, 2010
1 parent 17263ba commit 13d7e93
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions scripts/kconfig/streamline_config.pl
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,8 @@ sub find_config {
my %objects;
my $var;
my $cont = 0;
my $iflevel = 0;
my @ifdeps;

# prevent recursion
my %read_kconfigs;
Expand All @@ -146,6 +148,15 @@ sub read_kconfig {
$state = "NEW";
$config = $1;

for (my $i = 0; $i < $iflevel; $i++) {
if ($i) {
$depends{$config} .= " " . $ifdeps[$i];
} else {
$depends{$config} = $ifdeps[$i];
}
$state = "DEP";
}

# collect the depends for the config
} elsif ($state eq "NEW" && /^\s*depends\s+on\s+(.*)$/) {
$state = "DEP";
Expand All @@ -166,6 +177,21 @@ sub read_kconfig {
# note if the config has a prompt
$prompt{$config} = 1;

# Check for if statements
} elsif (/^if\s+(.*\S)\s*$/) {
my $deps = $1;
# remove beginning and ending non text
$deps =~ s/^[^a-zA-Z0-9_]*//;
$deps =~ s/[^a-zA-Z0-9_]*$//;

my @deps = split /[^a-zA-Z0-9_]+/, $deps;

$ifdeps[$iflevel++] = join ':', @deps;

} elsif (/^endif/) {

$iflevel-- if ($iflevel);

# stop on "help"
} elsif (/^\s*help\s*$/) {
$state = "NONE";
Expand Down

0 comments on commit 13d7e93

Please sign in to comment.