line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Alien::Base::ModuleBuild::Repository::Local; |
2
|
|
|
|
|
|
|
|
3
|
4
|
|
|
4
|
|
189359
|
use strict; |
|
4
|
|
|
|
|
14
|
|
|
4
|
|
|
|
|
124
|
|
4
|
4
|
|
|
4
|
|
21
|
use warnings; |
|
4
|
|
|
|
|
8
|
|
|
4
|
|
|
|
|
113
|
|
5
|
4
|
|
|
4
|
|
19
|
use Carp; |
|
4
|
|
|
|
|
10
|
|
|
4
|
|
|
|
|
206
|
|
6
|
4
|
|
|
4
|
|
468
|
use File::chdir; |
|
4
|
|
|
|
|
3047
|
|
|
4
|
|
|
|
|
512
|
|
7
|
4
|
|
|
4
|
|
494
|
use File::Copy qw/copy/; |
|
4
|
|
|
|
|
2273
|
|
|
4
|
|
|
|
|
198
|
|
8
|
4
|
|
|
4
|
|
710
|
use Path::Tiny qw( path ); |
|
4
|
|
|
|
|
10155
|
|
|
4
|
|
|
|
|
162
|
|
9
|
4
|
|
|
4
|
|
422
|
use parent 'Alien::Base::ModuleBuild::Repository'; |
|
4
|
|
|
|
|
279
|
|
|
4
|
|
|
|
|
37
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
# ABSTRACT: Local file repository handler |
12
|
|
|
|
|
|
|
our $VERSION = '1.17'; # VERSION |
13
|
|
|
|
|
|
|
|
14
|
1
|
|
|
1
|
0
|
77
|
sub is_network_fetch { 0 } |
15
|
4
|
|
|
4
|
0
|
30
|
sub is_secure_fetch { 1 } |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
sub new { |
18
|
4
|
|
|
4
|
0
|
244
|
my $class = shift; |
19
|
|
|
|
|
|
|
|
20
|
4
|
|
|
|
|
151
|
my $self = $class->SUPER::new(@_); |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
# make location absolute |
23
|
4
|
|
|
|
|
63
|
local $CWD = $self->location; |
24
|
4
|
|
|
|
|
274
|
$self->location("$CWD"); |
25
|
|
|
|
|
|
|
|
26
|
4
|
|
|
|
|
20
|
return $self; |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
sub list_files { |
30
|
4
|
|
|
4
|
0
|
40
|
my $self = shift; |
31
|
|
|
|
|
|
|
|
32
|
4
|
|
|
|
|
13
|
local $CWD = $self->location; |
33
|
|
|
|
|
|
|
|
34
|
4
|
|
|
|
|
184
|
opendir( my $dh, $CWD); |
35
|
|
|
|
|
|
|
my @files = |
36
|
4
|
|
|
|
|
448
|
grep { ! /^\./ } |
|
21
|
|
|
|
|
104
|
|
37
|
|
|
|
|
|
|
readdir $dh; |
38
|
|
|
|
|
|
|
|
39
|
4
|
|
|
|
|
87
|
return @files; |
40
|
|
|
|
|
|
|
} |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
sub get_file { |
43
|
4
|
|
|
4
|
0
|
897
|
my $self = shift; |
44
|
4
|
|
33
|
|
|
17
|
my $file = shift || croak "Must specify file to copy"; |
45
|
|
|
|
|
|
|
|
46
|
4
|
|
|
|
|
10
|
my $full_file = do { |
47
|
4
|
|
|
|
|
15
|
local $CWD = $self->location; |
48
|
4
|
50
|
|
|
|
205
|
croak "Cannot find file: $file" unless -e $file; |
49
|
4
|
|
|
|
|
57
|
path($file)->absolute->stringify; |
50
|
|
|
|
|
|
|
}; |
51
|
|
|
|
|
|
|
|
52
|
4
|
|
|
|
|
1022
|
copy $full_file, $CWD; |
53
|
|
|
|
|
|
|
|
54
|
4
|
|
|
|
|
2450
|
return $file; |
55
|
|
|
|
|
|
|
} |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
1; |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
__END__ |