History

localmodconfig: Comments and cleanup for streamline_config.pl

Added some more comments and cleaned up part of the the code to use a named variable instead of one of the special $1 perl variables. No functional changes.

Steven Rostedt committed 14 years ago

Commit 0b58a991 parent 485802a1 file · +9 −4Browse files

Showing the changes to scripts (1 of 1 file). Show all

Unified · Split

scripts/kconfig/streamline_config.pl+9−4
@@ -186,6 +186,7 @@ sub read_kconfig { · 185 unmodified lines
186 $state = "NEW";186 $state = "NEW";
187 $config = $2;187 $config = $2;
188 188
189 # Add depends for 'if' nesting
189 for (my $i = 0; $i < $iflevel; $i++) {190 for (my $i = 0; $i < $iflevel; $i++) {
190 if ($i) {191 if ($i) {
191 $depends{$config} .= " " . $ifdeps[$i];192 $depends{$config} .= " " . $ifdeps[$i];
@@ -204,10 +205,11 @@ sub read_kconfig { · 12 unmodified lines
204 205
205 # Get the configs that select this config206 # Get the configs that select this config
206 } elsif ($state ne "NONE" && /^\s*select\s+(\S+)/) {207 } elsif ($state ne "NONE" && /^\s*select\s+(\S+)/) {
207 if (defined($selects{$1})) {208 my $conf = $1;
208 $selects{$1} .= " " . $config;209 if (defined($selects{$conf})) {
210 $selects{$conf} .= " " . $config;
209 } else {211 } else {
210 $selects{$1} = $config;212 $selects{$conf} = $config;
211 }213 }
212 214
213 # configs without prompts must be selected215 # configs without prompts must be selected
@@ -250,6 +252,7 @@ if ($kconfig) { · 36 unmodified lines
250 read_kconfig($kconfig);252 read_kconfig($kconfig);
251}253}
252 254
255# Makefiles can use variables to define their dependencies
253sub convert_vars {256sub convert_vars {
254 my ($line, %vars) = @_;257 my ($line, %vars) = @_;
255 258
@@ -293,6 +296,7 @@ foreach my $makefile (@makefiles) { · 37 unmodified lines
293 296
294 my $objs;297 my $objs;
295 298
299 # Convert variables in a line (could define configs)
296 $_ = convert_vars($_, %make_vars);300 $_ = convert_vars($_, %make_vars);
297 301
298 # collect objects after obj-$(CONFIG_FOO_BAR)302 # collect objects after obj-$(CONFIG_FOO_BAR)
@@ -373,7 +377,8 @@ while (<LIN>) { · 74 unmodified lines
373close (LIN);377close (LIN);
374 378
375# add to the configs hash all configs that are needed to enable379# add to the configs hash all configs that are needed to enable
376# a loaded module.380# a loaded module. This is a direct obj-${CONFIG_FOO} += bar.o
381# where we know we need bar.o so we add FOO to the list.
377my %configs;382my %configs;
378foreach my $module (keys(%modules)) {383foreach my $module (keys(%modules)) {
379 if (defined($objects{$module})) {384 if (defined($objects{$module})) {

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t