summaryrefslogtreecommitdiffstats
path: root/perl-install/printer.pm
diff options
context:
space:
mode:
authorTill Kamppeter <tkamppeter@mandriva.com>2001-09-14 18:32:10 +0000
committerTill Kamppeter <tkamppeter@mandriva.com>2001-09-14 18:32:10 +0000
commitde03857088abc1bf0a1db01516ee24bd18207414 (patch)
tree95704eac3fad589532c57e7ca98301024628588d /perl-install/printer.pm
parent997bab50fb1cc78f013679b14cebcc143035e529 (diff)
downloaddrakx-backup-do-not-use-de03857088abc1bf0a1db01516ee24bd18207414.tar
drakx-backup-do-not-use-de03857088abc1bf0a1db01516ee24bd18207414.tar.gz
drakx-backup-do-not-use-de03857088abc1bf0a1db01516ee24bd18207414.tar.bz2
drakx-backup-do-not-use-de03857088abc1bf0a1db01516ee24bd18207414.tar.xz
drakx-backup-do-not-use-de03857088abc1bf0a1db01516ee24bd18207414.zip
Raw queue entry added, so cursor not always on "Alps MD-1000" when no printer
detected.
Diffstat (limited to 'perl-install/printer.pm')
-rw-r--r--perl-install/printer.pm24
1 files changed, 22 insertions, 2 deletions
diff --git a/perl-install/printer.pm b/perl-install/printer.pm
index 6c29bd0b5..bd10417b1 100644
--- a/perl-install/printer.pm
+++ b/perl-install/printer.pm
@@ -421,6 +421,15 @@ sub read_printer_db(;$) {
}
close DBPATH;
+ # Add raw queue
+ if ($spooler ne "pdq") {
+ $entry->{ENTRY} = _("Raw printer (No driver)");
+ $entry->{driver} = "raw";
+ $entry->{make} = "";
+ $entry->{model} = "Unknown model";
+ map { $thedb{$entry->{ENTRY}}->{$_} = $entry->{$_} } keys %$entry;
+ }
+
#- Load CUPS driver database if CUPS is used as spooler
if (($spooler) && ($spooler eq "cups") && ($::expert)) {
@@ -706,7 +715,7 @@ sub get_descr_from_ppd {
my ($printer) = @_;
my %ppd;
- #- if there is no ppd, this means this is the PostScript generic filter.
+ #- if there is no ppd, this means this is a raw queue.
local *F; open F, "$prefix/etc/cups/ppd/$printer->{OLD_QUEUE}.ppd" or return "|" . _("Unknown model");
# "OTHERS|Generic PostScript printer|PostScript (en)";
local $_;
@@ -768,6 +777,7 @@ sub poll_ppd_base {
while (<PPDS>) {
chomp;
my ($ppd, $mf, $descr, $lang) = split /\|/;
+ if ($ppd eq "raw") {next;}
my ($model, $driver);
if ($descr) {
if ($descr =~ /^([^,]+), (.*)$/) {
@@ -862,7 +872,17 @@ sub configure_queue($) {
"$prefix/etc/cups/ppd/$printer->{OLD_QUEUE}.ppd " .
"$prefix/etc/cups/ppd/$printer->{currentqueue}{'queue'}.ppd");
}
- }
+ } else {
+ # Raw queue
+ run_program::rooted($prefix, "foomatic-configure",
+ "-s", $printer->{currentqueue}{'spooler'},
+ "-n", $printer->{currentqueue}{'queue'},
+ "-c", $printer->{currentqueue}{'connect'},
+ "-d", $printer->{currentqueue}{'driver'},
+ "-N", $printer->{currentqueue}{'desc'},
+ "-L", $printer->{currentqueue}{'loc'}
+ ) or die "foomatic-configure failed";
+ }
# Make sure that queue is active
if ($printer->{SPOOLER} ne "pdq") {