diff options
Diffstat (limited to 'v4l')
| -rw-r--r-- | v4l/.cvsignore | 7 | ||||
| -rwxr-xr-x | v4l/scripts/gentree.pl | 77 | 
2 files changed, 50 insertions, 34 deletions
| diff --git a/v4l/.cvsignore b/v4l/.cvsignore deleted file mode 100644 index 88be5bcbc..000000000 --- a/v4l/.cvsignore +++ /dev/null @@ -1,7 +0,0 @@ -*.ko -*.o.flags -*.mod.c -.*.cmd -.version -.snapshot -.tmp_versions 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); | 
