summaryrefslogtreecommitdiffstats
path: root/perl-install
diff options
context:
space:
mode:
authorFrancois Pons <fpons@mandriva.com>2000-01-12 01:59:29 +0000
committerFrancois Pons <fpons@mandriva.com>2000-01-12 01:59:29 +0000
commita1e8b7ab07b5dc9a95c2f2b982f640c5a24f0316 (patch)
tree19b47471cf895e77b9db922bd1728c4aed0a1c15 /perl-install
parent6637583a6e12dcb0276e27772b8ae504004b3ebc (diff)
downloaddrakx-backup-do-not-use-a1e8b7ab07b5dc9a95c2f2b982f640c5a24f0316.tar
drakx-backup-do-not-use-a1e8b7ab07b5dc9a95c2f2b982f640c5a24f0316.tar.gz
drakx-backup-do-not-use-a1e8b7ab07b5dc9a95c2f2b982f640c5a24f0316.tar.bz2
drakx-backup-do-not-use-a1e8b7ab07b5dc9a95c2f2b982f640c5a24f0316.tar.xz
drakx-backup-do-not-use-a1e8b7ab07b5dc9a95c2f2b982f640c5a24f0316.zip
*** empty log message ***
Diffstat (limited to 'perl-install')
-rw-r--r--perl-install/printer.pm17
1 files changed, 13 insertions, 4 deletions
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 (<AVAIL>) {
+ 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=([^:]*):\\/) {