wok-next annotate ocsinventory-agent/stuff/Tazpkg.pm @ rev 3679

Fix: ocsinventory-agent. Add Tazpkg.pm. Fix filesystem reports.
author Eric Joseph-Alexandre <erjo@slitaz.org>
date Sun Jul 12 23:18:03 2009 +0200 (2009-07-12)
parents
children 894c779750dc
rev   line source
erjo@3679 1 package Ocsinventory::Agent::Backend::OS::Generic::Packaging::Tazpkg;
erjo@3679 2
erjo@3679 3 use strict;
erjo@3679 4 use warnings;
erjo@3679 5
erjo@3679 6 sub check { can_run("tazpkg") }
erjo@3679 7
erjo@3679 8 sub run {
erjo@3679 9 my $params = shift;
erjo@3679 10 my $inventory = $params->{inventory};
erjo@3679 11
erjo@3679 12 # use dpkg-query -W -f='${Package}|||${Version}\n'
erjo@3679 13 foreach (`tazpkg list `){
erjo@3679 14 if (/^(\S+)\s+([0-9]+.*)\s+(.*)/) {
erjo@3679 15 $inventory->addSoftwares({
erjo@3679 16 'NAME' => $1,
erjo@3679 17 'VERSION' => $2,
erjo@3679 18 });
erjo@3679 19 }
erjo@3679 20 }
erjo@3679 21
erjo@3679 22 }
erjo@3679 23
erjo@3679 24 1;