diff options
author | Mauro Carvalho Chehab <mchehab@infradead.org> | 2007-09-12 12:28:43 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2007-09-12 12:28:43 -0300 |
commit | d97a5c24bb8f480281d7bedce89525dab393b142 (patch) | |
tree | 30f552bd46561ba5c7d415ebd2b33c2217bb56e8 /v4l/scripts | |
parent | 663ee60868bfe944eba2d82f21ed3f66e071b92c (diff) | |
download | mediapointer-dvb-s2-d97a5c24bb8f480281d7bedce89525dab393b142.tar.gz mediapointer-dvb-s2-d97a5c24bb8f480281d7bedce89525dab393b142.tar.bz2 |
Improve mailimport scripts
From: Mauro Carvalho Chehab <mchehab@infradead.org>
- Preserve original email's date;
- Handles reviewed-by tag;
- avoids upperscase troubles when processing tags.
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
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; } |