diff options
author | Mauro Carvalho Chehab <mchehab@infradead.org> | 2006-05-02 09:29:34 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2006-05-02 09:29:34 -0300 |
commit | 91a3da5165321c89bb4a35937d47f19ac53f8899 (patch) | |
tree | 5301c461f7ed91efeb18e99e45e1e268307dd1f4 /v4l/scripts | |
parent | 750b7fc24921cc90350f9fcb3eab4edbaeeb5965 (diff) | |
download | mediapointer-dvb-s2-91a3da5165321c89bb4a35937d47f19ac53f8899.tar.gz mediapointer-dvb-s2-91a3da5165321c89bb4a35937d47f19ac53f8899.tar.bz2 |
Fix checking logic for a broken xawtv version
From: Mauro Carvalho Chehab <mchehab@infradead.org>
moved from if to ifndef.
Also added such tests at gentree script. Gentree updated to its latest
version.
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'v4l/scripts')
-rwxr-xr-x | v4l/scripts/gentree.pl | 77 |
1 files changed, 50 insertions, 27 deletions
diff --git a/v4l/scripts/gentree.pl b/v4l/scripts/gentree.pl index 0ae296b93..de91722a7 100755 --- a/v4l/scripts/gentree.pl +++ b/v4l/scripts/gentree.pl @@ -2,12 +2,10 @@ use strict; use File::Find; use Fcntl ':mode'; -use Cwd; my $VER = shift; my $SRC = shift; my $DESTDIR = shift; -my $cwd; my $extra; @@ -70,9 +68,9 @@ sub filter_source ($$) { if ($line =~ m/^#include \"compat.h\"/) { next; } - if ($line =~ m/[\$]Id:/) { - next; - } +# if ($line =~ m/[\$]Id:/) { +# next; +# } if ($line =~ /^#ifdef MM_KERNEL/) { chomp($line); $state{$level} = "if"; @@ -81,8 +79,12 @@ sub filter_source ($$) { $level++; next; } - if ($line =~ /^\s*#if 0\s.*[Kk][Ee][Ee][Pp].*/) { - print OUT "#if 0\n"; + if ($line =~ m|^\s*\#if\s+0\s*\/[\*]\s*[Kk][Ee].[Pp]\s*[\*]\/(.*)|) { + if ($1 eq ";") { + print OUT "#if 0\n"; + } else { + print OUT "#if 0$1\n"; + } chomp($line); $state{$level} = "ifother"; $if{$level} = 0; @@ -90,6 +92,30 @@ sub filter_source ($$) { $level++; next; } + if ($line =~ /^#ifdef\sSTV0297_CS2/) { + chomp($line); + $state{$level} = "if"; + $if{$level} = 0; + print STDERR "/* BP #if 0 state=$state{$level} if=$if{$level} level=$level ($line) */\n" if $DEBUG; + $level++; + next; + } + if ($line =~ /^#ifndef\sBROKEN_XAWTV/) { + chomp($line); + $state{$level} = "if"; + $if{$level} = 1; + print STDERR "/* BP #if 0 state=$state{$level} if=$if{$level} level=$level ($line) */\n" if $DEBUG; + $level++; + next; + } + if ($line =~ /^#ifndef\sSTV0297_CS2/) { + chomp($line); + $state{$level} = "if"; + $if{$level} = 1; + print STDERR "/* BP #if 1 state=$state{$level} if=$if{$level} level=$level ($line) */\n" if $DEBUG; + $level++; + next; + } if ($line =~ /^#if 0/) { chomp($line); $state{$level} = "if"; @@ -98,8 +124,8 @@ sub filter_source ($$) { $level++; next; } - if ($line =~ /^#if 1\s.*[Kk][Ee][Ee][Pp].*/) { - print OUT "#if 1\n"; + if ($line =~ m|^\s*\#if\s+1\s*\/[\*]\s*[Kk][Ee].[Pp]\s*[\*]\/(.*)|) { + print OUT "#if 1$1\n"; $state{$level} = "ifother"; $if{$level} = 1; print STDERR "/* BP #if 1 (keep) state=$state{$level} if=$if{$level} level=$level ($line) */\n" if $DEBUG; @@ -122,15 +148,15 @@ sub filter_source ($$) { $level++; next; } - if ($line =~ /^#if.*I2C_CLASS_TV_ANALOG/) { + if ($line =~ /^#if.*CONFIG_XC3028/) { chomp($line); $state{$level} = "if"; - $if{$level} = 1; + $if{$level} = 0; print STDERR "/* BP #if 1 state=$state{$level} if=$if{$level} level=$level ($line) */\n" if $DEBUG; $level++; next; } - if ($line =~ /^#ifndef.\s*I2C_DF_DUMMY/) { + if ($line =~ /^#if.*I2C_CLASS_TV_ANALOG/) { chomp($line); $state{$level} = "if"; $if{$level} = 1; @@ -138,22 +164,22 @@ sub filter_source ($$) { $level++; next; } - if ($line =~ /^#if.*I2C_CLASS_TV_DIGITAL/) { + if ($line =~ /^#ifndef.\s*I2C_PEC/) { chomp($line); $state{$level} = "if"; - $if{$level} = 1; + $if{$level} = 0; print STDERR "/* BP #if 1 state=$state{$level} if=$if{$level} level=$level ($line) */\n" if $DEBUG; $level++; next; } - if ($line =~ /^#if.*CONFIG_XC3028/) { + if ($line =~ /^#if.*I2C_CLASS_TV_DIGITAL/) { chomp($line); $state{$level} = "if"; - $if{$level} = 0; - print STDERR "/* BP #if 1 state=$state{$level} if=$if{$level} level=$level$ + $if{$level} = 1; + print STDERR "/* BP #if 1 state=$state{$level} if=$if{$level} level=$level ($line) */\n" if $DEBUG; $level++; next; - } + } if ($line =~ /^#if.*BTTV_VERSION_CODE/) { chomp($line); $line =~ s@^#if\s*@@; @@ -280,9 +306,7 @@ sub parse_dir { return; } - my $mode = (lstat("$cwd/$file"))[2]; - -# printf "Permissions of %s/%s are %04o (dir=%s\n", $cwd,$file, $mode, cwd; + my $mode = (lstat("$file"))[2]; if ($mode & S_IFDIR) { return; @@ -291,14 +315,14 @@ sub parse_dir { $srcdir =~ s/(.)/\[$1\]/g; my $f2 = $file; - $f2 =~ s,^$srcdir,$cwd/$DESTDIR/,; + $f2 =~ s,^$srcdir,$DESTDIR/,; print "from $file to $f2\n"; my $tmp = "/tmp/src.$$"; if ($file =~ m/.*\.[ch]$/) { - filter_source("$cwd/$file","$tmp"); + filter_source("$file","$tmp"); } else { - system("cp $cwd/$file $tmp"); + system("cp $file $tmp"); } my $dir = $f2; @@ -315,12 +339,11 @@ sub parse_dir { my $patchtmploc = "/tmp/temp.patch"; -printf STDERR <<EOF,$VER,$CODE; +printf <<EOF,$VER,$CODE; kernel is %s (0x%x) EOF -print STDERR "finding files at $SRC\n"; +print "finding files at $SRC\n"; -$cwd=cwd; find(\&parse_dir, $SRC); |