Skip Menu |

This queue is for tickets about the Module-Signature CPAN distribution.

Report information
The Basics
Id: 17769
Status: resolved
Priority: 0/
Queue: Module-Signature

People
Owner: Nobody in particular
Requestors: adamk [...] cpan.org
Cc: ANDK [...] cpan.org
AdminCc:

Bug Information
Severity: Normal
Broken in: 0.53
Fixed in: (no value)



CC: ANDK [...] cpan.org
Subject: Check for gpg fails noisily on Win32 with erroneous error.
When Module::Signature fails to find gpg, it does so noisily, adding a superfluous error to the console. The offending code is -------------------------------------------------------- Module::Signature::_has_gpg(c:/vanilla-perl/perl/site/lib/Module/Signature.pm:13 4): 134: `gpg --version` =~ /GnuPG.*?(\S+)$/m or return; DB<3> n 'gpg' is not recognized as an internal or external command, operable program or batch file. Module::Signature::_verify(c:/vanilla-perl/perl/site/lib/Module/Signature.pm:121 -------------------------------------------------------- The call to gpg needs to first verify that gpg actually exists, or in some other way avoid generating the extra STDERR messages.
128: warn "Cannot use GnuPG or Crypt::OpenPGP, please install either one first!\n"; While you are there, you need to remove that exclamation point. Well, unless the mere fact that Module::Signature is installed means it should have one of the two, in which case you have a bigger problem, because you are installing Module::Signature without the ability to check the remote pgp stuff. This is either critical and shouldn't install, or run of the mill. Perhaps it should even be a skip instead of a warning.
Show quoted text
> The call to gpg needs to first verify that gpg actually exists, or in > some other way avoid generating the extra STDERR messages.
The attached patches use the which() method from File::Which to find the gpg executable, and skip the system call if there isn't one.
--- ..\Makefile.PL Fri Apr 21 13:56:51 2006 +++ Makefile.PL Fri Apr 21 14:45:02 2006 @@ -10,4 +10,6 @@ install_script 'script/cpansign'; +requires(qw/ File::Which 0.05 /); + requires (can_cc() ? 'Digest::SHA' : 'Digest::SHA::PurePerl') unless can_use 'Digest::SHA'
--- ..\Signature.pm Tue Jan 31 04:57:18 2006 +++ lib\Module\Signature.pm Fri Apr 21 14:43:49 2006 @@ -18,4 +18,5 @@ use ExtUtils::Manifest (); +use File::Which (); use Exporter; @@ -132,6 +133,9 @@ sub _has_gpg { - `gpg --version` =~ /GnuPG.*?(\S+)$/m or return; - return $1; + my $gpg = File::Which::which( 'gpg' ); + if (defined $gpg) { + `$gpg --version` =~ /GnuPG.*?(\S+)$/m or return; + return $1; + } }
On Fri Apr 21 09:55:40 2006, CFRANKS wrote: Show quoted text
> > The call to gpg needs to first verify that gpg actually exists, or in > > some other way avoid generating the extra STDERR messages.
> > The attached patches use the which() method from File::Which to find the > gpg executable, and skip the system call if there isn't one.
I believe the rewritten (but not yet released) Makefile.PL uses requires_external_bin, which takes care of that properly.
The latest Module::Signature version on cpan already uses requires_external_bin. In the hope of that being good enough, I'm closing this ticket. If it isn't, please reopen.