Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 319807
b: refs/heads/master
c: d4bb58b
h: refs/heads/master
i:
  319805: f7b07d7
  319803: a48836c
  319799: 6e8bb33
  319791: ac3c902
  319775: 99a7831
  319743: e5137e7
v: v3
  • Loading branch information
Steven Rostedt authored and Steven Rostedt committed Jun 19, 2012
1 parent c1b6f37 commit 27655db
Show file tree
Hide file tree
Showing 2 changed files with 105 additions and 12 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 4f4c51c9405a509e9073ff242746e9049c723aae
refs/heads/master: d4bb58b5cb3b6fbf89d0012c199be3954cba9fb3
115 changes: 104 additions & 11 deletions trunk/scripts/kconfig/streamline_config.pl
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,7 @@ sub convert_vars {
# to keep on. If A was on in the original config, B would not have been
# and B would not be turned on by this script.
#
sub parse_config_dep_select
sub parse_config_depends
{
my ($p) = @_;

Expand Down Expand Up @@ -448,26 +448,119 @@ sub parse_config_dep_select
}
}

while ($repeat) {
$repeat = 0;
# Select is treated a bit differently than depends. We call this
# when a config has no prompt and requires another config to be
# selected. We use to just select all configs that selected this
# config, but found that that can balloon into enabling hundreds
# of configs that we do not care about.
#
# The idea is we look at all the configs that select it. If one
# is already in our list of configs to enable, then there's nothing
# else to do. If there isn't, we pick the first config that was
# enabled in the orignal config and use that.
sub parse_config_selects
{
my ($config, $p) = @_;

foreach my $config (keys %configs) {
$config =~ s/^CONFIG_//;
my $next_config;

while ($p =~ /[$valid]/) {

if ($p =~ /^[^$valid]*([$valid]+)/) {
my $conf = "CONFIG_" . $1;

$p =~ s/^[^$valid]*[$valid]+//;

if (defined($depends{$config})) {
# This config has dependencies. Make sure they are also included
parse_config_dep_select $depends{$config};
# Make sure that this config exists in the current .config file
if (!defined($orig_configs{$conf})) {
next;
}

# Check if something other than a module selects this config
if (defined($orig_configs{$conf}) && $orig_configs{$conf} ne "m") {
# we are good with this
return;
}
if (defined($configs{$conf})) {
# A set config selects this config, we are good
return;
}
# Set this config to be selected
if (!defined($next_config)) {
$next_config = $conf;
}
} else {
die "this should never happen";
}
}

if (defined($prompts{$config}) || !defined($selects{$config})) {
next;
# If no possible config selected this, then something happened.
if (!defined($next_config)) {
print STDERR "WARNING: $config is required, but nothing in the\n";
print STDERR " current config selects it.\n";
return;
}

# If we are here, then we found no config that is set and
# selects this config. Repeat.
$repeat = 1;
# Make this config need to be selected
$configs{$next_config} = 1;
}

my %process_selects;

# loop through all configs, select their dependencies.
sub loop_depend {
$repeat = 1;

while ($repeat) {
$repeat = 0;

forloop:
foreach my $config (keys %configs) {

# If this config is not a module, we do not need to process it
if (defined($orig_configs{$config}) && $orig_configs{$config} ne "m") {
next forloop;
}

$config =~ s/^CONFIG_//;

if (defined($depends{$config})) {
# This config has dependencies. Make sure they are also included
parse_config_depends $depends{$config};
}

# If the config has no prompt, then we need to check if a config
# that is enabled selected it. Or if we need to enable one.
if (!defined($prompts{$config}) && defined($selects{$config})) {
$process_selects{$config} = 1;
}
}
}
}

sub loop_select {

foreach my $config (keys %process_selects) {
$config =~ s/^CONFIG_//;

# config has no prompt and must be selected.
parse_config_dep_select $selects{$config};
parse_config_selects $config, $selects{$config};
}
}

while ($repeat) {
# Get the first set of configs and their dependencies.
loop_depend;

$repeat = 0;

# Now we need to see if we have to check selects;
loop_select;
}

my %setconfigs;

# Finally, read the .config file and turn off any module enabled that
Expand Down

0 comments on commit 27655db

Please sign in to comment.