line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package FusionInventory::Agent::Task::Inventory::Generic::Softwares::Slackware; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
153945916
|
use strict; |
|
1
|
|
|
|
|
13
|
|
|
1
|
|
|
|
|
67
|
|
4
|
1
|
|
|
1
|
|
6
|
use warnings; |
|
1
|
|
|
|
|
7
|
|
|
1
|
|
|
|
|
79
|
|
5
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
674
|
use FusionInventory::Agent::Tools; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
385
|
|
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; |