line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package FusionInventory::Agent::Task::Inventory::Generic::Softwares::Slackware; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
123041773
|
use strict; |
|
1
|
|
|
|
|
10
|
|
|
1
|
|
|
|
|
119
|
|
4
|
1
|
|
|
1
|
|
8
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
137
|
|
5
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
608
|
use FusionInventory::Agent::Tools; |
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
295
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
sub isEnabled { |
9
|
0
|
|
|
0
|
0
|
|
return canRun('pkgtool'); |
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 = getDirectoryHandle( |
19
|
|
|
|
|
|
|
directory => '/var/log/packages', logger => $logger |
20
|
|
|
|
|
|
|
); |
21
|
0
|
0
|
|
|
|
|
return unless $handle; |
22
|
|
|
|
|
|
|
|
23
|
0
|
|
|
|
|
|
while (my $file = readdir($handle)) { |
24
|
0
|
0
|
|
|
|
|
next unless $file =~ /^(.+)([^-]+-[^-]+-[^-]+)$/; |
25
|
0
|
|
|
|
|
|
my $name = $1; |
26
|
0
|
|
|
|
|
|
my $version = $2; |
27
|
|
|
|
|
|
|
|
28
|
0
|
|
|
|
|
|
$inventory->addEntry( |
29
|
|
|
|
|
|
|
section => 'SOFTWARES', |
30
|
|
|
|
|
|
|
entry => { |
31
|
|
|
|
|
|
|
NAME => $name, |
32
|
|
|
|
|
|
|
VERSION => $version |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
); |
35
|
|
|
|
|
|
|
} |
36
|
0
|
|
|
|
|
|
closedir $handle; |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
1; |