line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package FusionInventory::Agent::Task::Deploy::ActionProcessor::Action::Delete; |
2
|
|
|
|
|
|
|
|
3
|
4
|
|
|
4
|
|
159840329
|
use strict; |
|
4
|
|
|
|
|
16
|
|
|
4
|
|
|
|
|
191
|
|
4
|
4
|
|
|
4
|
|
25
|
use warnings; |
|
4
|
|
|
|
|
8
|
|
|
4
|
|
|
|
|
224
|
|
5
|
|
|
|
|
|
|
|
6
|
4
|
|
|
4
|
|
32
|
use File::Path; |
|
4
|
|
|
|
|
120
|
|
|
4
|
|
|
|
|
507
|
|
7
|
4
|
|
|
4
|
|
31
|
use UNIVERSAL::require; |
|
4
|
|
|
|
|
8
|
|
|
4
|
|
|
|
|
48
|
|
8
|
|
|
|
|
|
|
|
9
|
4
|
|
|
4
|
|
179
|
use English qw(-no_match_vars); |
|
4
|
|
|
|
|
8
|
|
|
4
|
|
|
|
|
55
|
|
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; |