From patchwork Thu Aug 9 13:23:21 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bill Pemberton X-Patchwork-Id: 1300781 Return-Path: X-Original-To: patchwork-linux-kbuild@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 11C1F3FD8C for ; Thu, 9 Aug 2012 13:32:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755487Ab2HINc2 (ORCPT ); Thu, 9 Aug 2012 09:32:28 -0400 Received: from viridian.itc.Virginia.EDU ([128.143.12.139]:46826 "EHLO viridian.itc.Virginia.EDU" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755467Ab2HINcY (ORCPT ); Thu, 9 Aug 2012 09:32:24 -0400 Received: by viridian.itc.Virginia.EDU (Postfix, from userid 1249) id 7E8C760808; Thu, 9 Aug 2012 09:23:23 -0400 (EDT) From: Bill Pemberton To: linux-kbuild@vger.kernel.org Cc: rostedt@goodmis.org Subject: [PATCH 2/4] localmodconfig: rework find_config in streamline_config.pl Date: Thu, 9 Aug 2012 09:23:21 -0400 Message-Id: <1344518603-19508-3-git-send-email-wfp5p@virginia.edu> X-Mailer: git-send-email 1.7.11.3 In-Reply-To: <1344518603-19508-1-git-send-email-wfp5p@virginia.edu> References: <1344518603-19508-1-git-send-email-wfp5p@virginia.edu> Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org 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 --- 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 = ; -close CIN; +my @config_file = read_config; # Parse options my $localmodconfig = 0;