diff options
author | Mauro Carvalho Chehab <mchehab@infradead.org> | 2006-03-10 14:20:58 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2006-03-10 14:20:58 -0300 |
commit | 02474d0a0181592ab0ce78cc5b536b76d23a4799 (patch) | |
tree | 14530ccedf0fc50e83fd25e2dbf15e43f07623d3 /v4l/scripts | |
parent | 502981ebbf37de21383ed0c8c9637fe2d61b5c0a (diff) | |
download | mediapointer-dvb-s2-02474d0a0181592ab0ce78cc5b536b76d23a4799.tar.gz mediapointer-dvb-s2-02474d0a0181592ab0ce78cc5b536b76d23a4799.tar.bz2 |
Added better handling for errors at mailscript
From: Mauro Carvalho Chehab <mchehab@infradead.org>
Now, it checks if author have signed its own patch. Also,
prints better error messages.
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'v4l/scripts')
-rwxr-xr-x | v4l/scripts/hghead.pl | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/v4l/scripts/hghead.pl b/v4l/scripts/hghead.pl index c495abc8b..5c5e63f1f 100755 --- a/v4l/scripts/hghead.pl +++ b/v4l/scripts/hghead.pl @@ -19,6 +19,7 @@ my $maintainer_email=$ENV{CHANGE_LOG_EMAIL_ADDRESS}; my $from=""; my $body=""; my $signed=""; +my $fromname=""; open IN, "<$in"; @@ -57,10 +58,11 @@ while ($line = <IN>) { my $email=$2; $name =~ s/\s+$//; $email =~ s/\s+$//; - $from= "From: $name <$email>\n"; + $fromname="$name <$email>"; + $from= "From: $fromname\n"; next; } - print "Bad formed author\n"; + print "Bad: author line have a wrong syntax\n"; die; } @@ -86,7 +88,7 @@ while ($line = <IN>) { next; } if ($line =~ m/^Acked-by:.*/) { - print $line; + $signed="$signed$line"; next; } @@ -128,12 +130,19 @@ while ($line = <IN>) { close IN; if ($from eq "") { - print "Bad formed author\n"; + 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+$//; |