"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "lib/Ocsinventory/Agent/Backend/OS/MacOS/Packages.pm" between
Ocsinventory-Unix-Agent-2.6.1.tar.gz and Ocsinventory-Unix-Agent-2.8.0.tar.gz

About: Ocsinventory-Agent is a Linux agent for OCS Inventory NG.

Packages.pm  (Ocsinventory-Unix-Agent-2.6.1):Packages.pm  (Ocsinventory-Unix-Agent-2.8.0)
skipping to change at line 29 skipping to change at line 29
my $common = $params->{common}; my $common = $params->{common};
my $profile = Mac::SysProfile->new(); my $profile = Mac::SysProfile->new();
my $data = $profile->gettype('SPApplicationsDataType'); # might need to chec k version of darwin my $data = $profile->gettype('SPApplicationsDataType'); # might need to chec k version of darwin
return unless($data && ref($data) eq 'ARRAY'); return unless($data && ref($data) eq 'ARRAY');
# for each app, normalize the information, then add it to the inventory stac k # for each app, normalize the information, then add it to the inventory stac k
foreach my $app (@$data){ foreach my $app (@$data){
#my $a = $apps->{$app}; #my $a = $apps->{$app};
my $path = $app->{'path'} ? $app->{'path'} : 'unknown';
#Exlude from /System/Library/xxx : you can save 150 entries
if ($path =~ /^\/System\/Library\//) {next;}
if ($path =~ /\/System\/Library\// and $path =~ /^\/Volumes\//) {next;}
#Exlude from xxx/Library/Printers/xxx : you can save 10 entries because
a printer is an app
if ($path =~ /\/Library\/Printers\//) {next;}
my $kind = $app->{'runtime_environment'} ? $app->{'runtime_environment'} : 'UNKNOWN'; my $kind = $app->{'runtime_environment'} ? $app->{'runtime_environment'} : 'UNKNOWN';
my $comments = '['.$kind.']'; my $store = $app->{'app_store'} ? $app->{'app_store'} : 'no';
my $comments = 'AppStore: '.$store.' - Type: '.$kind.' ';
my $bits = $app->{'has64BitIntelCode'} ? $app->{'has64BitIntelCode'} : '
unknown';
if ($bits eq 'yes') {$bits = '64';} else {$bits = '32';}
$common->addSoftware({ $common->addSoftware({
'NAME' => $app->{'_name'}, 'NAME' => $app->{'_name'},
'VERSION' => $app->{'version'} || 'unknown', 'VERSION' => $app->{'version'} || 'unknown',
'COMMENTS' => $comments, 'COMMENTS' => $comments,
'PUBLISHER' => $app->{'info'} || 'unknown', 'PUBLISHER' => $app->{'info'} || 'unknown',
'INSTALLDATE' => $app->{'lastModified'}, 'INSTALLDATE' => $app->{'lastModified'},
'FOLDER' => $path,
'BITSWIDTH' => $bits,
}); });
} }
} }
1; 1;
 End of changes. 3 change blocks. 
2 lines changed or deleted 19 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)