diff options
Diffstat (limited to 'v4l')
-rwxr-xr-x | v4l/scripts/analyze_build.pl | 8 | ||||
-rwxr-xr-x | v4l/scripts/cardlist | 3 | ||||
-rwxr-xr-x | v4l/scripts/make_makefile.pl | 14 | ||||
-rwxr-xr-x | v4l/scripts/prep_commit_msg.pl | 25 | ||||
-rwxr-xr-x | v4l/scripts/usbvision.pl | 40 |
5 files changed, 81 insertions, 9 deletions
diff --git a/v4l/scripts/analyze_build.pl b/v4l/scripts/analyze_build.pl index 945377fa4..9a291a2e3 100755 --- a/v4l/scripts/analyze_build.pl +++ b/v4l/scripts/analyze_build.pl @@ -97,9 +97,15 @@ sub open_makefile($) { next; } if (/(\S+)-objs\s*([:+]?)=\s*(\S.*?)\s*$/) { - print STDERR "Should use ':=' in $file:$.\n$_\n" if ($check && $2 ne ':'); my @files = split(/\s+/, $3); map { s|^(.*)\.o$|$dir/\1| } @files; + if ($2 eq '+') { + # Adding to files + print STDERR "Should use ':=' in $file:$.\n$_\n" if ($check && !exists $multi{"$dir/$1"}); + push @files, @{$multi{"$dir/$1"}}; + } else { + print STDERR "Setting objects twice in $file:$.\n$_\n" if ($check && exists $multi{"$dir/$1"}); + } $multi{"$dir/$1"} = \@files; next; } diff --git a/v4l/scripts/cardlist b/v4l/scripts/cardlist index 901d3fb18..0225d6ebd 100755 --- a/v4l/scripts/cardlist +++ b/v4l/scripts/cardlist @@ -15,3 +15,6 @@ scripts/tuner.pl ../linux/include/media/tuner.h ../linux/drivers/media/video/tun scripts/saa7134.pl ../linux/drivers/media/video/saa7134/saa7134.h ../linux/drivers/media/video/saa7134/saa7134-cards.c \ | perl -ne 's/[ \t]+$//; print' > ../linux/Documentation/video4linux/CARDLIST.saa7134 +scripts/usbvision.pl ../linux/drivers/media/video/usbvision/usbvision-cards.h ../linux/drivers/media/video/usbvision/usbvision-cards.c \ + | perl -ne 's/[ \t]+$//; print' > ../linux/Documentation/video4linux/CARDLIST.usbvision + diff --git a/v4l/scripts/make_makefile.pl b/v4l/scripts/make_makefile.pl index e1e08b578..8711cc5a8 100755 --- a/v4l/scripts/make_makefile.pl +++ b/v4l/scripts/make_makefile.pl @@ -134,12 +134,12 @@ print OUT "\t\@strip --strip-debug \$(inst-m)\n\n"; while (my ($dir, $files) = each %instdir) { print OUT "\t\@echo -e \"\\nInstalling \$(KDIR26)/$dir files:\"\n"; - print OUT "\t\@install -d \$(KDIR26)/$dir\n"; + print OUT "\t\@install -d \$(DESTDIR)\$(KDIR26)/$dir\n"; print OUT "\t\@for i in ", join(' ', keys %$files), ";do "; print OUT "if [ -e \"\$\$i\" ]; then echo -n \"\$\$i \";"; - print OUT " install -m 644 -c \$\$i \$(KDIR26)/$dir; fi; done; echo;\n\n"; + print OUT " install -m 644 -c \$\$i \$(DESTDIR)\$(KDIR26)/$dir; fi; done; echo;\n\n"; } -print OUT "\t/sbin/depmod -a \${KERNELRELEASE}\n\n"; +print OUT "\t/sbin/depmod -a \$(KERNELRELEASE) \$(if \$(DESTDIR),-b \$(DESTDIR))\n\n"; # Creating Remove rule print OUT "media-rminstall::\n"; @@ -149,13 +149,13 @@ while ( my ($dir, $files) = each(%instdir) ) { print OUT "\t\@echo -e \"\\nRemoving old \$(KDIR26)/$dir files:\"\n"; print OUT "\t\@files='", join(' ', keys %$files), "'; "; - print OUT "for i in \$\$files;do if [ -e \$(KDIR26)/$dir/\$\$i ]; then "; + print OUT "for i in \$\$files;do if [ -e \$(DESTDIR)\$(KDIR26)/$dir/\$\$i ]; then "; print OUT "echo -n \"\$\$i \";"; - print OUT " rm \$(KDIR26)/$dir/\$\$i; fi; done; "; + print OUT " rm \$(DESTDIR)\$(KDIR26)/$dir/\$\$i; fi; done; "; - print OUT "for i in \$\$files;do if [ -e \$(KDIR26)/$dir/\$\$i.gz ]; then "; + print OUT "for i in \$\$files;do if [ -e \$(DESTDIR)\$(KDIR26)/$dir/\$\$i.gz ]; then "; print OUT "echo -n \"\$\$i.gz \";"; - print OUT " rm \$(KDIR26)/$dir/\$\$i.gz; fi; done; echo;\n\n"; + print OUT " rm \$(DESTDIR)\$(KDIR26)/$dir/\$\$i.gz; fi; done; echo;\n\n"; } # Print dependencies of Makefile.media diff --git a/v4l/scripts/prep_commit_msg.pl b/v4l/scripts/prep_commit_msg.pl index f4047c6ba..cb0740a5d 100755 --- a/v4l/scripts/prep_commit_msg.pl +++ b/v4l/scripts/prep_commit_msg.pl @@ -1,5 +1,10 @@ #!/usr/bin/perl +my $diff = 'diff'; +if ($ARGV[0] eq '-q') { + $diff = 'qdiff'; + shift; +} my $autopatch = shift; # Get Hg username from environment @@ -45,13 +50,31 @@ if ($user eq "") { } print "# Added/removed/changed files:\n"; -system "hg diff | diffstat -p1 -c"; +system "hg $diff | diffstat -p1 -c"; if (-s $autopatch) { print "#\n# Note, a problem with your patch was detected! These changes were made\n"; print "# automatically: $autopatch\n"; system "diffstat -p0 -c $autopatch"; print "#\n# Please review these changes and see if they belong in your patch or not.\n"; } +if ($diff eq 'qdiff') { + # Use existing mq patch logfile? + open IN, "hg qheader |"; + my @header = <IN>; + close IN; + + if ($#header > 0) { + # Use existing header + print @header; + exit; + } + # No header, use pre-made log message below + + # Hg will strip lines that start with "From: " from mq patch headers! + # In order to stop it, we insert this extra From line at the top, + # Hg will strip it and then leave the real from line alone. + print "From: $user\n\n"; +} print <<"EOF"; # # For better log display, please keep a blank line after subject, after from, diff --git a/v4l/scripts/usbvision.pl b/v4l/scripts/usbvision.pl new file mode 100755 index 000000000..3976e8bd1 --- /dev/null +++ b/v4l/scripts/usbvision.pl @@ -0,0 +1,40 @@ +#!/usr/bin/perl -w +use strict; + +my $new_entry = -1; +my $nr = 0; +my ($id,$subvendor,$subdevice); +my %data; + +while (<>) { + # defines in header file + if (/#define\s*(\w+)\s*(\d+)/) { + $data{$1}->{nr} = $2; + next; + } + # boards + if (/^\s*\[([\w\d_]+)\]\s*=\s*{/) { + $id = $1; + $data{$id}->{id} = $id; + }; + + next unless defined($id); + + if (/USB_DEVICE.*0x([0-9a-fA-F]*).*0x([0-9a-fA-F]*).*driver_info\s*=\s*([\w\d_]+)/) +{ + $subvendor=$1; + $subdevice=$2; + push @{$data{$3}->{subid}}, "$subvendor:$subdevice"; + } + + if (!defined($data{$id}) || !defined($data{$id}->{name})) { + $data{$id}->{name} = $1 if (/\.ModelString\s*=\s*\"([^\"]+)\"/); + } +} + +foreach my $item (sort { $data{$a}->{nr} <=> $data{$b}->{nr} } keys %data) { + printf("%3d -> %-56s", $data{$item}->{nr}, $data{$item}->{name}); + printf(" [%s]",join(",",@{$data{$item}->{subid}})) + if defined($data{$item}->{subid}); + print "\n"; +} |