wok-stable diff ocsinventory-agent/stuff/Tazpkg.pm @ rev 4466
mirror-tools/mkpkgiso: remove hg dependancy
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Mon Nov 09 15:44:14 2009 +0100 (2009-11-09) |
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 Nov 09 15:44:14 2009 +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