From b7748fb0e0a4808de1a26c01349d0063a207b94f Mon Sep 17 00:00:00 2001 From: Till Kamppeter Date: Tue, 6 Sep 2005 11:11:00 +0000 Subject: - Do not set margins in CUPS when HPIJS is the driver, for this driver the margins are already well set. - Also match model name with added lower-case "hp" with HPLIP XML database. --- perl-install/printer/main.pm | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) (limited to 'perl-install/printer/main.pm') diff --git a/perl-install/printer/main.pm b/perl-install/printer/main.pm index 7a548db9e..302281d21 100644 --- a/perl-install/printer/main.pm +++ b/perl-install/printer/main.pm @@ -753,19 +753,22 @@ sub set_cups_special_options { my @lpoptions = cat_("$::prefix/etc/cups/lpoptions"); # If nothing is already configured, set text file borders of half # an inch so nothing of the text gets cut off by unprintable - # borders. Do this only when the driver is not Gutenprint, as with - # Gutenprint this will break PostScript printing + # borders. Do this only when the driver is not Gutenprint or HPIJS, as + # both drivers decent border settings are already done and with + # Gutenprint this will even break PostScript printing if ((($queue eq $printer->{currentqueue}{$queue}) && - (($printer->{currentqueue}{driver} =~ /guten.*print/i) || - ($printer->{currentqueue}{ppd} =~ /guten.*print/i))) || + (($printer->{currentqueue}{driver} =~ + /(guten.*print|hpijs|hplip)/i) || + ($printer->{currentqueue}{ppd} =~ + /(guten.*print|hpijs|hplip)/i))) || ((defined($printer->{configured}{$queue})) && (($printer->{configured}{$queue}{queuedata}{driver} =~ - /guten.*print/i) || + /(guten.*print|hpijs|hplip)/i) || ($printer->{configured}{$queue}{queuedata}{ppd} =~ - /guten.*print/i))) || + /(guten.*print|hpijs|hplip)/i))) || (($printer->{SPOOLER} eq "cups") && (-r "$::prefix/etc/cups/ppd/$queue.ppd") && - (`grep -ic gutenprint $::prefix/etc/cups/ppd/$queue.ppd` > 2))) { + (`egrep -ic '(gutenprint|hpijs|hplip)' $::prefix/etc/cups/ppd/$queue.ppd` > 2))) { # Remove page margin settings foreach (@lpoptions) { s/\s*page-(top|bottom|left|right)=\S+//g if /$queue/; @@ -2688,6 +2691,11 @@ sub hplip_device_entry { # Exact match return $entry; } + my $hpmodelstr = "hp_" . $modelstr; + if ($entry = $hplipdevicesdb->{$hpmodelstr}) { + # Exact match + return $entry; + } # More 'fuzzy' matching my $simplemodel = hplip_simple_model($modelstr); foreach my $key (keys %{$hplipdevicesdb}) { -- cgit v1.2.1