line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package FusionInventory::Agent::Task::Inventory::Generic::Softwares::Pacman; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
125427705
|
use strict; |
|
1
|
|
|
|
|
18
|
|
|
1
|
|
|
|
|
87
|
|
4
|
1
|
|
|
1
|
|
7
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
62
|
|
5
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
415
|
use FusionInventory::Agent::Tools; |
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
266
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
sub isEnabled { |
9
|
0
|
|
|
0
|
0
|
|
return canRun('pacman'); |
10
|
|
|
|
|
|
|
} |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub doInventory { |
13
|
0
|
|
|
0
|
0
|
|
my (%params) = @_; |
14
|
|
|
|
|
|
|
|
15
|
0
|
|
|
|
|
|
my $inventory = $params{inventory}; |
16
|
0
|
|
|
|
|
|
my $logger = $params{logger}; |
17
|
|
|
|
|
|
|
|
18
|
0
|
|
|
|
|
|
my $handle = getFileHandle( |
19
|
|
|
|
|
|
|
logger => $logger, |
20
|
|
|
|
|
|
|
command => 'pacman -Q' |
21
|
|
|
|
|
|
|
); |
22
|
0
|
0
|
|
|
|
|
return unless $handle; |
23
|
|
|
|
|
|
|
|
24
|
0
|
|
|
|
|
|
while (my $line = <$handle>) { |
25
|
0
|
0
|
|
|
|
|
next unless $line =~ /^(\S+)\s+(\S+)/; |
26
|
0
|
|
|
|
|
|
my $name = $1; |
27
|
0
|
|
|
|
|
|
my $version = $2; |
28
|
|
|
|
|
|
|
|
29
|
0
|
|
|
|
|
|
$inventory->addEntry( |
30
|
|
|
|
|
|
|
section => 'SOFTWARES', |
31
|
|
|
|
|
|
|
entry => { |
32
|
|
|
|
|
|
|
NAME => $name, |
33
|
|
|
|
|
|
|
VERSION => $version |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
); |
36
|
|
|
|
|
|
|
} |
37
|
0
|
|
|
|
|
|
close $handle; |
38
|
|
|
|
|
|
|
} |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
1; |