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