Add GPG data to output to patch data in commit.
As a positive (semi) side effect, checking of "Good signature" output of GPG is added.
This commit is contained in:
parent
3104ddb1ff
commit
09d9b415cc
1 changed files with 9 additions and 2 deletions
|
@ -28,8 +28,13 @@ foreach my $patchFile (@ARGV) {
|
||||||
print STDERR "${patchFile}.sig is not readable\n";
|
print STDERR "${patchFile}.sig is not readable\n";
|
||||||
exit 1;
|
exit 1;
|
||||||
}
|
}
|
||||||
system("/usr/bin/gpg ${patchFile}.sig");
|
my $gpgData = "";
|
||||||
if ($? != 0) {
|
open(GPG, "-|", "/usr/bin/gpg ${patchFile}.sig 2>&1") or die "unable to run GPG on ${patchFile}.sig: $!";
|
||||||
|
while (my $line = <GPG>) {
|
||||||
|
$gpgData .= $line;
|
||||||
|
last if ($line =~ /(^|\s+)Good\s+signature/i);
|
||||||
|
}
|
||||||
|
if ($? != 0 or $gpgData !~ /Good\s+signature/i) {
|
||||||
print STDERR "GPG signature check problem on $patchFile\n";
|
print STDERR "GPG signature check problem on $patchFile\n";
|
||||||
exit 1;
|
exit 1;
|
||||||
}
|
}
|
||||||
|
@ -74,6 +79,8 @@ foreach my $patchFile (@ARGV) {
|
||||||
$ENV{GIT_AUTHOR_EMAIL} = 'chet@cwru.edu';
|
$ENV{GIT_AUTHOR_EMAIL} = 'chet@cwru.edu';
|
||||||
open(COMMIT, "|-", "git commit -a -F -") or die "unable to run git: $!";
|
open(COMMIT, "|-", "git commit -a -F -") or die "unable to run git: $!";
|
||||||
print COMMIT $log;
|
print COMMIT $log;
|
||||||
|
print "\nThis patch, in file $patchFile, was downloaded from ftp.gnu.org on 2011-05-29,\nand ${patchFile}.sig was furthermore verified, yielding the following output:\n";
|
||||||
|
print $gpgData;
|
||||||
close COMMIT;
|
close COMMIT;
|
||||||
if ($? != 0) {
|
if ($? != 0) {
|
||||||
print STDERR "$patchFile commit failed!\n";
|
print STDERR "$patchFile commit failed!\n";
|
||||||
|
|
Loading…
Add table
Reference in a new issue