line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package FusionInventory::Agent::Task::Inventory::Generic::Softwares::Slackware; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
126933932
|
use strict; |
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
75
|
|
4
|
1
|
|
|
1
|
|
12
|
use warnings; |
|
1
|
|
|
|
|
7
|
|
|
1
|
|
|
|
|
94
|
|
5
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
438
|
use FusionInventory::Agent::Tools; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
280
|
|
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 =~ /^(.+)-(.+)-(i[0-9]86|noarch|x86_64|x86|fw|npmjs)-(.*)$/; |
25
|
0
|
|
|
|
|
|
my $name = $1; |
26
|
0
|
|
|
|
|
|
my $version = $2; |
27
|
0
|
|
|
|
|
|
my $arch = $3; |
28
|
|
|
|
|
|
|
|
29
|
0
|
|
|
|
|
|
$inventory->addEntry( |
30
|
|
|
|
|
|
|
section => 'SOFTWARES', |
31
|
|
|
|
|
|
|
entry => { |
32
|
|
|
|
|
|
|
NAME => $name, |
33
|
|
|
|
|
|
|
VERSION => $version, |
34
|
|
|
|
|
|
|
ARCH => $arch |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
); |
37
|
|
|
|
|
|
|
} |
38
|
0
|
|
|
|
|
|
closedir $handle; |
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
1; |