lkml.org 
[lkml]   [2012]   [Jan]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[064/129] kconfig/streamline-config.pl: Simplify backslash line concatination
3.2-stable review patch.  If anyone has any objections, please let me know.

------------------
Content-Length: 1564
Lines: 61

From: Steven Rostedt <srostedt@redhat.com>

commit d060d963e88f3e990cec2fe5214de49de9a49eca upstream.

Simplify the way lines ending with backslashes (continuation) in Makefiles
is parsed. This is needed to implement a necessary fix.

Tested-by: Thomas Lange <thomas-lange2@gmx.de>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
scripts/kconfig/streamline_config.pl | 25 ++++++++++++-------------
1 file changed, 12 insertions(+), 13 deletions(-)

--- a/scripts/kconfig/streamline_config.pl
+++ b/scripts/kconfig/streamline_config.pl
@@ -253,17 +253,22 @@ if ($kconfig) {
# Read all Makefiles to map the configs to the objects
foreach my $makefile (@makefiles) {

- my $cont = 0;
+ my $line = "";

open(MIN,$makefile) || die "Can't open $makefile";
while (<MIN>) {
- my $objs;
-
- # is this a line after a line with a backslash?
- if ($cont && /(\S.*)$/) {
- $objs = $1;
+ # if this line ends with a backslash, continue
+ chomp;
+ if (/^(.*)\\$/) {
+ $line .= $1;
+ next;
}
- $cont = 0;
+
+ $line .= $_;
+ $_ = $line;
+ $line = "";
+
+ my $objs;

# collect objects after obj-$(CONFIG_FOO_BAR)
if (/obj-\$\((CONFIG_[^\)]*)\)\s*[+:]?=\s*(.*)/) {
@@ -271,12 +276,6 @@ foreach my $makefile (@makefiles) {
$objs = $2;
}
if (defined($objs)) {
- # test if the line ends with a backslash
- if ($objs =~ m,(.*)\\$,) {
- $objs = $1;
- $cont = 1;
- }
-
foreach my $obj (split /\s+/,$objs) {
$obj =~ s/-/_/g;
if ($obj =~ /(.*)\.o$/) {



\
 
 \ /
  Last update: 2012-01-24 04:07    [W:0.425 / U:0.408 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site