line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package FusionInventory::Agent::Task::Deploy::ActionProcessor::Action::Delete; |
2
|
|
|
|
|
|
|
|
3
|
3
|
|
|
3
|
|
127798286
|
use strict; |
|
3
|
|
|
|
|
11
|
|
|
3
|
|
|
|
|
143
|
|
4
|
3
|
|
|
3
|
|
19
|
use warnings; |
|
3
|
|
|
|
|
7
|
|
|
3
|
|
|
|
|
105
|
|
5
|
|
|
|
|
|
|
|
6
|
3
|
|
|
3
|
|
9
|
use File::Path; |
|
3
|
|
|
|
|
44
|
|
|
3
|
|
|
|
|
222
|
|
7
|
3
|
|
|
3
|
|
16
|
use UNIVERSAL::require; |
|
3
|
|
|
|
|
3
|
|
|
3
|
|
|
|
|
30
|
|
8
|
|
|
|
|
|
|
|
9
|
3
|
|
|
3
|
|
79
|
use English qw(-no_match_vars); |
|
3
|
|
|
|
|
3
|
|
|
3
|
|
|
|
|
37
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
sub do { |
12
|
0
|
|
|
0
|
0
|
|
my ($params, $logger) = @_; |
13
|
|
|
|
|
|
|
|
14
|
0
|
|
|
|
|
|
my $msg = []; |
15
|
0
|
|
|
|
|
|
my $status = 1; |
16
|
|
|
|
|
|
|
|
17
|
0
|
|
|
|
|
|
foreach my $loc (@{$params->{list}}) { |
|
0
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
|
19
|
0
|
|
|
|
|
|
my $loc_local = $loc; |
20
|
|
|
|
|
|
|
|
21
|
0
|
0
|
|
|
|
|
if ($OSNAME eq 'MSWin32') { |
22
|
0
|
|
|
|
|
|
FusionInventory::Agent::Tools::Win32->require; |
23
|
0
|
|
|
|
|
|
my $localCodepage = FusionInventory::Agent::Tools::Win32::getLocalCodepage(); |
24
|
0
|
0
|
|
|
|
|
if (Encode::is_utf8($loc)) { |
25
|
0
|
|
|
|
|
|
$loc_local = encode($localCodepage, $loc); |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
0
|
|
|
|
|
|
File::Path::remove_tree($loc_local); |
30
|
0
|
0
|
|
|
|
|
$status = 0 if -e $loc; |
31
|
0
|
|
|
|
|
|
my $m = "Failed to delete $loc"; |
32
|
0
|
|
|
|
|
|
push @$msg, $m; |
33
|
0
|
|
|
|
|
|
$logger->debug($m); |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
return { |
36
|
0
|
|
|
|
|
|
status => $status, |
37
|
|
|
|
|
|
|
msg => $msg, |
38
|
|
|
|
|
|
|
}; |
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
1; |