line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Cinnamon::Local; |
2
|
2
|
|
|
2
|
|
12
|
use strict; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
44
|
|
3
|
2
|
|
|
2
|
|
9
|
use warnings; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
45
|
|
4
|
2
|
|
|
2
|
|
9
|
use Carp (); |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
22
|
|
5
|
2
|
|
|
2
|
|
1419
|
use IPC::Run (); |
|
2
|
|
|
|
|
52519
|
|
|
2
|
|
|
|
|
48
|
|
6
|
|
|
|
|
|
|
|
7
|
2
|
|
|
2
|
|
18
|
use Cinnamon::Logger; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
365
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
sub execute { |
10
|
0
|
|
|
0
|
0
|
|
my ($class, $opt, @cmd) = @_; |
11
|
0
|
|
|
|
|
|
my $result = IPC::Run::run \@cmd, \my $stdin, \my $stdout, \my $stderr; |
12
|
0
|
|
|
|
|
|
chomp for ($stdout, $stderr); |
13
|
|
|
|
|
|
|
|
14
|
0
|
|
|
|
|
|
for my $line (split "\n", $stdout) { |
15
|
0
|
|
|
|
|
|
log info => sprintf "[localhost :: stdout] %s", |
16
|
|
|
|
|
|
|
$line; |
17
|
|
|
|
|
|
|
} |
18
|
0
|
|
|
|
|
|
for my $line (split "\n", $stderr) { |
19
|
0
|
|
|
|
|
|
log info => sprintf "[localhost :: stderr] %s", |
20
|
|
|
|
|
|
|
$line; |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
+{ |
24
|
0
|
|
|
|
|
|
stdout => $stdout, |
25
|
|
|
|
|
|
|
stderr => $stderr, |
26
|
|
|
|
|
|
|
has_error => !$result, |
27
|
|
|
|
|
|
|
error => $?, |
28
|
|
|
|
|
|
|
}; |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
!!1; |