line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package FusionInventory::Agent::Task::Inventory::Solaris::Softwares; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
87326246
|
use strict; |
|
1
|
|
|
|
|
9
|
|
|
1
|
|
|
|
|
80
|
|
4
|
1
|
|
|
1
|
|
6
|
use warnings; |
|
1
|
|
|
|
|
5
|
|
|
1
|
|
|
|
|
68
|
|
5
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
426
|
use FusionInventory::Agent::Tools; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
407
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
sub isEnabled { |
9
|
0
|
|
|
0
|
0
|
|
my (%params) = @_; |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
return |
12
|
0
|
|
0
|
|
|
|
!$params{no_category}->{software} && |
13
|
|
|
|
|
|
|
canRun('pkginfo'); |
14
|
|
|
|
|
|
|
} |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
sub doInventory { |
17
|
0
|
|
|
0
|
0
|
|
my (%params) = @_; |
18
|
|
|
|
|
|
|
|
19
|
0
|
|
|
|
|
|
my $inventory = $params{inventory}; |
20
|
0
|
|
|
|
|
|
my $logger = $params{logger}; |
21
|
|
|
|
|
|
|
|
22
|
0
|
|
|
|
|
|
my $handle = getFileHandle( |
23
|
|
|
|
|
|
|
command => 'pkginfo -l', |
24
|
|
|
|
|
|
|
logger => $logger, |
25
|
|
|
|
|
|
|
); |
26
|
|
|
|
|
|
|
|
27
|
0
|
0
|
|
|
|
|
return unless $handle; |
28
|
|
|
|
|
|
|
|
29
|
0
|
|
|
|
|
|
my $software; |
30
|
0
|
|
|
|
|
|
while (my $line = <$handle>) { |
31
|
0
|
0
|
|
|
|
|
if ($line =~ /^\s*$/) { |
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
32
|
0
|
|
|
|
|
|
$inventory->addEntry( |
33
|
|
|
|
|
|
|
section => 'SOFTWARES', |
34
|
|
|
|
|
|
|
entry => $software |
35
|
|
|
|
|
|
|
); |
36
|
0
|
|
|
|
|
|
undef $software; |
37
|
|
|
|
|
|
|
} elsif ($line =~ /PKGINST:\s+(.+)/) { |
38
|
0
|
|
|
|
|
|
$software->{NAME} = $1; |
39
|
|
|
|
|
|
|
} elsif ($line =~ /VERSION:\s+(.+)/) { |
40
|
0
|
|
|
|
|
|
$software->{VERSION} = $1; |
41
|
|
|
|
|
|
|
} elsif ($line =~ /VENDOR:\s+(.+)/) { |
42
|
0
|
|
|
|
|
|
$software->{PUBLISHER} = $1; |
43
|
|
|
|
|
|
|
} elsif ($line =~ /DESC:\s+(.+)/) { |
44
|
0
|
|
|
|
|
|
$software->{COMMENTS} = $1; |
45
|
|
|
|
|
|
|
} |
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
|
48
|
0
|
|
|
|
|
|
close $handle; |
49
|
|
|
|
|
|
|
} |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
1; |