summaryrefslogtreecommitdiffstats
path: root/perl-install/printer/data.pm
diff options
context:
space:
mode:
authorThierry Vignaud <tvignaud@mandriva.org>2002-11-15 13:56:05 +0000
committerThierry Vignaud <tvignaud@mandriva.org>2002-11-15 13:56:05 +0000
commit1d7e6ca7127994f9674168aec79d7c0dcb2f395d (patch)
tree919a9a52262db00b0c92785d43d17b0ca7c6bf63 /perl-install/printer/data.pm
parent895e0a61a6b6ee6e06cb97d5f3af015d31b2c9ad (diff)
downloaddrakx-1d7e6ca7127994f9674168aec79d7c0dcb2f395d.tar
drakx-1d7e6ca7127994f9674168aec79d7c0dcb2f395d.tar.gz
drakx-1d7e6ca7127994f9674168aec79d7c0dcb2f395d.tar.bz2
drakx-1d7e6ca7127994f9674168aec79d7c0dcb2f395d.tar.xz
drakx-1d7e6ca7127994f9674168aec79d7c0dcb2f395d.zip
printerdrake::install_spooler() : fix heavy duplication of code
by using %spoolers data structure (function shrunked by 66%)
Diffstat (limited to 'perl-install/printer/data.pm')
-rw-r--r--perl-install/printer/data.pm34
1 files changed, 32 insertions, 2 deletions
diff --git a/perl-install/printer/data.pm b/perl-install/printer/data.pm
index f5230568b..26d9bf2a8 100644
--- a/perl-install/printer/data.pm
+++ b/perl-install/printer/data.pm
@@ -12,22 +12,33 @@ use vars qw(@ISA @EXPORT);
# maybe this should be swtiched :
# $lprcommand{stuff} => $spoolers{stuff}{print_command}
-our %spoolers = ('ppq' => {
+our %spoolers = ('pdq' => {
'help' => "/usr/bin/lphelp %s |",
'print_command' => 'lpr-pdq',
'long_name' => N("PDQ - Print, Don't Queue"),
'short_name' => N("PDQ"),
+ 'packages2add' => [ [ 'pdq' ], [qw(/usr/bin/pdq /usr/X11R6/bin/xpdq)] ],
'alternatives' => [
[ 'lpr', '/usr/bin/lpr-pdq' ],
[ 'lpq', '/usr/bin/lpq-foomatic' ],
[ 'lprm', '/usr/bin/lprm-foomatic' ]
- ]
+ ],
},
'lpd' => {
'help' => "/usr/bin/pdq -h -P %s 2>&1 |",
'print_command' => 'lpr',
'long_name' => N("LPD - Line Printer Daemon"),
'short_name' => N("LPD"),
+ 'boot_spooler' => 'lpd',
+ 'service' => 'lpd',
+ 'packages2add' => [ [qw(lpr net-tools gpr a2ps ImageMagick)],
+ [qw(/usr/sbin/lpf
+ /usr/sbin/lpd
+ /sbin/ifconfig
+ /usr/bin/gpr
+ /usr/bin/a2ps
+ /usr/bin/convert)] ],
+ 'packages2rm' => [ 'LPRng', '/usr/lib/filters/lpf' ],
'alternatives' => [
[ 'lpr', '/usr/bin/lpr-lpd' ],
[ 'lpq', '/usr/bin/lpq-lpd' ],
@@ -39,6 +50,16 @@ our %spoolers = ('ppq' => {
'print_command' => 'lpr-lpd',
'long_name' => N("LPRng - LPR New Generation"),
'short_name' => N("LPRng"),
+ 'boot_spooler' => 'lpd',
+ 'service' => 'lpd',
+ 'packages2add' => [ [qw(LPRng net-tools gpr a2ps ImageMagick)],
+ [qw(/usr/lib/filters/lpf
+ /usr/sbin/lpd
+ /sbin/ifconfig
+ /usr/bin/gpr
+ /usr/bin/a2ps
+ /usr/bin/convert)] ],
+ 'packages2rm' => [ 'lpr', '/usr/sbin/lpf' ],
'alternatives' => [
[ 'lpr', '/usr/bin/lpr-lpd' ],
[ 'lpq', '/usr/bin/lpq-lpd' ],
@@ -53,6 +74,15 @@ our %spoolers = ('ppq' => {
'print_command' => 'lpr-cups',
'long_name' => N("CUPS - Common Unix Printing System"),
'short_name' => N("CUPS"),
+ 'boot_spooler' => 'cups',
+ 'service' => 'cups',
+ 'packages2add' => [ ['cups', 'net-tools', 'xpp', if_($::expert, 'cups-drivers'),
+ $::isInstall ? 'curl' : 'webfetch'],
+ [ qw(/usr/lib/cups/cgi-bin/printers.cgi
+ /sbin/ifconfig
+ /usr/bin/xpp),
+ if_($::expert, "/usr/share/cups/model/postscript.ppd.gz"),
+ $::isInstall ? '/usr/bin/curl' : '/usr/bin/wget' ] ],
'alternatives' => [
[ 'lpr', '/usr/bin/lpr-cups' ],
[ 'lpq', '/usr/bin/lpq-cups' ],