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]; run_program::rooted($::prefix, "foomatic-configure", "-D", "-q", "-s", $printer->{SPOOLER}, "-n", $printer->{DEFAULT}) or return 0; return 1; } sub get_printer { my $printer = $_[0]; local *F; open F, ($::testing ? $::prefix : "chroot $::prefix/ ") . "foomatic-configure -Q -q -s $printer->{SPOOLER} |" or return undef; my $line; while ($line = ) { if ($line =~ m!^\s*(.*)\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; 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; alue='distro/mes5'>distro/mes5 Mageia Installer and base platform for many utilitiesThierry Vignaud [tv]
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2007-08-13 20:14:13 +0000
committerPascal Rigaux <pixel@mandriva.com>2007-08-13 20:14:13 +0000
commit95887b5a65aa7ebaf62b7ab663e085be0f154f39 (patch)
tree7b7aeb8f2618eb2c59e35c4ea0e27a4fab4303c1
parentb3dda2f9b09dc79f1dc25e4e74d5997e8a3af76b (diff)
downloaddrakx-95887b5a65aa7ebaf62b7ab663e085be0f154f39.tar
drakx-95887b5a65aa7ebaf62b7ab663e085be0f154f39.tar.gz
drakx-95887b5a65aa7ebaf62b7ab663e085be0f154f39.tar.bz2
drakx-95887b5a65aa7ebaf62b7ab663e085be0f154f39.tar.xz
drakx-95887b5a65aa7ebaf62b7ab663e085be0f154f39.zip