Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #5 from wesyoung/master
Adding MODULE_SIGNATURE_AUTHOR ENV override.
  • Loading branch information
audreyt committed Feb 25, 2014
2 parents 8ff56de + c085d20 commit 02f7a91
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions lib/Module/Signature.pm
@@ -1,10 +1,10 @@
package Module::Signature;
$Module::Signature::VERSION = '0.73';
$Module::Signature::VERSION = '0.73_01';

use 5.005;
use strict;
use vars qw($VERSION $SIGNATURE @ISA @EXPORT_OK);
use vars qw($Preamble $Cipher $Debug $Verbose $Timeout);
use vars qw($Preamble $Cipher $Debug $Verbose $Timeout $AUTHOR);
use vars qw($KeyServer $KeyServerPort $AutoKeyRetrieve $CanKeyRetrieve);

use constant CANNOT_VERIFY => '0E0';
Expand All @@ -27,6 +27,7 @@ use File::Spec;
);
@ISA = 'Exporter';

$AUTHOR = $ENV{MODULE_SIGNATURE_AUTHOR};
$SIGNATURE = 'SIGNATURE';
$Timeout = $ENV{MODULE_SIGNATURE_TIMEOUT} || 3;
$Verbose = $ENV{MODULE_SIGNATURE_VERBOSE} || 0;
Expand Down Expand Up @@ -400,7 +401,9 @@ sub _sign_gpg {
my $gpg = _which_gpg();

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

Expand Down

0 comments on commit 02f7a91

Please sign in to comment.