summaryrefslogtreecommitdiffstats
path: root/perl-install
diff options
context:
space:
mode:
authorTill Kamppeter <tkamppeter@mandriva.com>2006-01-21 23:50:23 +0000
committerTill Kamppeter <tkamppeter@mandriva.com>2006-01-21 23:50:23 +0000
commit1c530ce70f318bb0f2d791519a2c0718bb5b8dda (patch)
tree2e47115ef637ea54d5c493648a3ac8557484a96b /perl-install
parentadd0b1be43bf854aaddde0e0dca2223f51eb9bd0 (diff)
downloaddrakx-1c530ce70f318bb0f2d791519a2c0718bb5b8dda.tar
drakx-1c530ce70f318bb0f2d791519a2c0718bb5b8dda.tar.gz
drakx-1c530ce70f318bb0f2d791519a2c0718bb5b8dda.tar.bz2
drakx-1c530ce70f318bb0f2d791519a2c0718bb5b8dda.tar.xz
drakx-1c530ce70f318bb0f2d791519a2c0718bb5b8dda.zip
- Improvements and fixes on printer model/driver listing in
printerdrake o Corrected handling of PPD links in Foomatic printer XML files, no the prinyer list entries have the correct model names of the Foomatic printer XML files and so PPDs linked to multiple printers appear with each linked printer in printerdrake. This also avoids duplicate "(Recommended)" tags for one printer (problem occured with HP LaserJet 1200). o Avoid duplicate PPD entries for Foomatic-generated PPDs and identical pre-generated Foomatic PPDs in /usr/share/cups/model. This problem occured when the hplip-hpijs-ppds package is installed. o Some polishing of list entries. o Reduced Perl warnings.
Diffstat (limited to 'perl-install')
-rw-r--r--perl-install/printer/main.pm29
1 files changed, 16 insertions, 13 deletions
diff --git a/perl-install/printer/main.pm b/perl-install/printer/main.pm
index 2a8757f82..37e2952bb 100644
--- a/perl-install/printer/main.pm
+++ b/perl-install/printer/main.pm
@@ -1716,11 +1716,16 @@ sub ppd_entry_str {
$descr =~ s/Foomatic/GhostScript/i;
} elsif ($descr =~ /CUPS\+Gimp-Print/i) {
$descr =~ s/CUPS\+Gimp-Print/CUPS + Gimp-Print/i;
+ } elsif ($descr =~ /CUPS\+Gutenprint/i) {
+ $descr =~ s/CUPS\+Gutenprint/CUPS + Gutenprint/i;
} elsif ($descr =~ /Series CUPS/i) {
$descr =~ s/Series CUPS/Series, CUPS/i;
} elsif ($descr !~ /(PostScript|GhostScript|CUPS|Foomatic|PCL|PXL)/i) {
$descr .= ", PostScript";
}
+ # Avoid duplicate entries produced by ready-made Foomatic PPDs vs.
+ # the Foomatic XML database
+ $descr =~ s!(Foomatic|GhostScript)\s*/\s*(\S+)!$1 + $2!i;
# Split model and driver
$descr =~ s/\s*Series//i;
$descr =~ s/\((.*?(PostScript|PS.*).*?)\)/$1/i;
@@ -1869,6 +1874,7 @@ sub poll_ppd_base {
printer::services::start_not_running_service("cups");
my $driversthere = scalar(keys %thedb);
my $ppdentry = "";
+ $ppdfile = "" if !defined($ppdfile);
foreach (1..60) {
open(my $PPDS, ($::testing ? $::prefix :
"chroot $::prefix/ ") .
@@ -1947,24 +1953,22 @@ sub poll_ppd_base {
$newkey =~ s/^([^\|]+\|[^\|]+)\|.*$/$1/;
} else {
# If the Foomatic entry is "recommended" let
- # the new PPD entry be "recommended"
+ # the new PPD entry be "recommended" and
+ # otherwise not
$newkey =~ s/\s*$sprecstr//g;
$newkey .= " $precstr"
- if $ppdkey =~ m!$precstr!;
+ if $ppdkey =~ m!$sprecstr!;
# Remove duplicate "recommended" tags and have
# the "recommended" tag at the end
$newkey =~
s/(\s*$sprecstr)(.*?)(\s*$sprecstr)/$2$3/;
$newkey =~ s/(\s*$sprecstr)(.+)$/$2$1/;
}
- # If the PPD serves for multiple printers, conserve
- # the make and model of the original entry
- if (($#{$linkedppds{$filename}} > 0)) {
- $newkey =~
- s/^([^\|]+)(\|[^\|]+)(\|.*|)$/$oldmake$2$3/;
- $newkey =~
- s/^([^\|]+\|)([^\|]+)(\|.*|)$/$1$oldmodel$3/;
- }
+ # Conserve the make and model of the original entry
+ $newkey =~
+ s/^([^\|]+)(\|[^\|]+)(\|.*|)$/$oldmake$2$3/;
+ $newkey =~
+ s/^([^\|]+\|)([^\|]+)(\|.*|)$/$1$oldmodel$3/;
# Do not overwrite another entry which has the
# same key, consider different PPD files with
# the same identity as a bug and drop them
@@ -1973,8 +1977,8 @@ sub poll_ppd_base {
}
# Create the new entry
$thedb{$newkey}{ppd} = $ppd;
- $thedb{$newkey}{make} = $mf;
- $thedb{$newkey}{model} = $model;
+ $thedb{$newkey}{make} = $oldmake;
+ $thedb{$newkey}{model} = $oldmodel;
$thedb{$newkey}{driver} = $driver;
# Recover saved autodetection data
$thedb{$newkey}{devidmake} = $devidmake
@@ -1995,7 +1999,6 @@ sub poll_ppd_base {
# Remove driver from printer list entry when in
# recommended mode
$key =~ s/^([^\|]+\|[^\|]+)\|.*$/$1/;
-
# Only replace an existing printer entry if
# - its driver is not the same as the driver of the
# new one