summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTill Kamppeter <tkamppeter@mandriva.com>2003-02-20 02:47:07 +0000
committerTill Kamppeter <tkamppeter@mandriva.com>2003-02-20 02:47:07 +0000
commitb38b4b7bf51ee1bcbc2dcae962d296f27ca1515f (patch)
tree04739b0b779a5f172b327f0ace76d103ba4fdbd6
parent4e34f1b29ba772add6a0df5273ad0450fed1a5ab (diff)
downloaddrakx-backup-do-not-use-b38b4b7bf51ee1bcbc2dcae962d296f27ca1515f.tar
drakx-backup-do-not-use-b38b4b7bf51ee1bcbc2dcae962d296f27ca1515f.tar.gz
drakx-backup-do-not-use-b38b4b7bf51ee1bcbc2dcae962d296f27ca1515f.tar.bz2
drakx-backup-do-not-use-b38b4b7bf51ee1bcbc2dcae962d296f27ca1515f.tar.xz
drakx-backup-do-not-use-b38b4b7bf51ee1bcbc2dcae962d296f27ca1515f.zip
- Improved/fixed generation of printer list entries from
manufacturer-supplied PostScript PPD files - Removed forgotten debug mode - Disabled wizard-mode temporarily
-rw-r--r--perl-install/printer/main.pm32
-rw-r--r--perl-install/printer/printerdrake.pm9
2 files changed, 19 insertions, 22 deletions
diff --git a/perl-install/printer/main.pm b/perl-install/printer/main.pm
index d2ca76d10..c63044413 100644
--- a/perl-install/printer/main.pm
+++ b/perl-install/printer/main.pm
@@ -504,13 +504,11 @@ sub read_printer_db(;$) {
close DBPATH;
# Add raw queue
- if ($spooler ne "pdq") {
- $entry->{ENTRY} = N("Raw printer (No driver)");
- $entry->{driver} = "raw";
- $entry->{make} = "";
- $entry->{model} = N("Unknown model");
- map { $thedb{$entry->{ENTRY}}{$_} = $entry->{$_} } keys %$entry;
- }
+ $entry->{ENTRY} = N("Raw printer (No driver)");
+ $entry->{driver} = "raw";
+ $entry->{make} = "";
+ $entry->{model} = N("Unknown model");
+ map { $thedb{$entry->{ENTRY}}{$_} = $entry->{$_} } keys %$entry;
#- Load CUPS driver database if CUPS is used as spooler
if ($spooler && $spooler eq "cups") {
@@ -1378,7 +1376,7 @@ sub clean_manufacturer_name {
$make =~ s/\s+Ltd\.//i;
$make =~ s/\s+International//i;
$make =~ s/\s+Int\.//i;
- return $make;
+ return uc($make);
}
sub ppd_entry_str {
@@ -1388,12 +1386,12 @@ sub ppd_entry_str {
# Apply the beautifying rules of poll_ppd_base
if ($descr =~ /Foomatic \+ Postscript/) {
$descr =~ s/Foomatic \+ Postscript/PostScript/;
- } elsif ($descr =~ /Foomatic/) {
- $descr =~ s/Foomatic/GhostScript/;
- } elsif ($descr =~ /CUPS\+GIMP-print/) {
- $descr =~ s/CUPS\+GIMP-print/CUPS \+ GIMP-Print/;
- } elsif ($descr =~ /Series CUPS/) {
- $descr =~ s/Series CUPS/Series, CUPS/;
+ } elsif ($descr =~ /Foomatic/i) {
+ $descr =~ s/Foomatic/GhostScript/i;
+ } elsif ($descr =~ /CUPS\+GIMP-print/i) {
+ $descr =~ s/CUPS\+GIMP-print/CUPS \+ GIMP-Print/i;
+ } elsif ($descr =~ /Series CUPS/i) {
+ $descr =~ s/Series CUPS/Series, CUPS/i;
} elsif ($descr !~ /(PostScript|GhostScript|CUPS|Foomatic)/i) {
$descr .= ", PostScript";
}
@@ -1407,11 +1405,11 @@ sub ppd_entry_str {
($descr =~ /^([^,]+[^,\s])\s*,?\s*(Foomatic.*)$/i) ||
($descr =~ /^([^,]+[^,\s])\s*,?\s*(GhostScript.*)$/i) ||
($descr =~ /^([^,]+[^,\s])\s*,?\s*(CUPS.*)$/i) ||
+ ($descr =~ /^([^,]+[^,\s])\s*,?\s+(PS.*)$/i) ||
($descr =~
- /^([^,]+[^,\s])\s*,?\s*(\(v?\d\d\d\d\.\d\d\d\).*)$/i) ||
+ /^([^,]+[^,\s])\s*,?\s*(\(v?\.?\s*\d\d\d\d\.\d\d\d\).*)$/i) ||
($descr =~ /^([^,]+[^,\s])\s*,?\s*(v\d+\.\d+.*)$/i) ||
($descr =~ /^([^,]+[^,\s])\s*,?\s*(PostScript.*)$/i) ||
- ($descr =~ /^([^,]+[^,\s])\s*,?\s+(PS.*)$/i) ||
($descr =~ /^([^,]+)\s*,?\s*(.+)$/)) {
$model = $1;
$driver = $2;
@@ -1419,7 +1417,7 @@ sub ppd_entry_str {
$driver =~ s/\b(PS|PostScript\b)/PostScript/gi;
$driver =~ s/(PostScript)(.*)(PostScript)/$1$2/i;
$driver =~
- s/^\s*(\(v?\d\d\d\d\.\d\d\d\)|v\d+\.\d+)([,\s]*)(.*)/$3$2$1/i;
+ s/^\s*(\(?v?\.?\s*\d\d\d\d\.\d\d\d\)?|v\d+\.\d+)([,\s]*)(.*?)\s*$/$3$2$1/i;
$driver =~ s/,\s*\(/ \(/g;
$driver =~ s/[\-\s,]+$//;
$driver =~ s/^[\-\s,]+//;
diff --git a/perl-install/printer/printerdrake.pm b/perl-install/printer/printerdrake.pm
index 0913bde7f..6f9d48612 100644
--- a/perl-install/printer/printerdrake.pm
+++ b/perl-install/printer/printerdrake.pm
@@ -1961,8 +1961,7 @@ sub setup_common {
my $matched = 1;
my ($mfg, $mdl, $des);
if ($mfg = $printer::main::thedb{$entry}{devidmake}) {
- $mfg =~ s/Hewlett[-\s_]Packard/HP/;
- $mfg =~ s/HEWLETT[-\s_]PACKARD/HP/;
+ $mfg =~ s/Hewlett[-\s_]Packard/HP/i;
if (uc($mfg) ne uc($automake)) {
$matched = 0;
}
@@ -3709,7 +3708,7 @@ sub main {
#- Do all the configuration steps for a new queue
step_0:
#if ((!$::expert) && (!$::isEmbedded) && (!$::isInstall) &&
- if (!$::isEmbedded && !$::isInstall &&
+ if (0 && !$::isEmbedded && !$::isInstall &&
#if ((!$::isInstall) &&
$in->isa('interactive::gtk')) {
# Enter wizard mode
@@ -3724,8 +3723,8 @@ sub main {
next;
};
undef $::Wizard_no_previous;
- #eval {
- do {
+ eval {
+ #do {
# eval to catch wizard cancel. The wizard stuff should
# be in a separate function with steps. see dragw.
# (dams)