History

localmodconfig: Rework find_config in streamline_config.pl

Change find_config function to read_config. It now finds the config, reads the config into an array, and returns the array. This makes it a little cleaner and changes the open to use perl's 3 option open.

Bill Pemberton committed 14 years ago

Commit 3f0c5411 parent 224a2571 file · +6 −8Browse files

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

Unified · Split

scripts/kconfig/streamline_config.pl+6−8
@@ -100,7 +100,7 @@ my @searchconfigs = ( · 99 unmodified lines
100100 },
101101 );
102102
103−sub find_config {
103+sub read_config {
104104 foreach my $conf (@searchconfigs) {
105105 my $file = $conf->{"file"};
106106
@@ -115,17 +115,15 @@ sub find_config { · 8 unmodified lines
115115
116116 print STDERR "using config: '$file'\n";
117117
118− open(CIN, "$exec $file |") || die "Failed to run $exec $file";
119− return;
118+ open(my $infile, '-|', "$exec $file") || die "Failed to run $exec $file";
119+ my @x = <$infile>;
120+ close $infile;
121+ return @x;
120122 }
121123 die "No config file found";
122124 }
123125
124−find_config;
125−
126−# Read in the entire config file into config_file
127−my @config_file = <CIN>;
128−close CIN;
126+my @config_file = read_config;
129127
130128 # Parse options
131129 my $localmodconfig = 0;

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