diff options
-rwxr-xr-x | mailimport | 6 | ||||
-rwxr-xr-x | v4l/scripts/hghead.pl | 17 |
2 files changed, 16 insertions, 7 deletions
diff --git a/mailimport b/mailimport index 554ed7eed..08a9ac34f 100755 --- a/mailimport +++ b/mailimport @@ -43,7 +43,7 @@ apply_patch () { patch -s -t -p1 --dry-run -l -N -d $pdir -i $next if [ "$?" != "0" ]; then $head $next - echo "*** ERROR" + echo "*** ERROR: Patch didn't applied well" exit fi fi @@ -55,8 +55,8 @@ apply_patch () { cont=0 $head $next >$TMP2 - if [ "`grep 'Bad formed author' $TMP2`" != "" ]; then - echo Patch bad formed. Please fix. + if [ "`grep '^Bad:' $TMP2`" != "" ]; then + echo "*** ERROR: Patch bad formed. Please fix." sleep 1 nano $next cont=1 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+$//; |