From 63d3fd5d25fd96cd428456099b9b2353db4e10cc Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Thu, 17 Oct 2002 14:46:23 +0000 Subject: - printerdrake::auto_detect(local, net, smb): o split into local_detect, net_detect, net_smb_detect o detect: return all printers - printer: consolidate all *help_output into help_output --- perl-install/printer.pm | 30 +++++++++++------------------- 1 file changed, 11 insertions(+), 19 deletions(-) (limited to 'perl-install/printer.pm') diff --git a/perl-install/printer.pm b/perl-install/printer.pm index 7949999ad..c64890ed5 100644 --- a/perl-install/printer.pm +++ b/perl-install/printer.pm @@ -1685,30 +1685,22 @@ sub print_pages($@) { @lpq_output; } -sub lphelp_output { - my ($printer) = @_; - my $queue = $printer->{QUEUE}; - my $lphelp = "/usr/bin/lphelp"; - - local *F; - open F, ($::testing ? $prefix : "chroot $prefix/ ") . "$lphelp $queue |"; - $helptext = join("", ); - close F; - if (!$helptext || ($helptext eq "")) { - $helptext = "Option list not available!\n"; - } - return $helptext; -} - -sub pdqhelp_output { - my ($printer) = @_; +sub help_output { + my ($printer, $spooler) = @_; + my %spoolers = ('lpq' => { + 'help' => "/usr/bin/lphelp %s |" + }, + 'lp' => { + 'help' => "/usr/bin/pdq -h -P %s 2>&1 |" + } + ); my $queue = $printer->{QUEUE}; - my $pdq = "/usr/bin/pdq"; local *F; - open F, ($::testing ? $prefix : "chroot $prefix/ ") . "$pdq -h -P $queue 2>&1 |"; + open F, ($::testing ? $prefix : "chroot $prefix/ ") . sprintf($spoolers{$spooler}{help}, $queue); $helptext = join("", ); close F; + $helptext = "Option list not available!\n"; if ($spooler eq 'lpq' && (!$helptext || ($helptext eq ""))); return $helptext; } -- cgit v1.2.1