"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "lib/Ocsinventory/Agent/Backend/OS/MacOS/Printers.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.

Printers.pm  (Ocsinventory-Unix-Agent-2.6.1):Printers.pm  (Ocsinventory-Unix-Agent-2.8.0)
skipping to change at line 20 skipping to change at line 20
} }
sub run { sub run {
my $params = shift; my $params = shift;
my $common = $params->{common}; my $common = $params->{common};
my $profile = Mac::SysProfile->new(); my $profile = Mac::SysProfile->new();
my $data = $profile->gettype('SPPrintersDataType'); my $data = $profile->gettype('SPPrintersDataType');
return(undef) unless(ref($data) eq 'ARRAY'); return(undef) unless(ref($data) eq 'ARRAY');
my $status = "";
my $description = "";
my $shared = "";
my @shared = "";
my $oslevel = `sw_vers -productVersion`;
if ($oslevel =~ /10\.[3-6]\./) {
$shared = `awk \'/Info / {gsub("Info ",""); printf \$0">"}; /Shared/ {pr
int \$NF}\' /etc/cups/printers.conf 2>/dev/null | grep -i yes`;
@shared = split(/\n/,$shared);
}
foreach my $printer (@$data){ foreach my $printer (@$data){
next if($printer->{'_name'} =~ /^The\sprinters\slist\sis\sempty\.(.*)$/) next if ($printer->{'_name'} =~ /^The\sprinters\slist\sis\sempty\.(.*)$/
; );
$description = "Status: $printer->{'status'}";
next if ($description =~ /^Status:\s$/);
next if ($description =~ /^Status:\sno_info_found$/);
if ($printer->{'default'} eq "Yes") { $description .= " - Default printe
r"; }
if ($oslevel =~ /10\.[3-6]\./) {
foreach my $printShared (@shared) {
my ($thisPrinter,$isShared) = split(/>/,$printShared);
if ($printer->{'_name'} eq $thisPrinter) { $description .= " - Sh
ared: yes"; }
}
} else {
if ($printer->{'shared'} eq "Yes") { $description .= " - Shared: yes"
; }
}
$common->addPrinter({ $common->addPrinter({
NAME => $printer->{'_name'}, NAME => $printer->{'_name'},
DRIVER => $printer->{'ppd'}, DRIVER => $printer->{'ppd'},
PORT => $printer->{'uri'}, PORT => $printer->{'uri'},
DESCRIPTION => $description,
}); });
} }
} }
1; 1;
 End of changes. 3 change blocks. 
5 lines changed or deleted 35 lines changed or added

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