Subversion Repositories camp_sysinfo_client_3

Rev

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

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