summaryrefslogtreecommitdiffstats
path: root/perl-install/printer
diff options
context:
space:
mode:
authorTill Kamppeter <tkamppeter@mandriva.com>2003-08-27 16:24:23 +0000
committerTill Kamppeter <tkamppeter@mandriva.com>2003-08-27 16:24:23 +0000
commit034ace25617a906128a88b271b6dd02068c36f3f (patch)
treeb2e4865fa9328bd1c4e3b831f3c7181640a8c037 /perl-install/printer
parentd6867c1d7c99edd043c64e3c6667796c28be408a (diff)
downloaddrakx-034ace25617a906128a88b271b6dd02068c36f3f.tar
drakx-034ace25617a906128a88b271b6dd02068c36f3f.tar.gz
drakx-034ace25617a906128a88b271b6dd02068c36f3f.tar.bz2
drakx-034ace25617a906128a88b271b6dd02068c36f3f.tar.xz
drakx-034ace25617a906128a88b271b6dd02068c36f3f.zip
Determine default printer already when reading in the queue data,
this is much faster than running "foomatic-configure" a second time.
Diffstat (limited to 'perl-install/printer')
-rw-r--r--perl-install/printer/main.pm15
1 files changed, 11 insertions, 4 deletions
diff --git a/perl-install/printer/main.pm b/perl-install/printer/main.pm
index 1c9790be4..36e24806e 100644
--- a/perl-install/printer/main.pm
+++ b/perl-install/printer/main.pm
@@ -256,7 +256,7 @@ sub read_configured_queues($) {
#- Poll the queues of the current default spooler
local *F;
open F, ($::testing ? $::prefix : "chroot $::prefix/ ") .
- "foomatic-configure -P -q -s $printer->{SPOOLER} |" or
+ "foomatic-configure -P -q -s $printer->{SPOOLER} -r |" or
die "Could not run foomatic-configure";
eval join('', <F>);
close F;
@@ -265,6 +265,13 @@ sub read_configured_queues($) {
my $i;
my $N = $#QUEUES + 1;
for ($i = 0; $i < $N; $i++) {
+ # Set the default printer
+ $printer->{DEFAULT} = $QUEUES[$i]{queuedata}{queue} if
+ $QUEUES[$i]{queuedata}{default};
+ # Advance to the next entry if the current is a remotely defined
+ # printer
+ next if $QUEUES[$i]{queuedata}{remote};
+ # Add an entry for a locally defined queue
$printer->{configured}{$QUEUES[$i]{queuedata}{queue}} =
$QUEUES[$i];
if (!$QUEUES[$i]{make} || !$QUEUES[$i]{model}) {
@@ -272,9 +279,9 @@ sub read_configured_queues($) {
$printer->{OLD_QUEUE} = $QUEUES[$i]{queuedata}{queue};
my $descr = get_descr_from_ppd($printer);
if ($descr =~ m/^([^\|]*)\|([^\|]*)(\|.*|)$/) {
- $printer->{configured}{$QUEUES[$i]{queuedata}{queue}}{queuedata}{make} ||= $1;
- $printer->{configured}{$QUEUES[$i]{queuedata}{queue}}{queuedata}{model} ||= $2;
- }
+ $printer->{configured}{$QUEUES[$i]{queuedata}{queue}}{queuedata}{make} ||= $1;
+ $printer->{configured}{$QUEUES[$i]{queuedata}{queue}}{queuedata}{model} ||= $2;
+ }
# Read out which PPD file was originally used to set up this
# queue
local *F;