Skip to content

Commit

Permalink
localmodconfig: Rework find_config in streamline_config.pl
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Bill Pemberton authored and Steven Rostedt committed Aug 16, 2012
1 parent 224a257 commit 3f0c541
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions scripts/kconfig/streamline_config.pl
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ sub dprint {
},
);

sub find_config {
sub read_config {
foreach my $conf (@searchconfigs) {
my $file = $conf->{"file"};

Expand All @@ -115,17 +115,15 @@ sub find_config {

print STDERR "using config: '$file'\n";

open(CIN, "$exec $file |") || die "Failed to run $exec $file";
return;
open(my $infile, '-|', "$exec $file") || die "Failed to run $exec $file";
my @x = <$infile>;
close $infile;
return @x;
}
die "No config file found";
}

find_config;

# Read in the entire config file into config_file
my @config_file = <CIN>;
close CIN;
my @config_file = read_config;

# Parse options
my $localmodconfig = 0;
Expand Down

0 comments on commit 3f0c541

Please sign in to comment.