line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package FusionInventory::Agent::Task::Deploy::ActionProcessor::Action::Mkdir; |
2
|
|
|
|
|
|
|
|
3
|
3
|
|
|
3
|
|
127534913
|
use strict; |
|
3
|
|
|
|
|
12
|
|
|
3
|
|
|
|
|
156
|
|
4
|
3
|
|
|
3
|
|
20
|
use warnings; |
|
3
|
|
|
|
|
7
|
|
|
3
|
|
|
|
|
191
|
|
5
|
|
|
|
|
|
|
|
6
|
3
|
|
|
3
|
|
16
|
use File::Path; |
|
3
|
|
|
|
|
46
|
|
|
3
|
|
|
|
|
257
|
|
7
|
3
|
|
|
3
|
|
565
|
use Encode; |
|
3
|
|
|
|
|
12732
|
|
|
3
|
|
|
|
|
277
|
|
8
|
|
|
|
|
|
|
|
9
|
3
|
|
|
3
|
|
16
|
use English qw(-no_match_vars); |
|
3
|
|
|
|
|
2
|
|
|
3
|
|
|
|
|
33
|
|
10
|
|
|
|
|
|
|
|
11
|
3
|
|
|
3
|
|
1225
|
use UNIVERSAL::require; |
|
3
|
|
|
|
|
5
|
|
|
3
|
|
|
|
|
29
|
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub do { |
14
|
0
|
|
|
0
|
0
|
|
my ($params, $logger) = @_; |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
|
17
|
0
|
|
|
|
|
|
my $msg = []; |
18
|
0
|
|
|
|
|
|
my $status = 1; |
19
|
0
|
|
|
|
|
|
foreach my $dir (@{$params->{list}}) { |
|
0
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
|
21
|
0
|
|
|
|
|
|
my $dir_local = $dir; |
22
|
|
|
|
|
|
|
|
23
|
0
|
0
|
0
|
|
|
|
if ($OSNAME eq 'MSWin32' && Encode::is_utf8($dir)) { |
24
|
0
|
|
|
|
|
|
FusionInventory::Agent::Tools::Win32->require; |
25
|
0
|
|
|
|
|
|
my $localCodepage = FusionInventory::Agent::Tools::Win32::getLocalCodepage(); |
26
|
0
|
|
|
|
|
|
$dir_local = encode($localCodepage, $dir); |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
0
|
0
|
|
|
|
|
if (-d $dir_local) { |
30
|
0
|
|
|
|
|
|
my $m = "Directory $dir already exists"; |
31
|
0
|
|
|
|
|
|
push @$msg, $m; |
32
|
0
|
|
|
|
|
|
$logger->debug($m); |
33
|
|
|
|
|
|
|
} else { |
34
|
0
|
|
|
|
|
|
File::Path::mkpath($dir_local); |
35
|
0
|
0
|
|
|
|
|
if (!-d $dir_local) { |
36
|
0
|
|
|
|
|
|
$status = 0; |
37
|
0
|
|
|
|
|
|
my $m = "Failed to create $dir directory"; |
38
|
0
|
|
|
|
|
|
push @$msg, $m; |
39
|
0
|
|
|
|
|
|
$logger->debug($m); |
40
|
|
|
|
|
|
|
} |
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
} |
43
|
|
|
|
|
|
|
return { |
44
|
0
|
|
|
|
|
|
status => $status, |
45
|
|
|
|
|
|
|
msg => $msg, |
46
|
|
|
|
|
|
|
}; |
47
|
|
|
|
|
|
|
} |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
1; |