summaryrefslogtreecommitdiffstats
path: root/perl-install/printer.pm
diff options
context:
space:
mode:
authorTill Kamppeter <tkamppeter@mandriva.com>2002-03-10 18:04:32 +0000
committerTill Kamppeter <tkamppeter@mandriva.com>2002-03-10 18:04:32 +0000
commite3e36c2a1e45889012bda605fff6fad42c0f0d2b (patch)
treea9d86a60e16b403e2287c530c8838922bd20cc1e /perl-install/printer.pm
parent0b8a1e1fd14eb1076b15ae2362d3849e68f286d5 (diff)
downloaddrakx-backup-do-not-use-e3e36c2a1e45889012bda605fff6fad42c0f0d2b.tar
drakx-backup-do-not-use-e3e36c2a1e45889012bda605fff6fad42c0f0d2b.tar.gz
drakx-backup-do-not-use-e3e36c2a1e45889012bda605fff6fad42c0f0d2b.tar.bz2
drakx-backup-do-not-use-e3e36c2a1e45889012bda605fff6fad42c0f0d2b.tar.xz
drakx-backup-do-not-use-e3e36c2a1e45889012bda605fff6fad42c0f0d2b.zip
Protect the Star Office/OpenOffice.org configuration against manual changing of the "update-alternatives" assignment of the "lpr" command.
Diffstat (limited to 'perl-install/printer.pm')
-rw-r--r--perl-install/printer.pm15
1 files changed, 11 insertions, 4 deletions
diff --git a/perl-install/printer.pm b/perl-install/printer.pm
index 197e21183..64cfdcfa4 100644
--- a/perl-install/printer.pm
+++ b/perl-install/printer.pm
@@ -36,6 +36,13 @@ my $FOOMATIC_DEFAULT_SPOOLER = "$FOOMATICCONFDIR/defaultspooler";
);
%shortspooler_inv = reverse %shortspooler;
+%lprcommand = (
+ "cups" => "lpr-cups",
+ "lprng" => "lpr-lpd",
+ "lpd" => "lpr-lpd",
+ "pdq" => "lpr-pdq"
+);
+
%printer_type = (
_("Local printer") => "LOCAL",
_("Remote printer") => "REMOTE",
@@ -1687,7 +1694,7 @@ sub configurestaroffice {
("ports", "default_queue=", $configfilecontent);
$configfilecontent = addentry
("ports",
- "default_queue=/usr/bin/perl -p -e \"s=16#80 /euro=16#80 /Euro=\" | /usr/bin/lpr",
+ "default_queue=/usr/bin/perl -p -e \"s=16#80 /euro=16#80 /Euro=\" | /usr/bin/$lprcommand{$printer->{SPOOLER}}",
$configfilecontent);
# Write back Star Office configuration file
return writesofficeconfigfile($configfilename, $configfilecontent);
@@ -1752,7 +1759,7 @@ sub configureopenoffice {
("Generic Printer", "Command=", $configfilecontent);
$configfilecontent = addentry
("Generic Printer",
- "Command=/usr/bin/perl -p -e \"s=/euro /unused=/Euro /unused=\" | /usr/bin/lpr",
+ "Command=/usr/bin/perl -p -e \"s=/euro /unused=/Euro /unused=\" | /usr/bin/$lprcommand{$printer->{SPOOLER}}",
$configfilecontent);
# Write back OpenOffice.org configuration file
return writesofficeconfigfile($configfilename, $configfilecontent);
@@ -1932,7 +1939,7 @@ sub makestarofficeprinterentry {
# symbol correctly.
$configfile = removeentry("ports", "$queue=", $configfile);
$configfile = addentry("ports",
- "$queue=/usr/bin/perl -p -e \"s=16#80 /euro=16#80 /Euro=\" | /usr/bin/lpr -P $queue",
+ "$queue=/usr/bin/perl -p -e \"s=16#80 /euro=16#80 /Euro=\" | /usr/bin/$lprcommand{$printer->{SPOOLER}} -P $queue",
$configfile);
# Make printer's section
$configfile = addsection("$queue,PostScript,$queue", $configfile);
@@ -1999,7 +2006,7 @@ sub makeopenofficeprinterentry {
# symbol correctly.
$configfile = removeentry($queue, "Command=", $configfile);
$configfile = addentry($queue,
- "Command=/usr/bin/perl -p -e \"s=/euro /unused=/Euro /unused=\" | /usr/bin/lpr -P $queue",
+ "Command=/usr/bin/perl -p -e \"s=/euro /unused=/Euro /unused=\" | /usr/bin/$lprcommand{$printer->{SPOOLER}} -P $queue",
$configfile);
# "Comment" line
$configfile = removeentry($queue, "Comment=", $configfile);