diff options
author | Mike Isely <isely@pobox.com> | 2006-03-12 22:29:43 -0600 |
---|---|---|
committer | Mike Isely <isely@pobox.com> | 2006-03-12 22:29:43 -0600 |
commit | bb379778f6c9c6aa4dc340c342d5e81a0b9026dd (patch) | |
tree | 3049a3bbf0ba48fd24b62aaff07ab2925dcb3743 /v4l/scripts | |
parent | f9533819a70608d97d03abd7766ffc3f1e3ea655 (diff) | |
parent | 3d611f80a1b8888b9001e1738f24194c694a8bf4 (diff) | |
download | mediapointer-dvb-s2-bb379778f6c9c6aa4dc340c342d5e81a0b9026dd.tar.gz mediapointer-dvb-s2-bb379778f6c9c6aa4dc340c342d5e81a0b9026dd.tar.bz2 |
Merge from master
From: Mike Isely <isely@pobox.com>
Signed-off-by: Mike Isely <isely@pobox.com>
Diffstat (limited to 'v4l/scripts')
-rwxr-xr-x | v4l/scripts/hghead.pl | 152 | ||||
-rwxr-xr-x | v4l/scripts/make_kconfig.pl | 37 |
2 files changed, 189 insertions, 0 deletions
diff --git a/v4l/scripts/hghead.pl b/v4l/scripts/hghead.pl new file mode 100755 index 000000000..ddaef0767 --- /dev/null +++ b/v4l/scripts/hghead.pl @@ -0,0 +1,152 @@ +#!/usr/bin/perl +use strict; +use Date::Parse; + +################################################################# +# analyse diffs + +my $in = shift; +my $line; +my $subject; +my $from=0; +my $sub_ok=0; +my $init=0; +my $num=0; +my $maint_ok=0; +my $noblank=1; +my $maintainer_name=$ENV{CHANGE_LOG_NAME}; +my $maintainer_email=$ENV{CHANGE_LOG_EMAIL_ADDRESS}; +my $from=""; +my $body=""; +my $signed=""; +my $fromname=""; + +open IN, "<$in"; + +while ($line = <IN>) { + if ($line =~ m/Index.*/) { + last; + } + if ($line =~ m/^diff .*/) { + last; + } + if ($line =~ m/^\-\-\- .*/) { + last; + } + if ($line =~ m/^\-\-\-.*/) { + last; + } + if ($line =~ m/^\+\+\+ .*/) { + last; + } + + if ($line =~ m/^Date:\s*(.*)/) { + my $time = str2time($1); +# my $timestr = gmtime($time); + + if ($time) { + print "# Date: $time\n"; + } + next; + } + if ($line =~ m/^From:/) { + if ($line =~ m/^From:[\s\"]*([^\"]*)[\s\"]*<(.*)>/) { + if ($1 eq "") { + next; + } + my $name=$1; + my $email=$2; + $name =~ s/\s+$//; + $email =~ s/\s+$//; + $fromname="$name <$email>"; + $from= "From: $fromname\n"; + next; + } + print "Bad: author line have a wrong syntax\n"; + die; + } + + if ($line =~ m/^Subject:\s*(.*\n)/) { + $subject=$1; + next; + } + + if ($line =~ m;^ .*\/.*\| *[0-9]*;) { + next; + } + if ($line =~m/\d+\s*file.* changed, /) { + next; + } + + if ($line =~ m/^Signed-off-by:.*/) { + $noblank=1; + if ($line =~ m/$maintainer_name/) { + $maint_ok=1; + } + + $signed="$signed$line"; + next; + } + if ($line =~ m/^Acked-by:.*/) { + $signed="$signed$line"; + next; + } + + if ($line =~ m/^[a-zA-Z\-]*:/) { + if ($line =~ m/Changeset:\s*(.*)\n/) { + $num=$1; + } + print "# $line"; + next; + } + + if ($line =~ m|^(V4L\/DVB\s*\(.+\)\s*:.*\n)|) { + $subject=$1; + $line="\n"; + } + + if ($sub_ok == 0) { + $sub_ok=1; + substr( $subject, 0, 1 ) = uc (substr ($subject, 0, 1)); + if ($subject =~ m|V4L\/DVB\s*(.+)|) { + $subject=$1; + } + if ($line =~ m/^\n/) { + next; + } + } + + if ($noblank) { + if ($line =~ m/^\n/) { + next; + } + } + if (!$init) { + $init=1; + $noblank=0; + } + $body="$body$line"; +} +close IN; + +if ($from eq "") { + print "Bad: author doesn't exist!\n"; + die; +} + +if (!$maint_ok) { + $signed=$signed."Signed-off-by: $maintainer_name <$maintainer_email>\n"; +} + +if (!$signed =~ m/$from/) { + print "Bad: Author didn't signed his patch!\n"; + die; +} + +$body=~s/\n+$//; +$body=~s/^\n+$//; + +# First from is used by hg to recognize commiter name +print "#Committer: $maintainer_name <$maintainer_email>\n"; +print "$subject\n$from\n$body\n\n$signed"; + diff --git a/v4l/scripts/make_kconfig.pl b/v4l/scripts/make_kconfig.pl new file mode 100755 index 000000000..f612e83db --- /dev/null +++ b/v4l/scripts/make_kconfig.pl @@ -0,0 +1,37 @@ +#!/usr/bin/perl +use FileHandle; + +my $KDIR=shift; +my $ARCH=shift; + +sub open_kconfig($$) { + my ($dir,$file)=@_; + my $in = new FileHandle; + +print "opening $file\n"; + open $in,"$file"; + while (<$in>) { + if (m;^\s*source[\s\"]+drivers/media/(video|dvb)/Kconfig;) { + next; + } + if (m|^\s*source[\s\"]+([^\n\s\"]+)[\n\s\"]|) { + open_kconfig($dir,"$dir/$1"); + next; + } + s/^main(menu\s\"[^\"]+)/\1 - DON'T CHANGE IT!/; + print OUT $_; + } + close $in; +} + +open OUT,">Kconfig.kern"; +open_kconfig($KDIR,"$KDIR/arch/$ARCH/Kconfig"); +print OUT "endmenu\n"; +close OUT; + +open OUT,">Kconfig"; +print OUT "mainmenu \"V4L/DVB menu\"\n"; +open_kconfig ("../linux","../linux/drivers/media/video/Kconfig"); +open_kconfig ("../linux","../linux/drivers/media/dvb/Kconfig"); +print OUT "source Kconfig.kern\n"; +close OUT; |