1772698 - missing HP LaserJet 2200 driver

This commit is contained in:
Zdenek Dohnal 2019-11-18 13:07:25 +01:00
parent 87a48a2fc2
commit 35def6bed1
2 changed files with 45 additions and 1 deletions

View File

@ -0,0 +1,35 @@
diff --git a/io/hpmud/model.c b/io/hpmud/model.c
index d546ec1..288cd75 100644
--- a/io/hpmud/model.c
+++ b/io/hpmud/model.c
@@ -407,7 +407,10 @@ static int ParseFile(char *datFile, char *model, char *attr, int attrSize, int *
char rcbuf[255];
char section[128];
char file[128];
- int found=0, n;
+ int found=0;
+ size_t n;
+
+ size_t model_len = strlen(model);
if ((fp = fopen(datFile, "r")) == NULL)
goto bugout;
@@ -423,9 +426,15 @@ static int ParseFile(char *datFile, char *model, char *attr, int attrSize, int *
n = strlen(section);
section[n-2]=0; /* remove ']' and CR */
if (strcasecmp(model, section) == 0 ||
- (section[0] == 'h' && section[1] == 'p' &&
- section[2] == '_' &&
- strcasecmp(model, section + 3) == 0))
+ (section[0] == 'h' &&
+ section[1] == 'p' &&
+ section[2] == '_' &&
+ strcasecmp(model, section + 3) == 0) ||
+ (n > model_len &&
+ strncasecmp(section, model, model_len) &&
+ strncasecmp(section + model_len, "_series", strlen("_series"))
+ )
+ )
{
/* Found model match. */
*bytes_read = ResolveAttributes(fp, attr, attrSize);

View File

@ -7,7 +7,7 @@
Summary: HP Linux Imaging and Printing Project
Name: hplip
Version: 3.19.10
Release: 1%{?dist}
Release: 2%{?dist}
License: GPLv2+ and MIT and BSD and IJG and Public Domain and GPLv2+ with exceptions and ISC
Url: https://developers.hp.com/hp-linux-imaging-and-printing
@ -119,6 +119,10 @@ Patch47: hplip-systray-blockerror.patch
# reported upstream https://bugs.launchpad.net/hplip/+bug/1843592
# bugzillas 1742949, 1740132, 1739855
Patch48: hplip-missing-drivers.patch
# laserjet 2200 has different device id than HP expects...
# https://bugzilla.redhat.com/show_bug.cgi?id=1772698
# reported upstream
Patch49: hplip-missing-laserjet2200.patch
Requires: %{name}-libs%{?_isa} = %{version}-%{release}
Requires: python3-pillow
@ -372,6 +376,8 @@ rm prnt/hpcups/ErnieFilter.{cpp,h} prnt/hpijs/ernieplatform.h
%patch47 -p1 -b .systray-blockerror
# 1742949, 1740132, 1739855 - missing drivers
%patch48 -p1 -b .missing-drivers
# 1772698 - Can't setup printer (HP LJ 2200): no attributes found in model.dat
%patch49 -p1 -b .missing-laserjet-2200
sed -i.duplex-constraints \
-e 's,\(UIConstraints.* \*Duplex\),//\1,' \
@ -678,6 +684,9 @@ rm -f %{buildroot}%{_sysconfdir}/xdg/autostart/hplip-systray.desktop
%config(noreplace) %{_sysconfdir}/sane.d/dll.d/hpaio
%changelog
* Fri Nov 15 2019 Zdenek Dohnal <zdohnal@redhat.com> - 3.19.10-2
- 1772698 - missing HP LaserJet 2200 driver
* Fri Nov 01 2019 Zdenek Dohnal <zdohnal@redhat.com> - 3.19.10-1
- 3.19.10