Subversion Repositories camp_sysinfo_client_3

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
20 rodolico 1
#!/usr/bin/env perl
2
use warnings;
2 rodolico 3
 
20 rodolico 4
$main::VERSION = '1.0';
5
 
6
# Redhat software module for sysinfo client
7
# Author: R. W. Rodolico
8
# Date:   2016-04-08
2 rodolico 9
# gets information on software on systems with rpm on them (Redhat)
10
 
11
BEGIN {
12
   push @INC, shift;
13
}
14
 
15
use library;
16
 
17
my $rpm = &validCommandOnSystem( 'rpm' );
18
 
19
exit 1 unless $rpm;
20
 
21
my $CATEGORY = 'software';
22
 
23
my @packageList = split( "\n", qx( $rpm -qa --qf "%{NAME}\\t%{VERSION}\\t%{DISTRIBUTION}\\n" ) );
24
chomp @packageList;
25
for ( $i = 0; $i < @packageList; $i++ ) {
26
   my ($package, $version, $distribution)  = split( "\t", $packageList[$i]);
27
   print "$CATEGORY\t$package\tversion\t$version\n";
7 rodolico 28
#   print "$CATEGORY\t$package\tdescription\t" . join(" ", @description) . "\n";
2 rodolico 29
}