Skip to content

Commit 02f7a91

Browse files
committed
Merge pull request audreyt#5 from wesyoung/master
Adding MODULE_SIGNATURE_AUTHOR ENV override.
2 parents 8ff56de + c085d20 commit 02f7a91

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

lib/Module/Signature.pm

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
package Module::Signature;
2-
$Module::Signature::VERSION = '0.73';
2+
$Module::Signature::VERSION = '0.73_01';
33

44
use 5.005;
55
use strict;
66
use vars qw($VERSION $SIGNATURE @ISA @EXPORT_OK);
7-
use vars qw($Preamble $Cipher $Debug $Verbose $Timeout);
7+
use vars qw($Preamble $Cipher $Debug $Verbose $Timeout $AUTHOR);
88
use vars qw($KeyServer $KeyServerPort $AutoKeyRetrieve $CanKeyRetrieve);
99

1010
use constant CANNOT_VERIFY => '0E0';
@@ -27,6 +27,7 @@ use File::Spec;
2727
);
2828
@ISA = 'Exporter';
2929

30+
$AUTHOR = $ENV{MODULE_SIGNATURE_AUTHOR};
3031
$SIGNATURE = 'SIGNATURE';
3132
$Timeout = $ENV{MODULE_SIGNATURE_TIMEOUT} || 3;
3233
$Verbose = $ENV{MODULE_SIGNATURE_VERBOSE} || 0;
@@ -400,7 +401,9 @@ sub _sign_gpg {
400401
my $gpg = _which_gpg();
401402

402403
local *D;
403-
open D, "| $gpg --clearsign >> $sigfile.tmp" or die "Could not call $gpg: $!";
404+
my $set_key = '';
405+
$set_key = "--default-key $AUTHOR" if($AUTHOR);
406+
open D, "| $gpg $set_key --clearsign >> $sigfile.tmp" or die "Could not call $gpg: $!";
404407
print D $plaintext;
405408
close D;
406409

0 commit comments

Comments
 (0)