wok diff ocsinventory-agent/stuff/Tazpkg.pm @ rev 8608
Up: PyQt-x11-gpl 4.8.3
author | Antoine Bodin <gokhlayeh@slitaz.org> |
---|---|
date | Mon Feb 14 17:53:25 2011 +0100 (2011-02-14) |
parents | db6394fb176f |
children | 7e463c50f245 |
line diff
1.1 --- a/ocsinventory-agent/stuff/Tazpkg.pm Sun Jul 12 23:18:03 2009 +0200 1.2 +++ b/ocsinventory-agent/stuff/Tazpkg.pm Mon Feb 14 17:53:25 2011 +0100 1.3 @@ -6,18 +6,22 @@ 1.4 sub check { can_run("tazpkg") } 1.5 1.6 sub run { 1.7 - my $params = shift; 1.8 - my $inventory = $params->{inventory}; 1.9 + my $params = shift; 1.10 + my $inventory = $params->{inventory}; 1.11 1.12 -# use dpkg-query -W -f='${Package}|||${Version}\n' 1.13 - foreach (`tazpkg list `){ 1.14 - if (/^(\S+)\s+([0-9]+.*)\s+(.*)/) { 1.15 - $inventory->addSoftwares({ 1.16 - 'NAME' => $1, 1.17 - 'VERSION' => $2, 1.18 - }); 1.19 - } 1.20 - } 1.21 + # use tazpkg list\n' 1.22 + foreach (`tazpkg list `){ 1.23 + next if (/List of/); 1.24 + next if (/packages installed/); 1.25 + 1.26 + if (/^(\S+)\[24G\s+(\S+)\[42G\s+(\S+)/) { 1.27 + $inventory->addSoftwares({ 1.28 + 'NAME' => $1, 1.29 + 'VERSION' => $2, 1.30 + 'COMMENTS' => $3 1.31 + }); 1.32 + } 1.33 + } 1.34 1.35 } 1.36