From 07e64db764a8949055d72d0fbcfb97362f8aff41 Mon Sep 17 00:00:00 2001 From: Zdenek Dohnal Date: Wed, 15 Apr 2020 11:53:21 +0200 Subject: [PATCH] model mismatch during scanning due 'HP_' string --- ...et2200.patch => hplip-model-mismatch.patch | 27 +++++++++++++++++++ hplip.spec | 15 +++++++---- 2 files changed, 37 insertions(+), 5 deletions(-) rename hplip-missing-laserjet2200.patch => hplip-model-mismatch.patch (61%) diff --git a/hplip-missing-laserjet2200.patch b/hplip-model-mismatch.patch similarity index 61% rename from hplip-missing-laserjet2200.patch rename to hplip-model-mismatch.patch index 3dca0a1..9b416f8 100644 --- a/hplip-missing-laserjet2200.patch +++ b/hplip-model-mismatch.patch @@ -1,3 +1,30 @@ +diff --git a/io/hpmud/jd.c b/io/hpmud/jd.c +index 20df27a..7ed4918 100644 +--- a/io/hpmud/jd.c ++++ b/io/hpmud/jd.c +@@ -208,7 +208,22 @@ enum HPMUD_RESULT __attribute__ ((visibility ("hidden"))) jd_open(mud_device *pd + { + /* Make sure uri model matches device id model. */ + hpmud_get_uri_model(pd->uri, uri_model, sizeof(uri_model)); ++ ++ /* remove possible hp_ string */ ++ if (strncasecmp(uri_model, "HP_", 3) == 0) ++ { ++ memmove(uri_model, uri_model + 3, 127); ++ uri_model[127] = '\0'; ++ } ++ + hpmud_get_model(pd->id, model, sizeof(model)); ++ /* remove possible hp_ string */ ++ if (strncasecmp(model, "HP_", 3) == 0) ++ { ++ memmove(model, model + 3, 127); ++ model[127] = '\0'; ++ } ++ + if (strcasecmp(uri_model, model) != 0) + { + stat = HPMUD_R_INVALID_URI; /* different device plugged in */ diff --git a/io/hpmud/model.c b/io/hpmud/model.c index d546ec1..5bb6091 100644 --- a/io/hpmud/model.c diff --git a/hplip.spec b/hplip.spec index 0674bb6..0a1a4d5 100644 --- a/hplip.spec +++ b/hplip.spec @@ -7,7 +7,7 @@ Summary: HP Linux Imaging and Printing Project Name: hplip Version: 3.20.3 -Release: 4%{?dist} +Release: 5%{?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,19 +119,21 @@ 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... +# laserjet 2200 and other devices have different device id than HP expects... # https://bugzilla.redhat.com/show_bug.cgi?id=1772698 # reported upstream https://bugs.launchpad.net/hplip/+bug/1853002 -Patch49: hplip-missing-laserjet2200.patch +Patch49: hplip-model-mismatch.patch # sixext has problems with python3 strings (bz#1573430) # reported https://bugs.launchpad.net/bugs/1480152 Patch50: hplip-unicodeerror.patch # the version attribute in python-pillow got changed again.. # https://bugs.launchpad.net/hplip/+bug/1863620 Patch51: hplip-pil.patch - +# error with new gcc, already reported in upstream as +# https://bugs.launchpad.net/hplip/+bug/1836735 Patch52: hplip-fix-Wreturn-type-warning.patch + Requires: %{name}-libs%{?_isa} = %{version}-%{release} Requires: python3-pillow Requires: cups @@ -388,7 +390,7 @@ rm prnt/hpcups/ErnieFilter.{cpp,h} prnt/hpijs/ernieplatform.h # 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 +%patch49 -p1 -b .model-mismatch # 1573430 - sixext.py:to_string_utf8:UnicodeDecodeError: 'utf-8' codec can't decode bytes %patch50 -p1 -b .unicodeerror %patch51 -p1 -b .pil @@ -699,6 +701,9 @@ rm -f %{buildroot}%{_sysconfdir}/xdg/autostart/hplip-systray.desktop %config(noreplace) %{_sysconfdir}/sane.d/dll.d/hpaio %changelog +* Wed Apr 15 2020 Zdenek Dohnal - 3.20.3-5 +- model mismatch during scanning due 'HP_' string + * Tue Apr 07 2020 Zdenek Dohnal - 3.20.3-4 - add keyserver.ubuntu.com too (1821469)