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 dpkg on them (Debian)
4
 
5
BEGIN {
6
   push @INC, shift;
7
}
8
 
9
use library;
10
 
11
my $dpkg = &validCommandOnSystem( 'dpkg' );
12
my $grep = &validCommandOnSystem( 'grep' );
13
 
14
exit 1 unless $dpkg && $grep;
15
 
16
my $CATEGORY = 'software';
17
 
18
my @packageList  = split( "\n", qx($dpkg -l | $grep ^i));
19
chomp @packageList;
20
for ( $i = 0; $i < @packageList; $i++ ) {
21
   my ($status,$package, $version, @description) = split ' ', $packageList[$i];
22
   print "$CATEGORY\t$package\tversion\t$version\n";
23
   print "$CATEGORY\t$package\tdescription\t" . join(" ", @description) . "\n";
24
}