Subversion Repositories camp_sysinfo_client_3

Rev

Rev 87 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 87 Rev 233
Line 1... Line 1...
1
#!/usr/bin/env perl
1
#!/usr/bin/env perl
2
use warnings;
2
use warnings;
3
use strict;  
3
use strict;  
4
 
4
 
-
 
5
use utf8;                                # Source code encoded using UTF-8
-
 
6
 
5
# Description: Get software installed by dpkg or apt(itutde) (Debian)
7
# Description: Get software installed by dpkg or apt(itutde) (Debian)
6
 
8
 
7
our $VERSION = '1.2';
9
our $VERSION = '1.2';
8
 
10
 
9
# Debian software module for sysinfo client
11
# Debian software module for sysinfo client
Line 25... Line 27...
25
 
27
 
26
my $CATEGORY = 'software';
28
my $CATEGORY = 'software';
27
 
29
 
28
my @packageList  = split( "\n", qx($dpkg -l | $grep ^i));
30
my @packageList  = split( "\n", qx($dpkg -l | $grep ^i));
29
chomp @packageList;
31
chomp @packageList;
-
 
32
 
30
for ( my $i = 0; $i < @packageList; $i++ ) {
33
for ( my $i = 0; $i < @packageList; $i++ ) {
-
 
34
   utf8::encode( $packageList[$i] );
31
   my ($status,$package, $version, @description) = split ' ', $packageList[$i];
35
   my ($status,$package, $version, @description) = split ' ', $packageList[$i];
32
   print "$CATEGORY\t$package\tversion\t$version\n";
36
   print "$CATEGORY\t$package\tversion\t$version\n";
33
   print "$CATEGORY\t$package\tdescription\t" . join(" ", @description) . "\n";
37
   print "$CATEGORY\t$package\tdescription\t" . join(" ", @description) . "\n";
34
}
38
}