From c1b6f37cd2b2f9ff81c13c8136ba3a37f61dd02c Mon Sep 17 00:00:00 2001 From: Steven Rostedt Date: Mon, 18 Jun 2012 21:43:53 -0400 Subject: [PATCH] --- yaml --- r: 319806 b: refs/heads/master c: 4f4c51c9405a509e9073ff242746e9049c723aae h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/scripts/kconfig/streamline_config.pl | 26 ++++++++++++++++++++-- 2 files changed, 25 insertions(+), 3 deletions(-) diff --git a/[refs] b/[refs] index 6ac18b546536..95e4319090c1 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 0b58a99eb27aa522a3cd16ece09c8045b322b9ce +refs/heads/master: 4f4c51c9405a509e9073ff242746e9049c723aae diff --git a/trunk/scripts/kconfig/streamline_config.pl b/trunk/scripts/kconfig/streamline_config.pl index 5c1ce8761205..ab4985f7af79 100644 --- a/trunk/scripts/kconfig/streamline_config.pl +++ b/trunk/scripts/kconfig/streamline_config.pl @@ -113,6 +113,10 @@ sub find_config { find_config; +# Read in the entire config file into config_file +my @config_file = ; +close CIN; + # Parse options my $localmodconfig = 0; my $localyesconfig = 0; @@ -392,7 +396,20 @@ sub convert_vars { } } +# Read the current config, and see what is enabled. We want to +# ignore configs that we would not enable anyway. + +my %orig_configs; my $valid = "A-Za-z_0-9"; + +foreach my $line (@config_file) { + $_ = $line; + + if (/(CONFIG_[$valid]*)=(m|y)/) { + $orig_configs{$1} = $2; + } +} + my $repeat = 1; # @@ -414,6 +431,11 @@ sub parse_config_dep_select $p =~ s/^[^$valid]*[$valid]+//; + # We only need to process if the depend config is a module + if (!defined($orig_configs{$conf}) || !$orig_configs{conf} eq "m") { + next; + } + if (!defined($configs{$conf})) { # We must make sure that this config has its # dependencies met. @@ -450,7 +472,8 @@ sub parse_config_dep_select # Finally, read the .config file and turn off any module enabled that # we could not find a reason to keep enabled. -while() { +foreach my $line (@config_file) { + $_ = $line; if (/CONFIG_IKCONFIG/) { if (/# CONFIG_IKCONFIG is not set/) { @@ -478,7 +501,6 @@ sub parse_config_dep_select } print; } -close(CIN); # Integrity check, make sure all modules that we want enabled do # indeed have their configs set.