line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Run::Parts; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
# ABSTRACT: Offers functionality of Debian's run-parts tool in Perl |
4
|
|
|
|
|
|
|
|
5
|
5
|
|
|
5
|
|
68545
|
use Modern::Perl; |
|
5
|
|
|
|
|
13
|
|
|
5
|
|
|
|
|
42
|
|
6
|
|
|
|
|
|
|
|
7
|
5
|
|
|
5
|
|
5166
|
use File::Slurp 9999.17; |
|
5
|
|
|
|
|
73985
|
|
|
5
|
|
|
|
|
408
|
|
8
|
5
|
|
|
5
|
|
3227
|
use Run::Parts::Common; |
|
5
|
|
|
|
|
15
|
|
|
5
|
|
|
|
|
894
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
our $VERSION = '0.08'; # VERSION generated by DZP::OurPkgVersion |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub new { |
14
|
10
|
|
|
10
|
1
|
17291
|
my $self = {}; |
15
|
10
|
|
|
|
|
69
|
bless($self, shift); |
16
|
10
|
|
|
|
|
73
|
$self->{dir} = shift; |
17
|
|
|
|
|
|
|
|
18
|
10
|
|
|
|
|
63
|
my $backend = shift; |
19
|
10
|
100
|
|
|
|
45
|
if (defined $backend) { |
20
|
8
|
100
|
100
|
|
|
257
|
if (ref $backend) { |
|
|
100
|
100
|
|
|
|
|
|
|
100
|
|
|
|
|
|
21
|
1
|
|
|
|
|
22
|
$self->{backend} = ref($backend)->new($self->{dir}); |
22
|
|
|
|
|
|
|
} elsif ($backend eq 'debian' or $backend eq 'run-parts') { |
23
|
5
|
|
|
5
|
|
3178
|
use Run::Parts::Debian; |
|
5
|
|
|
|
|
15
|
|
|
5
|
|
|
|
|
326
|
|
24
|
3
|
|
|
|
|
40
|
$self->{backend} = Run::Parts::Debian->new($self->{dir}); |
25
|
|
|
|
|
|
|
} elsif ($backend eq 'perl' or $backend eq 'module') { |
26
|
5
|
|
|
5
|
|
2978
|
use Run::Parts::Perl; |
|
5
|
|
|
|
|
33
|
|
|
5
|
|
|
|
|
2298
|
|
27
|
3
|
|
|
|
|
65
|
$self->{backend} = Run::Parts::Perl->new($self->{dir}); |
28
|
|
|
|
|
|
|
} else { |
29
|
1
|
|
|
|
|
12
|
warn "Unknown backend $backend in use"; |
30
|
1
|
|
|
|
|
247
|
require $backend; |
31
|
|
|
|
|
|
|
# uncoverable statement |
32
|
0
|
|
|
|
|
0
|
$self->{backend} = $backend->new($self->{dir}); |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
} else { |
35
|
|
|
|
|
|
|
# uncoverable branch false |
36
|
2
|
50
|
|
|
|
99
|
if (-x '/bin/run-parts') { |
37
|
2
|
|
|
|
|
41
|
$self->{backend} = Run::Parts::Debian->new($self->{dir}); |
38
|
|
|
|
|
|
|
} else { |
39
|
|
|
|
|
|
|
# uncoverable statement |
40
|
0
|
|
|
|
|
0
|
$self->{backend} = Run::Parts::Perl->new($self->{dir}); |
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
} |
43
|
|
|
|
|
|
|
|
44
|
9
|
|
|
|
|
39
|
return $self; |
45
|
|
|
|
|
|
|
} |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
sub run_parts_command { |
49
|
52
|
|
|
52
|
1
|
495
|
my $self = shift; |
50
|
52
|
|
|
|
|
460
|
return $self->{backend}->run_parts_command(@_); |
51
|
|
|
|
|
|
|
} |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
sub list { |
55
|
28
|
|
|
28
|
1
|
16018
|
my $self = shift; |
56
|
28
|
|
|
|
|
170
|
return $self->run_parts_command('list'); |
57
|
|
|
|
|
|
|
} |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
sub test { |
61
|
16
|
|
|
16
|
1
|
8915
|
my $self = shift; |
62
|
16
|
|
|
|
|
106
|
return $self->run_parts_command('test'); |
63
|
|
|
|
|
|
|
} |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
sub run { |
67
|
8
|
|
|
8
|
1
|
44
|
my $self = shift; |
68
|
8
|
|
|
|
|
64
|
return $self->run_parts_command(); |
69
|
|
|
|
|
|
|
} |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
sub concat { |
73
|
12
|
|
|
12
|
1
|
69
|
my $self = shift; |
74
|
12
|
|
|
|
|
85
|
return lines(map { read_file($_, { chomp => 1 }) } $self->list()); |
|
48
|
|
|
|
|
11665
|
|
75
|
|
|
|
|
|
|
} |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
42; # End of Run::Parts |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
__END__ |