summaryrefslogtreecommitdiffstats
path: root/perl-install/printer/default.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2007-04-25 12:26:16 +0000
committerPascal Rigaux <pixel@mandriva.com>2007-04-25 12:26:16 +0000
commit126777bc019a54afb4ec51299f2cf9d2841698aa (patch)
tree97f76e571902ead55ba138f1156a4b4f00b9b779 /perl-install/printer/default.pm
parentf1f67448efc714873378dfeb8279fae68054a90a (diff)
downloaddrakx-126777bc019a54afb4ec51299f2cf9d2841698aa.tar
drakx-126777bc019a54afb4ec51299f2cf9d2841698aa.tar.gz
drakx-126777bc019a54afb4ec51299f2cf9d2841698aa.tar.bz2
drakx-126777bc019a54afb4ec51299f2cf9d2841698aa.tar.xz
drakx-126777bc019a54afb4ec51299f2cf9d2841698aa.zip
re-sync after the big svn loss
Diffstat (limited to 'perl-install/printer/default.pm')
-rw-r--r--perl-install/printer/default.pm64
1 files changed, 0 insertions, 64 deletions
diff --git a/perl-install/printer/default.pm b/perl-install/printer/default.pm
deleted file mode 100644
index 41da25c56..000000000
--- a/perl-install/printer/default.pm
+++ /dev/null
@@ -1,64 +0,0 @@
-package printer::default;
-
-use strict;
-use run_program;
-use common;
-
-#-configuration directory of Foomatic
-my $FOOMATICCONFDIR = "/etc/foomatic";
-#-location of the file containing the default spooler's name
-my $FOOMATIC_DEFAULT_SPOOLER = "$FOOMATICCONFDIR/defaultspooler";
-
-sub set_printer {
- my ($printer) = $_[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 $spooler |" or return undef;
- my $line;
- while ($line = <F>) {
- if ($line =~ m!^\s*<defaultqueue>(.*)</defaultqueue>\s*$!) {
- return $1;
- }
- }
- return undef;
-}
-
-sub printer_type() { "LOCAL" }
-
-sub get_spooler () {
- if (-f "$::prefix$FOOMATIC_DEFAULT_SPOOLER") {
- my $spool = cat_("$::prefix$FOOMATIC_DEFAULT_SPOOLER");
- chomp $spool;
- 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/;
- }
-}
-
-sub set_spooler ($) {
- my ($printer) = @_;
- # Mark the default driver in a file
- output_p("$::prefix$FOOMATIC_DEFAULT_SPOOLER", $printer->{SPOOLER});
-}
-
-
-1;