summaryrefslogtreecommitdiffstats
path: root/perl-install/printer
diff options
context:
space:
mode:
authorTill Kamppeter <tkamppeter@mandriva.com>2005-02-08 14:37:25 +0000
committerTill Kamppeter <tkamppeter@mandriva.com>2005-02-08 14:37:25 +0000
commit29c3201c8dc00e3384afc32ae946a59992498fbe (patch)
tree5a94bb399eefa382fd1854b60e096d0189937528 /perl-install/printer
parenta4cd651f7b020f31b9011ba545e7042297f6bfe8 (diff)
downloaddrakx-29c3201c8dc00e3384afc32ae946a59992498fbe.tar
drakx-29c3201c8dc00e3384afc32ae946a59992498fbe.tar.gz
drakx-29c3201c8dc00e3384afc32ae946a59992498fbe.tar.bz2
drakx-29c3201c8dc00e3384afc32ae946a59992498fbe.tar.xz
drakx-29c3201c8dc00e3384afc32ae946a59992498fbe.zip
- Corrected recognition of driver name in Foomatic-generated PPDs.
- Conserve auto-detection data when a Foomatic printer entry is replaced by an entry from a native PostScript PPD.
Diffstat (limited to 'perl-install/printer')
-rw-r--r--perl-install/printer/main.pm15
1 files changed, 13 insertions, 2 deletions
diff --git a/perl-install/printer/main.pm b/perl-install/printer/main.pm
index 28ee79cb5..30c2ef8ea 100644
--- a/perl-install/printer/main.pm
+++ b/perl-install/printer/main.pm
@@ -1717,7 +1717,7 @@ sub poll_ppd_base {
my $fullfoomaticdriver = $driver;
# Foomatic PPD? Extract driver name
my $isfoomatic =
- $driver =~ s/^\s*(GhostScript|Foomatic)\s*\+\s*//i;
+ $driver =~ s!^\s*(GhostScript|Foomatic)(\s*\+\s*|/)!!i;
# Foomatic PostScript driver?
$isfoomatic ||= $descr =~ /Foomatic/i;
# Native CUPS?
@@ -1736,6 +1736,7 @@ sub poll_ppd_base {
# Foomatic
$key = $keynolang;
}
+ my ($devidmake, $devidmodel, $deviddesc, $devidcmdset);
if (!$printer->{expert}) {
# Remove driver from printer list entry when in
# recommended mode
@@ -1758,6 +1759,11 @@ sub poll_ppd_base {
$thedb{$key}{driver} =~ /^PostScript$/i ||
$thedb{$key}{driver} ne "PPD" && $isrecommended ||
$thedb{$key}{driver} eq "PPD" && $isrecommended && $driver ne "PostScript") {
+ # Save the autodetection data
+ $devidmake = $thedb{$key}{devidmake};
+ $devidmodel = $thedb{$key}{devidmodel};
+ $deviddesc = $thedb{$key}{deviddesc};
+ $devidcmdset = $thedb{$key}{devidcmdset};
# Remove the old entry
delete $thedb{$key};
} else {
@@ -1834,7 +1840,12 @@ sub poll_ppd_base {
$thedb{$key}{make} = $mf;
$thedb{$key}{model} = $model;
$thedb{$key}{driver} = $driver;
- # Get auto-detection data
+ # Recover saved autodetection data
+ $thedb{$key}{devidmake} = $devidmake if $devidmake;
+ $thedb{$key}{devidmodel} = $devidmodel if $devidmodel;
+ $thedb{$key}{deviddesc} = $deviddesc if $deviddesc;
+ $thedb{$key}{devidcmdset} = $devidcmdset if $devidcmdset;
+ # Get autodetection data
#my ($devidmake, $devidmodel) = ppd_devid_data($ppd);
#$thedb{$key}{devidmake} = $devidmake;
#$thedb{$key}{devidmodel} = $devidmodel;