wok-next annotate ocsinventory-agent/stuff/Tazpkg.pm @ rev 9815
asunder: fix BUILD_DEPENDS
author | Christophe Lincoln <pankso@slitaz.org> |
---|---|
date | Sun May 15 01:16:27 2011 +0200 (2011-05-15) |
parents | 894c779750dc |
children |
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@3680 | 9 my $params = shift; |
erjo@3680 | 10 my $inventory = $params->{inventory}; |
erjo@3679 | 11 |
erjo@3680 | 12 # use tazpkg list\n' |
erjo@3680 | 13 foreach (`tazpkg list `){ |
erjo@3680 | 14 next if (/List of/); |
erjo@3680 | 15 next if (/packages installed/); |
erjo@3680 | 16 |
erjo@3680 | 17 if (/^(\S+)\[24G\s+(\S+)\[42G\s+(\S+)/) { |
erjo@8699 | 18 $inventory->addSoftware({ |
erjo@3680 | 19 'NAME' => $1, |
erjo@3680 | 20 'VERSION' => $2, |
erjo@3680 | 21 'COMMENTS' => $3 |
erjo@3680 | 22 }); |
erjo@3680 | 23 } |
erjo@3680 | 24 } |
erjo@3679 | 25 |
erjo@3679 | 26 } |
erjo@3679 | 27 |
erjo@3679 | 28 1; |