summaryrefslogtreecommitdiffstats
path: root/perl-install/printer/default.pm
diff options
context:
space:
mode:
Diffstat (limited to 'perl-install/printer/default.pm')
-rw-r--r--perl-install/printer/default.pm23
1 files changed, 18 insertions, 5 deletions
diff --git a/perl-install/printer/default.pm b/perl-install/printer/default.pm
index af997fd48..41da25c56 100644
--- a/perl-install/printer/default.pm
+++ b/perl-install/printer/default.pm
@@ -11,17 +11,25 @@ my $FOOMATIC_DEFAULT_SPOOLER = "$FOOMATICCONFDIR/defaultspooler";
sub set_printer {
my ($printer) = $_[0];
- run_program::rooted($::prefix, "foomatic-configure",
- "-D", "-q", "-s", $printer->{SPOOLER},
- "-n", $printer->{DEFAULT}) or return 0;
+ my $spooler = $printer->{SPOOLER};
+ if ($spooler eq "rcups") {
+ run_program::rooted($::prefix, "lpoptions",
+ "-d", $printer->{DEFAULT}) or return 0;
+ } else {
+ run_program::rooted($::prefix, "foomatic-configure",
+ "-D", "-q", "-s", $spooler,
+ "-n", $printer->{DEFAULT}) or return 0;
+ }
return 1;
}
sub get_printer {
my $printer = $_[0];
+ my $spooler = $printer->{SPOOLER};
+ $spooler = "cups" if $spooler eq "rcups";
local *F;
open F, ($::testing ? $::prefix : "chroot $::prefix/ ") .
- "foomatic-configure -Q -q -s $printer->{SPOOLER} |" or return undef;
+ "foomatic-configure -Q -q -s $spooler |" or return undef;
my $line;
while ($line = <F>) {
if ($line =~ m!^\s*<defaultqueue>(.*)</defaultqueue>\s*$!) {
@@ -37,7 +45,12 @@ sub get_spooler () {
if (-f "$::prefix$FOOMATIC_DEFAULT_SPOOLER") {
my $spool = cat_("$::prefix$FOOMATIC_DEFAULT_SPOOLER");
chomp $spool;
- return $spool if $spool =~ /cups|lpd|lprng|pdq/;
+ if ($spool =~ /cups/) {
+ my ($daemonless_cups, $_remote_cups_server) =
+ printer::main::read_client_conf();
+ $spool = ($daemonless_cups > 0 ? "rcups" : "cups");
+ }
+ return $spool if $spool =~ /cups|lpd|lprng|pdq/;
}
}