summaryrefslogtreecommitdiffstats
path: root/perl-install/printer.pm
diff options
context:
space:
mode:
authorFrancois Pons <fpons@mandriva.com>2000-09-01 12:36:09 +0000
committerFrancois Pons <fpons@mandriva.com>2000-09-01 12:36:09 +0000
commit0c928ac011478e29c10950a8f21e4bd7140e2a63 (patch)
treee6ef28ecbe9d82ee895543842ff97fb69f1f15ae /perl-install/printer.pm
parented0e070f2f50f0c2283651e1de0c9bb6713f3c29 (diff)
downloaddrakx-0c928ac011478e29c10950a8f21e4bd7140e2a63.tar
drakx-0c928ac011478e29c10950a8f21e4bd7140e2a63.tar.gz
drakx-0c928ac011478e29c10950a8f21e4bd7140e2a63.tar.bz2
drakx-0c928ac011478e29c10950a8f21e4bd7140e2a63.tar.xz
drakx-0c928ac011478e29c10950a8f21e4bd7140e2a63.zip
*** empty log message ***
Diffstat (limited to 'perl-install/printer.pm')
-rw-r--r--perl-install/printer.pm7
1 files changed, 4 insertions, 3 deletions
diff --git a/perl-install/printer.pm b/perl-install/printer.pm
index ad6e46359..40c034282 100644
--- a/perl-install/printer.pm
+++ b/perl-install/printer.pm
@@ -129,6 +129,7 @@ sub read_configured_queue($) {
if (/^##PRINTTOOL3##\s+$p\s+$p\s+$p\s+$p\s+$p\s+$p\s+$p(?:\s+$p)?/) {
&$flush_current;
$current = {
+ mode => 'lpr',
TYPE => $1 || $2,
GSDRIVER => $3 || $4,
RESOLUTION => $5 || $6,
@@ -238,8 +239,8 @@ sub read_configured_queue($) {
}
}
- #- assume this printing system.
- $printer->{mode} ||= 'lpr';
+ #- assume this printing system, but only if some queue are defined.
+ scalar(keys %{$printer->{configured}}) > 0 and $printer->{mode} ||= 'lpr';
}
sub read_printer_db(;$) {
@@ -320,7 +321,7 @@ sub read_printers_conf {
foreach (<PRINTERS>) {
chomp;
/^\s*#/ and next;
- if (/^\s*<(?:DefaultPrinter|Printer)\s+([^>]*)>/) { $current = { QUEUE => $1, } }
+ if (/^\s*<(?:DefaultPrinter|Printer)\s+([^>]*)>/) { $current = { mode => 'cups', QUEUE => $1, } }
elsif (/\s*<\/Printer>/) { $current->{QUEUE} && $current->{DeviceURI} or next; #- minimal check of synthax.
add2hash($printer->{configured}{$current->{QUEUE}} ||= {}, $current); $current = undef }
elsif (/\s*(\S*)\s+(.*)/) { $current->{$1} = $2 }