diff options
Diffstat (limited to 'v4l/scripts')
-rwxr-xr-x | v4l/scripts/hghead.pl | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/v4l/scripts/hghead.pl b/v4l/scripts/hghead.pl index dd4cedee6..7b3f3106d 100755 --- a/v4l/scripts/hghead.pl +++ b/v4l/scripts/hghead.pl @@ -47,15 +47,22 @@ while ($line = <IN>) { if ($line =~ m/^Date:\s*(.*)/) { my $time = str2time($1); -# my $timestr = gmtime($time); if ($time) { - print "# Date: $time\n"; + print "#Date: $1\n"; } next; } - if ($line =~ m/^From:/) { - if ($line =~ m/^From:[\s\"]*([^\"]*)[\s\"]*<(.*)>/) { + + my $tag=$line; + my $arg=$line; + $tag =~ s/\s*([^\s]+:)(.*)\n/\1/; + $arg =~ s/\s*([^\s]+:)(.*)\n/\2/; + + $tag =~ tr/A-Z/a-z/; + + if ($tag =~ m/^from:/) { + if ($arg =~ m/^[\s\"]*([^\"]*)[\s\"]*<(.*)>/) { if ($1 eq "") { next; } @@ -75,8 +82,8 @@ while ($line = <IN>) { die; } - if ($line =~ m/^Subject:\s*(.*\n)/) { - $subject=$1; + if ($tag =~ m/^subject:/) { + $subject="$arg\n"; next; } @@ -87,7 +94,7 @@ while ($line = <IN>) { next; } - if ($line =~ m/^Signed-off-by:.*/) { + if ($tag =~ m/^signed-off-by:.*/) { $noblank=1; if ($line =~ m/$maintainer_name/) { $maint_ok=1; @@ -110,8 +117,7 @@ while ($line = <IN>) { next; } - - if ($line =~ m/^(Acked-by|Acked-By|acked-by|Thanks-to|cc|CC|Cc):.*/) { + if ($tag =~ m/^(acked-by|thanks-to|reviewed-by|cc):/) { $signed="$signed$line"; next; } @@ -120,7 +126,7 @@ while ($line = <IN>) { if ($line =~ m/Changeset:\s*(.*)\n/) { $num=$1; } -# print "# $line"; + print "# $line"; next; } |