line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Alien::Build::Plugin::Extract::Directory; |
2
|
|
|
|
|
|
|
|
3
|
5
|
|
|
5
|
|
1364
|
use strict; |
|
5
|
|
|
|
|
11
|
|
|
5
|
|
|
|
|
155
|
|
4
|
5
|
|
|
5
|
|
28
|
use warnings; |
|
5
|
|
|
|
|
12
|
|
|
5
|
|
|
|
|
118
|
|
5
|
5
|
|
|
5
|
|
85
|
use 5.008004; |
|
5
|
|
|
|
|
391
|
|
6
|
5
|
|
|
5
|
|
465
|
use Alien::Build::Plugin; |
|
5
|
|
|
|
|
11
|
|
|
5
|
|
|
|
|
39
|
|
7
|
5
|
|
|
5
|
|
44
|
use Alien::Build::Util qw( _mirror ); |
|
5
|
|
|
|
|
13
|
|
|
5
|
|
|
|
|
237
|
|
8
|
5
|
|
|
5
|
|
52
|
use Path::Tiny (); |
|
5
|
|
|
|
|
20
|
|
|
5
|
|
|
|
|
1436
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
# ABSTRACT: Plugin to extract a downloaded directory to a build directory |
11
|
|
|
|
|
|
|
our $VERSION = '2.46'; # VERSION |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
has '+format' => 'd'; |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
sub handles |
18
|
|
|
|
|
|
|
{ |
19
|
4
|
|
|
4
|
1
|
7666
|
my(undef, $ext) = @_; |
20
|
4
|
100
|
|
|
|
39
|
$ext eq 'd' ? 1 : (); |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
sub available |
25
|
|
|
|
|
|
|
{ |
26
|
2
|
|
|
2
|
1
|
3829
|
my(undef, $ext) = @_; |
27
|
2
|
|
|
|
|
6
|
__PACKAGE__->handles($ext); |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
sub init |
31
|
|
|
|
|
|
|
{ |
32
|
2
|
|
|
2
|
1
|
10
|
my($self, $meta) = @_; |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
$meta->register_hook( |
35
|
|
|
|
|
|
|
extract => sub { |
36
|
2
|
|
|
2
|
|
179
|
my($build, $src) = @_; |
37
|
|
|
|
|
|
|
|
38
|
2
|
50
|
|
|
|
47
|
die "not a directory: $src" unless -d $src; |
39
|
|
|
|
|
|
|
|
40
|
2
|
100
|
|
|
|
12
|
if($build->meta_prop->{out_of_source}) |
41
|
|
|
|
|
|
|
{ |
42
|
1
|
|
|
|
|
3
|
$build->install_prop->{extract} = Path::Tiny->new($src)->absolute->stringify; |
43
|
|
|
|
|
|
|
} |
44
|
|
|
|
|
|
|
else |
45
|
|
|
|
|
|
|
{ |
46
|
1
|
|
|
|
|
6
|
my $dst = Path::Tiny->new('.')->absolute; |
47
|
|
|
|
|
|
|
# Please note: _mirror and Alien::Build::Util are ONLY |
48
|
|
|
|
|
|
|
# allowed to be used by core plugins. If you are writing |
49
|
|
|
|
|
|
|
# a non-core plugin it may be removed. That is why it |
50
|
|
|
|
|
|
|
# is private. |
51
|
1
|
|
|
|
|
125
|
_mirror $src => $dst, { verbose => 1 }; |
52
|
|
|
|
|
|
|
} |
53
|
|
|
|
|
|
|
} |
54
|
2
|
|
|
|
|
18
|
); |
55
|
|
|
|
|
|
|
} |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
1; |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
__END__ |