line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
1
|
|
|
1
|
|
1176
|
use v5.14.0; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
29
|
|
2
|
1
|
|
|
1
|
|
3
|
use warnings; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
40
|
|
3
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
package OS::Package::Role::Clean; |
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
# ABSTRACT: Provides the clean method. |
7
|
|
|
|
|
|
|
our $VERSION = '0.2.5'; # VERSION |
8
|
|
|
|
|
|
|
|
9
|
1
|
|
|
1
|
|
3
|
use Path::Tiny; |
|
1
|
|
|
|
|
0
|
|
|
1
|
|
|
|
|
40
|
|
10
|
1
|
|
|
1
|
|
31
|
use OS::Package::Log; |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
use Role::Tiny; |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub clean { |
14
|
|
|
|
|
|
|
my $self = shift; |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
if ( defined $self->workdir && -d $self->workdir ) { |
17
|
|
|
|
|
|
|
$LOGGER->info( sprintf 'cleaning work directory: %s', |
18
|
|
|
|
|
|
|
$self->workdir ); |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
path($self->workdir)->remove_tree; |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
if ( defined $self->fakeroot && -d $self->fakeroot ) { |
24
|
|
|
|
|
|
|
$LOGGER->info( sprintf 'cleaning fakeroot directory: %s', |
25
|
|
|
|
|
|
|
$self->fakeroot ); |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
path($self->fakeroot)->remove_tree; |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
return 1; |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
1; |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
__END__ |