From: Steven Rostedt <rostedt@goodmis.org>
To: linux-kernel@vger.kernel.org
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
Bill Pemberton <wfp5p@virginia.edu>
Subject: [PATCH 2/4] localmodconfig: Rework find_config in streamline_config.pl
Date: Mon, 01 Oct 2012 09:30:57 -0400 [thread overview]
Message-ID: <20121001133801.534934513@goodmis.org> (raw)
In-Reply-To: 20121001133055.594443758@goodmis.org
[-- Attachment #1: Type: text/plain, Size: 1418 bytes --]
From: Bill Pemberton <wfp5p@virginia.edu>
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>
---
scripts/kconfig/streamline_config.pl | 14 ++++++--------
1 file changed, 6 insertions(+), 8 deletions(-)
diff --git a/scripts/kconfig/streamline_config.pl b/scripts/kconfig/streamline_config.pl
index e3687f9..62d64ce 100644
--- a/scripts/kconfig/streamline_config.pl
+++ b/scripts/kconfig/streamline_config.pl
@@ -100,7 +100,7 @@ my @searchconfigs = (
},
);
-sub find_config {
+sub read_config {
foreach my $conf (@searchconfigs) {
my $file = $conf->{"file"};
@@ -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;
--
1.7.10.4
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 490 bytes --]
next prev parent reply other threads:[~2012-10-01 13:38 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-10-01 13:30 [PATCH 0/4] [GIT PULL] localmodconfig: clean ups and fixes Steven Rostedt
2012-10-01 13:30 ` [PATCH 1/4] localmodconfig: Set default value for ksource in streamline_config.pl Steven Rostedt
2012-10-01 13:30 ` Steven Rostedt [this message]
2012-10-01 13:30 ` [PATCH 3/4] localmodconfig: Use 3 parameter open " Steven Rostedt
2012-10-01 13:30 ` [PATCH 4/4] localmodconfig: Use my variable for loop " Steven Rostedt
-- strict thread matches above, loose matches on Subject: below --
2012-08-09 13:23 [PATCH 0/4] minor changes to kconfig/streamline_config.pl Bill Pemberton
2012-08-09 13:23 ` [PATCH 2/4] localmodconfig: rework find_config in streamline_config.pl Bill Pemberton
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20121001133801.534934513@goodmis.org \
--to=rostedt@goodmis.org \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@linux-foundation.org \
--cc=wfp5p@virginia.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.