From 35def6bed102e8ac80bc4b928d3e99bbba60bf41 Mon Sep 17 00:00:00 2001 From: Zdenek Dohnal Date: Mon, 18 Nov 2019 13:07:25 +0100 Subject: [PATCH] 1772698 - missing HP LaserJet 2200 driver --- hplip-missing-laserjet2200.patch | 35 ++++++++++++++++++++++++++++++++ hplip.spec | 11 +++++++++- 2 files changed, 45 insertions(+), 1 deletion(-) create mode 100644 hplip-missing-laserjet2200.patch diff --git a/hplip-missing-laserjet2200.patch b/hplip-missing-laserjet2200.patch new file mode 100644 index 0000000..b67d586 --- /dev/null +++ b/hplip-missing-laserjet2200.patch @@ -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); diff --git a/hplip.spec b/hplip.spec index 77243fd..f70deca 100644 --- a/hplip.spec +++ b/hplip.spec @@ -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 - 3.19.10-2 +- 1772698 - missing HP LaserJet 2200 driver + * Fri Nov 01 2019 Zdenek Dohnal - 3.19.10-1 - 3.19.10