diff options
author | Trent Piepho <xyzzy@speakeasy.org> | 2009-03-13 03:59:20 -0700 |
---|---|---|
committer | Trent Piepho <xyzzy@speakeasy.org> | 2009-03-13 03:59:20 -0700 |
commit | 043985e41c1b3527cb1574753b3fd71c707a3d39 (patch) | |
tree | 0156106bd0b0a027083eb0e242f005c184bc9f59 | |
parent | 1340daf098275689f8220222447a84e4ec4263b6 (diff) | |
download | mediapointer-dvb-s2-043985e41c1b3527cb1574753b3fd71c707a3d39.tar.gz mediapointer-dvb-s2-043985e41c1b3527cb1574753b3fd71c707a3d39.tar.bz2 |
build: have make_kconfig.pl ignore comments
From: Trent Piepho <xyzzy@speakeasy.org>
It was already ignoring lines that had only comments. But lines with some
non-comment code and then a comment at the end didn't have the comment
stripped. Some modules had incorrect dependencies added because comments
at the end of a "depends on" line were treated as modules names.
I strip the comments from the string that is parsed by the script, but
preserve the original line so it can be printed out with the comment still
in it when making v4l/Kconfig.
Priority: normal
Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
-rwxr-xr-x | v4l/scripts/make_kconfig.pl | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/v4l/scripts/make_kconfig.pl b/v4l/scripts/make_kconfig.pl index 57c663c00..8683ee4d8 100755 --- a/v4l/scripts/make_kconfig.pl +++ b/v4l/scripts/make_kconfig.pl @@ -277,11 +277,13 @@ sub open_kconfig($$) { my $in_help = 0; my $default_seen = 0; my $if; + my $line; print "Opening $file\n" if $debug; open $in, '<', $file or die "File not found: $file"; push @kconfigfiles, $file; while (<$in>) { + $line = $_; # In our Kconfig files, the first non-help line after the # help text always has no indention. Technically, the # help text is ended by just by the indention decreasing, @@ -303,7 +305,7 @@ sub open_kconfig($$) { print OUT "\tdefault n\n"; } print OUT "\tdepends on VIDEO_KERNEL_VERSION\n"; - $_ = sprintf($disabled_msg, $minver{$key}); + $line = sprintf($disabled_msg, $minver{$key}); } next; } @@ -319,10 +321,13 @@ sub open_kconfig($$) { } next if (/^\s*#/ || /^\s*$/); # skip comments and blank lines + # Erase any comments on this line + s/(?<!\\)#(.*)$//; + if (m|^\s*source\s+"([^"]+)"\s*$| || m|^\s*source\s+(\S+)\s*$|) { open_kconfig($dir, "$dir/$1"); - $_ = ''; # don't print the source line itself + $line = ''; # don't print the source line itself next; } @@ -453,13 +458,13 @@ sub open_kconfig($$) { if ($disabled) { $default_seen = 1; - $_ = "\tdefault n\n"; + $line = "\tdefault n\n"; } } else { print "Skipping $file:$. $_" if $debug; } } continue { - print OUT $_; + print OUT $line; } close $in; } |