diff --git a/hplip-clean-ldl.patch b/hplip-clean-ldl.patch new file mode 100644 index 0000000..89553ec --- /dev/null +++ b/hplip-clean-ldl.patch @@ -0,0 +1,44 @@ +diff --git a/base/device.py b/base/device.py +index 6d7add9..bf27307 100644 +--- a/base/device.py ++++ b/base/device.py +@@ -2264,7 +2264,8 @@ class Device(object): + self.callback() + + if total_bytes_to_write != bytes_out: +- raise Error(ERROR_DEVICE_IO_ERROR) ++ raise Error(ERROR_DEVICE_IO_ERROR, 'Number of written ' ++ 'bytes by hpmudext mismatch with expected amount.') + + return bytes_out + +diff --git a/base/g.py b/base/g.py +index 9856662..0aa0e2e 100644 +--- a/base/g.py ++++ b/base/g.py +@@ -398,9 +398,11 @@ ERROR_STRINGS = { + + + class Error(Exception): +- def __init__(self, opt=ERROR_INTERNAL): ++ def __init__(self, opt=ERROR_INTERNAL, msg=None): + self.opt = opt + self.msg = ERROR_STRINGS.get(opt, ERROR_STRINGS[ERROR_INTERNAL]) ++ if msg: ++ self.msg = '{} - {}'.format(self.msg, msg) + log.debug("Exception: %d (%s)" % (opt, self.msg)) + Exception.__init__(self, self.msg, opt) + +diff --git a/prnt/ldl.py b/prnt/ldl.py +index e3f77f7..8b28e7f 100644 +--- a/prnt/ldl.py ++++ b/prnt/ldl.py +@@ -145,7 +145,7 @@ def buildLIDILPacket(packet_type, command=0, operation=0, other={}): + p = '$\x00\x10\x00\x08\x00\x00\x00\x00\x00\xff\xff\xff\xff\xff$' + + elif packet_type == PACKET_TYPE_RESET_LIDIL: +- p = '$\x00\x10\x00\x06\x00\x00\x00\x00\x00\xff\xff\xff\xff\xff$' ++ p = b'$\x00\x10\x00\x06\x00\x00\x00\x00\x00\xff\xff\xff\xff\xff$' + + elif packet_type == PACKET_TYPE_COMMAND: + diff --git a/hplip.spec b/hplip.spec index 17c51eb..fa5644c 100644 --- a/hplip.spec +++ b/hplip.spec @@ -143,6 +143,15 @@ Patch53: hplip-dialog-infinite-loop.patch # bug: https://bugzilla.redhat.com/show_bug.cgi?id=1590014 # reported upstream: https://bugs.launchpad.net/hplip/+bug/1881587 Patch54: hplip-find-driver.patch +# hp-clean didn't work for Photosmart C1410 because it was comparing +# string length with buffer size for string object, which is different, +# causing cleaning to fail - the fix is to make the object bytes-like, +# then buffer size is the same as the length. +# Thanks to Stefan Assmann we were able to fix level 1 cleaning +# for the device, but there can be similar issues with other devices +# bug https://bugzilla.redhat.com/show_bug.cgi?id=1833308 +# reported upstream https://bugs.launchpad.net/hplip/+bug/1882193 +Patch55: hplip-clean-ldl.patch Requires: %{name}-libs%{?_isa} = %{version}-%{release} @@ -409,6 +418,8 @@ rm prnt/hpcups/ErnieFilter.{cpp,h} prnt/hpijs/ernieplatform.h %patch53 -p1 -b .dialog-infinite-loop # 1590014 - hplip PPD search doesn't expect '-' in device name %patch54 -p1 -b .find-driver +# 1833308 - hp-clean cannot clean HP PSC1410 - Device I/O error +%patch55 -p1 -b .clean-ldl sed -i.duplex-constraints \ -e 's,\(UIConstraints.* \*Duplex\),//\1,' \ @@ -709,6 +720,9 @@ rm -f %{buildroot}%{_sysconfdir}/xdg/autostart/hplip-systray.desktop %config(noreplace) %{_sysconfdir}/sane.d/dll.d/hpaio %changelog +* Fri Jun 05 2020 Zdenek Dohnal - 3.20.5-4 +- 1833308 - hp-clean cannot clean HP PSC1410 - Device I/O error + * Mon Jun 01 2020 Zdenek Dohnal - 3.20.5-4 - 1794147 - HP-setup crashes with Python3 ui5 module not found error - 1590014 - hplip PPD search doesn't expect '-' in device name