source: ocsinventory-agent/trunk/fuentes/lib/Ocsinventory/Agent/Backend/OS/Generic/Packaging/Deb.pm @ 468

Last change on this file since 468 was 468, checked in by mabarracus, 4 years ago

Copyt trusty code

File size: 651 bytes
Line 
1package Ocsinventory::Agent::Backend::OS::Generic::Packaging::Deb;
2
3use strict;
4use warnings;
5
6sub check { can_run("dpkg") }
7
8sub run {
9  my $params = shift;
10  my $common = $params->{common};
11 
12# use dpkg-query --show --showformat='${Package}|||${Version}\n'
13  foreach(`dpkg-query --show --showformat='\${Package}---\${Version}---\${Installed-Size}---\${Description}\n'`) {
14     if (/^(\S+)---(\S+)---(\S+)---(.*)/) {                     
15       $common->addSoftware ({
16         'NAME'          => $1,
17         'VERSION'       => $2,
18         'FILESIZE'      => $3,
19         'COMMENTS'      => $4,
20         'FROM'          => 'deb'
21       });
22    }
23  }
24}
25
261;
Note: See TracBrowser for help on using the repository browser.