line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Alien::Build::Plugin::Extract::ArchiveZip; |
2
|
|
|
|
|
|
|
|
3
|
5
|
|
|
5
|
|
1559
|
use strict; |
|
5
|
|
|
|
|
19
|
|
|
5
|
|
|
|
|
185
|
|
4
|
5
|
|
|
5
|
|
28
|
use warnings; |
|
5
|
|
|
|
|
10
|
|
|
5
|
|
|
|
|
125
|
|
5
|
5
|
|
|
5
|
|
109
|
use 5.008004; |
|
5
|
|
|
|
|
19
|
|
6
|
5
|
|
|
5
|
|
460
|
use Alien::Build::Plugin; |
|
5
|
|
|
|
|
18
|
|
|
5
|
|
|
|
|
35
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
# ABSTRACT: Plugin to extract a tarball using Archive::Zip |
9
|
|
|
|
|
|
|
our $VERSION = '2.46'; # VERSION |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
has '+format' => 'zip'; |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
sub handles |
16
|
|
|
|
|
|
|
{ |
17
|
0
|
|
|
0
|
1
|
0
|
my($class, $ext) = @_; |
18
|
|
|
|
|
|
|
|
19
|
0
|
0
|
|
|
|
0
|
return 1 if $ext eq 'zip'; |
20
|
|
|
|
|
|
|
|
21
|
0
|
|
|
|
|
0
|
return 0; |
22
|
|
|
|
|
|
|
} |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
sub available |
26
|
|
|
|
|
|
|
{ |
27
|
4
|
|
|
4
|
1
|
17080
|
my(undef, $ext) = @_; |
28
|
|
|
|
|
|
|
|
29
|
4
|
|
100
|
|
|
31
|
!! ( $ext eq 'zip' && eval { require Archive::Zip; 1} ); |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
sub init |
33
|
|
|
|
|
|
|
{ |
34
|
1
|
|
|
1
|
1
|
9
|
my($self, $meta) = @_; |
35
|
|
|
|
|
|
|
|
36
|
1
|
|
|
|
|
7
|
$meta->add_requires('share' => 'Archive::Zip' => 0); |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
$meta->register_hook( |
39
|
|
|
|
|
|
|
extract => sub { |
40
|
0
|
|
|
0
|
|
|
my($build, $src) = @_; |
41
|
0
|
|
|
|
|
|
my $zip = Archive::Zip->new; |
42
|
0
|
|
|
|
|
|
$zip->read($src); |
43
|
0
|
|
|
|
|
|
$zip->extractTree; |
44
|
|
|
|
|
|
|
} |
45
|
1
|
|
|
|
|
8
|
); |
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
1; |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
__END__ |