From a1e8b7ab07b5dc9a95c2f2b982f640c5a24f0316 Mon Sep 17 00:00:00 2001 From: Francois Pons Date: Wed, 12 Jan 2000 01:59:29 +0000 Subject: *** empty log message *** --- perl-install/printer.pm | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'perl-install') diff --git a/perl-install/printer.pm b/perl-install/printer.pm index e95ccbe78..17f22c226 100644 --- a/perl-install/printer.pm +++ b/perl-install/printer.pm @@ -280,6 +280,15 @@ sub read_printer_db(;$) { %thedb and return; + my %available_devices; #- keep only available devices in our database. + local *AVAIL; open AVAIL, "$prefix/usr/bin/gs --help |"; + foreach () { + if (/^Available devices:/ ... /^\S/) { + @available_devices{split /\s+/, $_} = () if /^\s+/; + } + } + delete $available_devices{''}; + local $_; #- use of while (<... local *DBPATH; #- don't have to do close ... and don't modify globals at least open DBPATH, $dbpath or die "An error has occurred on $dbpath : $!"; @@ -314,8 +323,10 @@ sub read_printer_db(;$) { /EndEntry/ and last WHILE; } } - $thedb{$entryname} = $entry; - $thedb_gsdriver{$entry->{GSDRIVER}} = $entry; + if (exists $available_devices{$entry->{GSDRIVER}}) { + $thedb{$entryname} = $entry; + $thedb_gsdriver{$entry->{GSDRIVER}} = $entry; + } } } @@ -413,10 +424,8 @@ sub read_configured_queue($) { BITSPERPIXEL => $13 || $14, CRLF => $15 || $16, }; - print STDERR "found printer $current->{QUEUE} of type $current->{TYPE} in $prefix/etc/printcap\n"; } elsif (/^([^:]*):\\/) { $current->{QUEUE} = $1; - print STDERR "found printer $current->{QUEUE} of type $current->{TYPE} in $prefix/etc/printcap\n"; } elsif (/^\s+:sd=([^:]*):\\/) { $current->{SPOOLDIR} = $1; } elsif (/^\s+:lp=([^:]*):\\/) { -- cgit v1.2.1