1 package CPANPLUS::Module::Signature;
8 use Params::Check qw[check];
9 use Module::Load::Conditional qw[can_load];
12 ### detached sig, not actually used afaik --kane ###
16 # my $clone = $self->clone;
17 # $clone->package( $self->package . '.sig' );
19 # return $clone->fetch;
24 my $cb = $self->parent;
25 my $conf = $cb->configure_object;
30 verbose => {default => $conf->get_conf('verbose'), store => \$verbose},
33 check( $tmpl, \%hash ) or return;
35 my $dir = $self->status->extract or (
36 error( loc( "Do not know what dir '%1' was extracted to; ".
37 "Cannot check signature", $self->module ) ),
41 unless( $cb->_chdir( dir => $dir ) ) {
42 error(loc( "Could not chdir to '%1', cannot verify distribution '%2'",
43 $dir, $self->module ));
48 ### check prerequisites
50 my $use_list = { 'Module::Signature' => '0.06' };
51 if( can_load( modules => $use_list, verbose => 1 ) ) {
52 my $rv = Module::Signature::verify();
54 unless ($rv eq Module::Signature::SIGNATURE_OK() or
55 $rv eq Module::Signature::SIGNATURE_MISSING()
57 $flag++; # whoops, bad sig
61 $cb->_chdir( dir => $cwd );