diff options
author | Bill Pemberton <wfp5p@virginia.edu> | 2012-08-09 09:23:21 -0400 |
---|---|---|
committer | Steven Rostedt <rostedt@goodmis.org> | 2012-08-16 16:09:16 -0400 |
commit | 3f0c54131679889d64e8b1831bac40c0d64cf511 (patch) | |
tree | c59112444732061b62261d4e97205f9efbc0be33 /scripts | |
parent | 224a257190694f253f7a4c533fd6958d2e5fa669 (diff) |
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.
Signed-off-by: Bill Pemberton <wfp5p@virginia.edu>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/kconfig/streamline_config.pl | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/scripts/kconfig/streamline_config.pl b/scripts/kconfig/streamline_config.pl index e3687f98e0c8..62d64ce5c581 100644 --- a/scripts/kconfig/streamline_config.pl +++ b/scripts/kconfig/streamline_config.pl | |||
@@ -100,7 +100,7 @@ my @searchconfigs = ( | |||
100 | }, | 100 | }, |
101 | ); | 101 | ); |
102 | 102 | ||
103 | sub find_config { | 103 | sub read_config { |
104 | foreach my $conf (@searchconfigs) { | 104 | foreach my $conf (@searchconfigs) { |
105 | my $file = $conf->{"file"}; | 105 | my $file = $conf->{"file"}; |
106 | 106 | ||
@@ -115,17 +115,15 @@ sub find_config { | |||
115 | 115 | ||
116 | print STDERR "using config: '$file'\n"; | 116 | print STDERR "using config: '$file'\n"; |
117 | 117 | ||
118 | open(CIN, "$exec $file |") || die "Failed to run $exec $file"; | 118 | open(my $infile, '-|', "$exec $file") || die "Failed to run $exec $file"; |
119 | return; | 119 | my @x = <$infile>; |
120 | close $infile; | ||
121 | return @x; | ||
120 | } | 122 | } |
121 | die "No config file found"; | 123 | die "No config file found"; |
122 | } | 124 | } |
123 | 125 | ||
124 | find_config; | 126 | my @config_file = read_config; |
125 | |||
126 | # Read in the entire config file into config_file | ||
127 | my @config_file = <CIN>; | ||
128 | close CIN; | ||
129 | 127 | ||
130 | # Parse options | 128 | # Parse options |
131 | my $localmodconfig = 0; | 129 | my $localmodconfig = 0; |