Subversion Repositories camp_sysinfo_client_3

Rev

Rev 237 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
48 rodolico 1
#!/usr/bin/env perl
2
use warnings;
3
use strict;  
4
 
5
# Description: Get software installed by dpkg or apt(itutde) (Debian)
6
 
7
our $VERSION = '1.2';
8
 
9
# Debian software module for sysinfo client
10
# Author: R. W. Rodolico
11
# Date:   2016-04-08
12
 
13
# gets information on software on systems with dpkg on them (Debian)
14
 
15
BEGIN {
16
   push @INC, shift;
17
}
18
 
19
use library;
20
 
21
exit 1 unless &getOperatingSystem() =~ m/bsd/i;
22
 
23
my $pkg = &validCommandOnSystem( 'pkg' );
24
 
25
exit 1 unless $pkg;
26
 
27
my $CATEGORY = 'software';
28
 
29
my @packageList  = split( "\n", qx($pkg info));
30
chomp @packageList;
31
for ( my $i = 0; $i < @packageList; $i++ ) {
32
   $packageList[$i] =~ m/^(.+)-([^ ]+)\s+(.*)/;
33
   print "$CATEGORY\t$1\tversion\t$2\n";
34
   print "$CATEGORY\t$1\tdescription\t$3\n";
35
}