summaryrefslogtreecommitdiffstats
path: root/perl-install/printer.pm
diff options
context:
space:
mode:
authorThierry Vignaud <tvignaud@mandriva.org>2002-10-17 14:46:23 +0000
committerThierry Vignaud <tvignaud@mandriva.org>2002-10-17 14:46:23 +0000
commit63d3fd5d25fd96cd428456099b9b2353db4e10cc (patch)
treea484287726bab4952922ac0a009752ce9e066076 /perl-install/printer.pm
parentcae1ccd930601ee56c8c58adbaa932fc82fcce03 (diff)
downloaddrakx-63d3fd5d25fd96cd428456099b9b2353db4e10cc.tar
drakx-63d3fd5d25fd96cd428456099b9b2353db4e10cc.tar.gz
drakx-63d3fd5d25fd96cd428456099b9b2353db4e10cc.tar.bz2
drakx-63d3fd5d25fd96cd428456099b9b2353db4e10cc.tar.xz
drakx-63d3fd5d25fd96cd428456099b9b2353db4e10cc.zip
- 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
Diffstat (limited to 'perl-install/printer.pm')
-rw-r--r--perl-install/printer.pm30
1 files changed, 11 insertions, 19 deletions
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("", <F>);
- 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("", <F>);
close F;
+ $helptext = "Option list not available!\n"; if ($spooler eq 'lpq' && (!$helptext || ($helptext eq "")));
return $helptext;
}