line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Alien::Build::Plugin::Fetch::Prompt; |
2
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
289281
|
use strict; |
|
2
|
|
|
|
|
11
|
|
|
2
|
|
|
|
|
48
|
|
4
|
2
|
|
|
2
|
|
8
|
use warnings; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
40
|
|
5
|
2
|
|
|
2
|
|
32
|
use 5.010; |
|
2
|
|
|
|
|
6
|
|
6
|
2
|
|
|
2
|
|
668
|
use Alien::Build::Plugin; |
|
2
|
|
|
|
|
17186
|
|
|
2
|
|
|
|
|
13
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
# ABSTRACT: Alien::Build plugin to prompt a user before making external download |
9
|
|
|
|
|
|
|
our $VERSION = '0.61'; # VERSION |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub init |
13
|
|
|
|
|
|
|
{ |
14
|
1
|
|
|
1
|
1
|
34102
|
my($self, $meta) = @_; |
15
|
|
|
|
|
|
|
|
16
|
1
|
|
|
|
|
3
|
$meta->add_requires('share' => 'ExtUtils::MakeMaker' => 0 ); |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
$meta->before_hook( |
19
|
|
|
|
|
|
|
fetch => sub { |
20
|
4
|
|
|
4
|
|
18767
|
my($build, $url) = @_; |
21
|
4
|
|
33
|
|
|
19
|
$url ||= $build->meta_prop->{start_url} || $build->meta_prop->{plugin_download_negotiate_default_url}; |
|
|
|
66
|
|
|
|
|
22
|
4
|
|
100
|
|
|
48
|
my $value = ExtUtils::MakeMaker::prompt("Downloading $url, is that okay?", $ENV{ALIEN_DOWNLOAD} || 'yes'); |
23
|
4
|
100
|
|
|
|
33
|
unless($value =~ /^(y|yes)$/i) |
24
|
|
|
|
|
|
|
{ |
25
|
1
|
|
|
|
|
10
|
$build->log("User refussed to download $url"); |
26
|
|
|
|
|
|
|
# Do a hard exit. If the user insists, there isn't a way to recover really. |
27
|
1
|
|
|
|
|
613
|
exit 2; |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
} |
30
|
1
|
|
|
|
|
14
|
); |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
1; |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
__END__ |