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