Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

file 30 lines (25 sloc) 0.842 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
name 'verify_signature';
description 'Verify SIGNATURE before installing';
author 'Tatsuhiko Miyagawa';

api_version 0.1;

my $cpansign;

hook init => sub {
    my $args = shift;
    $cpansign = $args->{app}->which("cpansign")
        or $args->{app}->diag("! cpansign not found. signature plugin is diabled.\n");
};

hook verify_dist => sub {
    my $args = shift;
    return unless $cpansign;

    if (-e "SIGNATURE") {
        $args->{app}->chat("Verifying the module signature...\n");
        my $out = `$cpansign -v --skip 2>&1`;
        $args->{app}->log($out);
        if ($out =~ /Signature verified OK/) {
            $args->{app}->chat("Signature verified OK!\n");
        } else {
            $args->{app}->diag("! SIGNATURE verification for $args->{module} failed.\n");
            $args->{fail}++;
        }
    }
};
Something went wrong with that request. Please try again.