From 7ba2f14e06a82d960ed01d20578e6c3f09836ed9 Mon Sep 17 00:00:00 2001 From: Zdenek Dohnal Date: Fri, 12 Jan 2018 17:44:00 +0100 Subject: [PATCH 1/9] 1533869 - hp-firmware:NameError: name 'INTERACTIVE_MODE4' is not defined --- hplip-typo.patch | 12 ++++++++++++ hplip.spec | 9 ++++++++- 2 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 hplip-typo.patch diff --git a/hplip-typo.patch b/hplip-typo.patch new file mode 100644 index 0000000..d3c4c47 --- /dev/null +++ b/hplip-typo.patch @@ -0,0 +1,12 @@ +diff -up hplip-3.17.11/firmware.py.typo hplip-3.17.11/firmware.py +--- hplip-3.17.11/firmware.py.typo 2018-01-12 17:28:52.995685310 +0100 ++++ hplip-3.17.11/firmware.py 2018-01-12 17:29:24.522444908 +0100 +@@ -99,7 +99,7 @@ try: + if mode == GUI_MODE and (ui_toolkit == 'qt4' or ui_toolkit == 'qt5'): + if not utils.canEnterGUIMode4(): + log.error("%s -u/--gui requires Qt4/Qt5 GUI support. Entering interactive mode." % __mod__) +- mode = INTERACTIVE_MODE4 ++ mode = INTERACTIVE_MODE + + elif mode == GUI_MODE and ui_toolkit == 'qt3': + if not utils.canEnterGUIMode(): diff --git a/hplip.spec b/hplip.spec index 4cbc426..093cefd 100644 --- a/hplip.spec +++ b/hplip.spec @@ -7,7 +7,7 @@ Summary: HP Linux Imaging and Printing Project Name: hplip Version: 3.17.11 -Release: 3%{?dist} +Release: 4%{?dist} License: GPLv2+ and MIT and BSD Url: https://developers.hp.com/hp-linux-imaging-and-printing @@ -43,6 +43,7 @@ Patch26: hplip-appdata.patch Patch27: hplip-check-cups.patch Patch28: hplip-colorlaserjet-mfp-m278-m281.patch Patch29: hplip-jpeg-compression.patch +Patch30: hplip-typo.patch Requires: %{name}-libs%{?_isa} = %{version}-%{release} Requires: python3-pillow @@ -235,6 +236,9 @@ rm prnt/hpcups/ErnieFilter.{cpp,h} prnt/hpijs/ernieplatform.h # Unable to scan and save jpg with color with hp-scan (bug #1528851) %patch29 -p1 -b .jpeg-compression +# hp-firmware:NameError: name 'INTERACTIVE_MODE4' is not defined (bug #1533869) +%patch30 -p1 -b .typo + sed -i.duplex-constraints \ -e 's,\(UIConstraints.* \*Duplex\),//\1,' \ prnt/drv/hpcups.drv.in @@ -521,6 +525,9 @@ update-desktop-database &> /dev/null ||: %postun libs -p /sbin/ldconfig %changelog +* Fri Jan 12 2018 Zdenek Dohnal - 3.17.11-4 +- 1533869 - hp-firmware:NameError: name 'INTERACTIVE_MODE4' is not defined + * Mon Jan 08 2018 Zdenek Dohnal - 3.17.11-3 - fixing 1528851 for option -xraw From 69f362690d7db28a1acb7ed23bcc79238466c91f Mon Sep 17 00:00:00 2001 From: Zdenek Dohnal Date: Fri, 25 May 2018 10:31:52 +0200 Subject: [PATCH 2/9] hp-setup fails on fax setup - use binary strings --- hplip-use-binary-str.patch | 25 +++++++++++++++++++++++++ hplip.spec | 12 +++++++++++- 2 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 hplip-use-binary-str.patch diff --git a/hplip-use-binary-str.patch b/hplip-use-binary-str.patch new file mode 100644 index 0000000..d5ad630 --- /dev/null +++ b/hplip-use-binary-str.patch @@ -0,0 +1,25 @@ +diff -up hplip-3.18.5/fax/pmlfax.py.use-binary-str hplip-3.18.5/fax/pmlfax.py +--- hplip-3.18.5/fax/pmlfax.py.use-binary-str 2018-05-25 09:33:11.839375105 +0200 ++++ hplip-3.18.5/fax/pmlfax.py 2018-05-25 09:50:54.131762944 +0200 +@@ -143,8 +143,8 @@ class PMLFaxDevice(FaxDevice): + + def getPhoneNum(self): + if PY3: +- data = utils.printable(self.getPML(pml.OID_FAX_LOCAL_PHONE_NUM)[1]) +- return data ++ data = utils.printable(self.getPML(pml.OID_FAX_LOCAL_PHONE_NUM)[1].encode('utf-8')) ++ return data.decode('utf-8') + else: + return utils.printable(self.getPML(pml.OID_FAX_LOCAL_PHONE_NUM)[1]) + phone_num = property(getPhoneNum, setPhoneNum, doc="OID_FAX_LOCAL_PHONE_NUM") +@@ -155,8 +155,8 @@ class PMLFaxDevice(FaxDevice): + + def getStationName(self): + if PY3: +- data = utils.printable(self.getPML(pml.OID_FAX_STATION_NAME)[1]) +- return data ++ data = utils.printable(self.getPML(pml.OID_FAX_STATION_NAME)[1].encode('utf-8')) ++ return data.decode('utf-8') + else: + return utils.printable(self.getPML(pml.OID_FAX_STATION_NAME)[1]) + diff --git a/hplip.spec b/hplip.spec index 8e9b1d0..0092979 100644 --- a/hplip.spec +++ b/hplip.spec @@ -7,7 +7,7 @@ Summary: HP Linux Imaging and Printing Project Name: hplip Version: 3.18.5 -Release: 1%{?dist} +Release: 2%{?dist} License: GPLv2+ and MIT and BSD Url: https://developers.hp.com/hp-linux-imaging-and-printing @@ -42,6 +42,11 @@ Patch25: hplip-noernie.patch Patch26: hplip-appdata.patch Patch27: hplip-check-cups.patch Patch30: hplip-typo.patch +# python3 - recent HP release removed encoding/decoding to utf-8 in fax/pmlfax.py - +# that results in text string going into translate function in base/utils.py, which +# expects binary string because of parameters. Remove this patch if base/utils.py +# code gets fixed. +Patch31: hplip-use-binary-str.patch Requires: %{name}-libs%{?_isa} = %{version}-%{release} Requires: python3-pillow @@ -242,6 +247,8 @@ rm prnt/hpcups/ErnieFilter.{cpp,h} prnt/hpijs/ernieplatform.h # hp-firmware:NameError: name 'INTERACTIVE_MODE4' is not defined (bug #1533869) %patch30 -p1 -b .typo +%patch31 -p1 -b .use-binary-str + sed -i.duplex-constraints \ -e 's,\(UIConstraints.* \*Duplex\),//\1,' \ prnt/drv/hpcups.drv.in @@ -521,6 +528,9 @@ rm -f %{buildroot}%{_sysconfdir}/xdg/autostart/hplip-systray.desktop %postun libs -p /sbin/ldconfig %changelog +* Fri May 25 2018 Zdenek Dohnal - 3.18.5-2 +- hp-setup fails on fax setup - use binary strings + * Thu May 24 2018 Zdenek Dohnal - 3.18.5-1 - 3.18.5 From 69299052e9f639a930a8b554da338c399c16825b Mon Sep 17 00:00:00 2001 From: Zdenek Dohnal Date: Fri, 25 May 2018 10:39:50 +0200 Subject: [PATCH 3/9] m278-m281 doesn;t work correctly again --- hplip.spec | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/hplip.spec b/hplip.spec index 0092979..5632b93 100644 --- a/hplip.spec +++ b/hplip.spec @@ -47,6 +47,8 @@ Patch30: hplip-typo.patch # expects binary string because of parameters. Remove this patch if base/utils.py # code gets fixed. Patch31: hplip-use-binary-str.patch +# m278-m281 doesn't work correctly again +Patch32: hplip-colorlaserjet-mfp-m278-m281.patch Requires: %{name}-libs%{?_isa} = %{version}-%{release} Requires: python3-pillow @@ -248,6 +250,7 @@ rm prnt/hpcups/ErnieFilter.{cpp,h} prnt/hpijs/ernieplatform.h %patch30 -p1 -b .typo %patch31 -p1 -b .use-binary-str +%patch32 -p1 -b .colorlaserjet-mfp-m278-m281 sed -i.duplex-constraints \ -e 's,\(UIConstraints.* \*Duplex\),//\1,' \ @@ -530,6 +533,7 @@ rm -f %{buildroot}%{_sysconfdir}/xdg/autostart/hplip-systray.desktop %changelog * Fri May 25 2018 Zdenek Dohnal - 3.18.5-2 - hp-setup fails on fax setup - use binary strings +- m278-m281 doesn;t work correctly again * Thu May 24 2018 Zdenek Dohnal - 3.18.5-1 - 3.18.5 From 3041396460bc62f90ca9d056a546934054ae1447 Mon Sep 17 00:00:00 2001 From: Zdenek Dohnal Date: Tue, 29 May 2018 10:09:50 +0200 Subject: [PATCH 4/9] hp-setup fails on fax setup - use binary strings --- hplip-use-binary-str.patch | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/hplip-use-binary-str.patch b/hplip-use-binary-str.patch index d5ad630..319f1d6 100644 --- a/hplip-use-binary-str.patch +++ b/hplip-use-binary-str.patch @@ -1,6 +1,21 @@ +diff -up hplip-3.18.5/base/utils.py.use-binary-str hplip-3.18.5/base/utils.py +--- hplip-3.18.5/base/utils.py.use-binary-str 2018-05-28 13:52:32.698082273 +0200 ++++ hplip-3.18.5/base/utils.py 2018-05-28 13:53:20.563707314 +0200 +@@ -961,10 +961,7 @@ else: + + + def printable(s): +- if s: +- return s.translate(identity, unprintable) +- else: +- return "" ++ return s.translate(identity, unprintable) + + + def any(S,f=lambda x:x): diff -up hplip-3.18.5/fax/pmlfax.py.use-binary-str hplip-3.18.5/fax/pmlfax.py ---- hplip-3.18.5/fax/pmlfax.py.use-binary-str 2018-05-25 09:33:11.839375105 +0200 -+++ hplip-3.18.5/fax/pmlfax.py 2018-05-25 09:50:54.131762944 +0200 +--- hplip-3.18.5/fax/pmlfax.py.use-binary-str 2018-05-24 06:34:40.000000000 +0200 ++++ hplip-3.18.5/fax/pmlfax.py 2018-05-28 13:52:05.752293151 +0200 @@ -143,8 +143,8 @@ class PMLFaxDevice(FaxDevice): def getPhoneNum(self): From be9522f3f548f49c0143522f307a2c6ba5bba809 Mon Sep 17 00:00:00 2001 From: Zdenek Dohnal Date: Mon, 11 Jun 2018 18:52:06 +0200 Subject: [PATCH 5/9] 3.18.6, have cups running because hp tools --- .gitignore | 1 + hplip-3.18.5.tar.gz.asc | 7 ------- hplip-3.18.6.tar.gz.asc | 7 +++++++ hplip.spec | 27 ++++++++++++++++++--------- sources | 2 +- 5 files changed, 27 insertions(+), 17 deletions(-) delete mode 100644 hplip-3.18.5.tar.gz.asc create mode 100644 hplip-3.18.6.tar.gz.asc diff --git a/.gitignore b/.gitignore index a1de539..3f89025 100644 --- a/.gitignore +++ b/.gitignore @@ -88,3 +88,4 @@ hplip-3.10.6.tar.gz /hplip-3.18.3.tar.gz /hplip-3.18.4.tar.gz /hplip-3.18.5.tar.gz +/hplip-3.18.6.tar.gz diff --git a/hplip-3.18.5.tar.gz.asc b/hplip-3.18.5.tar.gz.asc deleted file mode 100644 index 346863a..0000000 --- a/hplip-3.18.5.tar.gz.asc +++ /dev/null @@ -1,7 +0,0 @@ ------BEGIN PGP SIGNATURE----- -Version: GnuPG v1.4.11 (GNU/Linux) - -iEYEABECAAYFAlsGQVgACgkQc9dwzaWQR7mUjACeOwZ9fTlMmyQN9U0NQVKsTrGS -lWEAmwYFt40RC2aKXYWfX39sAm4vtaF2 -=wCpt ------END PGP SIGNATURE----- diff --git a/hplip-3.18.6.tar.gz.asc b/hplip-3.18.6.tar.gz.asc new file mode 100644 index 0000000..8221531 --- /dev/null +++ b/hplip-3.18.6.tar.gz.asc @@ -0,0 +1,7 @@ +-----BEGIN PGP SIGNATURE----- +Version: GnuPG v1.4.11 (GNU/Linux) + +iEYEABECAAYFAlsYzCYACgkQc9dwzaWQR7k3kQCgpUG6Okb3nGf7qodmI9zTBf3A +a8AAoLD0LiwifYlnEBlHS5Eaw/ylB9A8 +=H/1x +-----END PGP SIGNATURE----- diff --git a/hplip.spec b/hplip.spec index 5632b93..dff7a44 100644 --- a/hplip.spec +++ b/hplip.spec @@ -6,8 +6,8 @@ Summary: HP Linux Imaging and Printing Project Name: hplip -Version: 3.18.5 -Release: 2%{?dist} +Version: 3.18.6 +Release: 1%{?dist} License: GPLv2+ and MIT and BSD Url: https://developers.hp.com/hp-linux-imaging-and-printing @@ -386,6 +386,19 @@ rm -f %{buildroot}%{_unitdir}/hplip-printer@.service # window), so don't ship the launcher yet. rm -f %{buildroot}%{_sysconfdir}/xdg/autostart/hplip-systray.desktop +# hp-setup needs to have cups service enabled and running for setups of queues +%pre +%{_bindir}/systemctl start cups &>/dev/null ||: +%{_bindir}/systemctl enable cups &>/dev/null ||: + +%post +%{_bindir}/hpcups-update-ppds &>/dev/null ||: + +%post libs -p /sbin/ldconfig + +%postun libs -p /sbin/ldconfig + + %files %doc COPYING doc/* # ex-hpijs @@ -523,14 +536,10 @@ rm -f %{buildroot}%{_sysconfdir}/xdg/autostart/hplip-systray.desktop %{_libdir}/sane/libsane-*.so.1.0.0 %config(noreplace) %{_sysconfdir}/sane.d/dll.d/hpaio -%post -%{_bindir}/hpcups-update-ppds &>/dev/null ||: - -%post libs -p /sbin/ldconfig - -%postun libs -p /sbin/ldconfig - %changelog +* Mon Jun 11 2018 Zdenek Dohnal - 3.18.6-1 +- 3.18.6, have cups running because hp tools + * Fri May 25 2018 Zdenek Dohnal - 3.18.5-2 - hp-setup fails on fax setup - use binary strings - m278-m281 doesn;t work correctly again diff --git a/sources b/sources index 260bf2a..0c9dbb3 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (hplip-3.18.5.tar.gz) = 2c99bb446af604a2f011f9dd5ddf4bf5019b7cd36a0ecb1cbe6dce0c0358b8472a695ad85d09e52c3e63de8a69e2a3e7081c61ec36f44aae2770b5fef0f67516 +SHA512 (hplip-3.18.6.tar.gz) = deb4e6e1c7e9ea7452967f7d7d7fd93e92eb59406b4978bb9b874db93bc5022b25aab012a7420ac3e991259032bc7cb749cd924c93a164544e29a4152962184f From 64d2bd8751d540907ce653591d6dfa62926ae065 Mon Sep 17 00:00:00 2001 From: Tomas Korbar Date: Tue, 25 Sep 2018 19:59:12 +0200 Subject: [PATCH 6/9] 1564770 - Fix TypeError when printing error object message --- hplip-error-print.patch | 78 +++++++++++++++++++++++++++++++++++++++++ hplip.spec | 12 ++++++- 2 files changed, 89 insertions(+), 1 deletion(-) create mode 100644 hplip-error-print.patch diff --git a/hplip-error-print.patch b/hplip-error-print.patch new file mode 100644 index 0000000..e4b3e5f --- /dev/null +++ b/hplip-error-print.patch @@ -0,0 +1,78 @@ +commit 4c913b68d8f8a79e11e247a8f7086f779f2685d4 +Author: Tomas Korbar +Date: Tue Sep 18 16:17:06 2018 +0200 + + Fix TypeError + + - 1564770 - TypeError: 'Error' object does not support indexing + +diff --git a/clean.py b/clean.py +index 3d41f04..3a7248e 100755 +--- a/clean.py ++++ b/clean.py +@@ -182,7 +182,7 @@ try: + log.error("Cleaning not needed or supported on this device.") + + except Error as e: +- log.error("An error occured: %s" % e[0]) ++ log.error("An error occured: %s" % e.msg) + + else: + log.error("Device is busy or in an error state. Please check device and try again.") +diff --git a/ui/scrollunload.py b/ui/scrollunload.py +index fdb48e8..345ed82 100644 +--- a/ui/scrollunload.py ++++ b/ui/scrollunload.py +@@ -120,7 +120,7 @@ class ScrollUnloadView(ScrollView): + self.pc = photocard.PhotoCard(None, self.cur_device.device_uri, self.cur_printer) + except Error as e: + QApplication.restoreOverrideCursor() +- self.form.FailureUI(self.__tr("An error occured: %s" % e[0])) ++ self.form.FailureUI(self.__tr("An error occured: %s" % e.msg)) + self.cleanup(EVENT_PCARD_UNABLE_TO_MOUNT) + return False + +diff --git a/ui4/wifisetupdialog.py b/ui4/wifisetupdialog.py +index 9fd1786..4d36f83 100644 +--- a/ui4/wifisetupdialog.py ++++ b/ui4/wifisetupdialog.py +@@ -256,7 +256,7 @@ class WifiSetupDialog(QDialog, Ui_Dialog): + try: + self.dev = device.Device(self.device_uri) + except Error as e: +- FailureUI(self, self.__tr("Error opening device:

%s

(%s)

") %(self.device_uri, QString(e[0]))) ++ FailureUI(self, self.__tr("Error opening device:

%s

(%s)

") %(self.device_uri, QString(e.msg))) + + if self.dev is not None: + self.dev.close() +@@ -834,7 +834,7 @@ class WifiSetupDialog(QDialog, Ui_Dialog): + + + def showIOError(self, e): +- FailureUI(self, self.__tr("An I/O error occurred.

Please check the USB connection to your printer and try again.

(%s)" % QString(e[0]))) ++ FailureUI(self, self.__tr("An I/O error occurred.

Please check the USB connection to your printer and try again.

(%s)" % QString(e.msg))) + + if self.dev is not None: + self.dev.close() +diff --git a/ui5/wifisetupdialog.py b/ui5/wifisetupdialog.py +index e0c7aee..74cc0ef 100644 +--- a/ui5/wifisetupdialog.py ++++ b/ui5/wifisetupdialog.py +@@ -259,7 +259,7 @@ class WifiSetupDialog(QDialog, Ui_Dialog): + try: + self.dev = device.Device(self.device_uri) + except Error as e: +- FailureUI(self, self.__tr("Error opening device:

%s

(%s)

") %(self.device_uri, str(e[0]))) ++ FailureUI(self, self.__tr("Error opening device:

%s

(%s)

") %(self.device_uri, str(e.msg))) + + if self.dev is not None: + self.dev.close() +@@ -840,7 +840,7 @@ class WifiSetupDialog(QDialog, Ui_Dialog): + + + def showIOError(self, e): +- FailureUI(self, self.__tr("An I/O error occurred.

Please check the USB connection to your printer and try again.

(%s)" % str(e[0]))) ++ FailureUI(self, self.__tr("An I/O error occurred.

Please check the USB connection to your printer and try again.

(%s)" % str(e.msg))) + + if self.dev is not None: + self.dev.close() diff --git a/hplip.spec b/hplip.spec index dff7a44..9a935cc 100644 --- a/hplip.spec +++ b/hplip.spec @@ -7,7 +7,7 @@ Summary: HP Linux Imaging and Printing Project Name: hplip Version: 3.18.6 -Release: 1%{?dist} +Release: 2%{?dist} License: GPLv2+ and MIT and BSD Url: https://developers.hp.com/hp-linux-imaging-and-printing @@ -49,6 +49,7 @@ Patch30: hplip-typo.patch Patch31: hplip-use-binary-str.patch # m278-m281 doesn't work correctly again Patch32: hplip-colorlaserjet-mfp-m278-m281.patch +Patch33: hplip-error-print.patch Requires: %{name}-libs%{?_isa} = %{version}-%{release} Requires: python3-pillow @@ -252,6 +253,12 @@ rm prnt/hpcups/ErnieFilter.{cpp,h} prnt/hpijs/ernieplatform.h %patch31 -p1 -b .use-binary-str %patch32 -p1 -b .colorlaserjet-mfp-m278-m281 +# TypeError: 'Error' object does not support indexing (bug #1564770) +# upstream bug: https://bugs.launchpad.net/ubuntu/+source/hplip/+bug/1718129 +# in python2 it was possible to acces Exception message by index [0]. +# in python3 this is no longer possible and it causes TypeError. +%patch33 -p1 -b .error-print-fix + sed -i.duplex-constraints \ -e 's,\(UIConstraints.* \*Duplex\),//\1,' \ prnt/drv/hpcups.drv.in @@ -537,6 +544,9 @@ rm -f %{buildroot}%{_sysconfdir}/xdg/autostart/hplip-systray.desktop %config(noreplace) %{_sysconfdir}/sane.d/dll.d/hpaio %changelog +* Tue Sep 25 2018 Tomas Korbar - 3.18.6-2 +- 1564770 - Fix TypeError when printing error object message + * Mon Jun 11 2018 Zdenek Dohnal - 3.18.6-1 - 3.18.6, have cups running because hp tools From 68682cce79eb8f3850e296f203cb24cc48799489 Mon Sep 17 00:00:00 2001 From: Tomas Korbar Date: Tue, 25 Sep 2018 20:05:21 +0200 Subject: [PATCH 7/9] 1566938 - Fix TypeError when printing ImportError message in hpfax --- hplip-hpfax-importerror-print.patch | 19 +++++++++++++++++++ hplip.spec | 11 ++++++++++- 2 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 hplip-hpfax-importerror-print.patch diff --git a/hplip-hpfax-importerror-print.patch b/hplip-hpfax-importerror-print.patch new file mode 100644 index 0000000..8d487c4 --- /dev/null +++ b/hplip-hpfax-importerror-print.patch @@ -0,0 +1,19 @@ +commit cdf5cb36e5d5a86f6a690c5861666cdc2da70593 +Author: Tomas Korbar +Date: Wed Sep 19 15:33:03 2018 +0200 + + Fix TypeError in hpfax + +diff --git a/fax/backend/hpfax.py b/fax/backend/hpfax.py +index 9560e84..bc0912a 100755 +--- a/fax/backend/hpfax.py ++++ b/fax/backend/hpfax.py +@@ -89,7 +89,7 @@ try: + from base import utils + from prnt import cups + except ImportError as e: +- bug("Error importing HPLIP modules: %s\n" % (pid, e)) ++ bug("Error importing HPLIP modules: %s\n" % (e)) + sys.exit(1) + + def handle_sigpipe(): diff --git a/hplip.spec b/hplip.spec index 9a935cc..bfa1b63 100644 --- a/hplip.spec +++ b/hplip.spec @@ -7,7 +7,7 @@ Summary: HP Linux Imaging and Printing Project Name: hplip Version: 3.18.6 -Release: 2%{?dist} +Release: 3%{?dist} License: GPLv2+ and MIT and BSD Url: https://developers.hp.com/hp-linux-imaging-and-printing @@ -50,6 +50,7 @@ Patch31: hplip-use-binary-str.patch # m278-m281 doesn't work correctly again Patch32: hplip-colorlaserjet-mfp-m278-m281.patch Patch33: hplip-error-print.patch +Patch34: hplip-hpfax-importerror-print.patch Requires: %{name}-libs%{?_isa} = %{version}-%{release} Requires: python3-pillow @@ -259,6 +260,11 @@ rm prnt/hpcups/ErnieFilter.{cpp,h} prnt/hpijs/ernieplatform.h # in python3 this is no longer possible and it causes TypeError. %patch33 -p1 -b .error-print-fix +# TypeError: not all arguments converted during string formatting (bug #1566938) +# upstream bug: https://bugs.launchpad.net/ubuntu/+source/hplip/+bug/616450 +# bug caused by more arguments than argument specifiers in formatted string +%patch34 -p1 -b .hpfax-import-error-print + sed -i.duplex-constraints \ -e 's,\(UIConstraints.* \*Duplex\),//\1,' \ prnt/drv/hpcups.drv.in @@ -544,6 +550,9 @@ rm -f %{buildroot}%{_sysconfdir}/xdg/autostart/hplip-systray.desktop %config(noreplace) %{_sysconfdir}/sane.d/dll.d/hpaio %changelog +* Tue Sep 25 2018 Tomas Korbar - 3.18.6-3 +- 1566938 - Fix TypeError when printing ImportError message in hpfax + * Tue Sep 25 2018 Tomas Korbar - 3.18.6-2 - 1564770 - Fix TypeError when printing error object message From 75324e654fba0634e60316f6f8ecd601c85d4968 Mon Sep 17 00:00:00 2001 From: Tomas Korbar Date: Tue, 9 Oct 2018 16:41:18 +0200 Subject: [PATCH 8/9] 1626877 - Fix AttributeError when connecting to printer via wifi --- hplip-wifisetup.patch | 19 +++++++++++++++++++ hplip.spec | 12 +++++++++++- 2 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 hplip-wifisetup.patch diff --git a/hplip-wifisetup.patch b/hplip-wifisetup.patch new file mode 100644 index 0000000..9b0cda9 --- /dev/null +++ b/hplip-wifisetup.patch @@ -0,0 +1,19 @@ +commit 7cdc26da185db2335f1efdc6716804266caa1712 +Author: Tomas Korbar +Date: Thu Sep 20 15:04:47 2018 +0200 + + Fix wifi printer setup + +diff --git a/ui5/wifisetupdialog.py b/ui5/wifisetupdialog.py +index 74cc0ef..8daff7d 100644 +--- a/ui5/wifisetupdialog.py ++++ b/ui5/wifisetupdialog.py +@@ -570,7 +570,7 @@ class WifiSetupDialog(QDialog, Ui_Dialog): + try: + self.ip,_,addressmode, subnetmask, gateway, pridns, sec_dns= self.wifiObj.getIPConfiguration(self.dev, self.adapterName) + if self.ip == "0.0.0.0": +- self.ip, subnetmask, gateway, pri_dns, sec_dns, addressmode = self.wifiobj.getwifiotherdetails(self.dev,self.adapterName) ++ self.ip, subnetmask, gateway, pridns, sec_dns, addressmode = self.wifiObj.getwifiotherdetails(self.dev,self.adapterName) + vsa_codes = self.wifiObj.getVSACodes(self.dev, self.adapterName) + ss_max, ss_min, ss_val, ss_dbm = self.wifiObj.getSignalStrength(self.dev, self.adapterName,self.network, self.adaptor_id) + self.hn = self.wifiObj.getHostname(self.dev) diff --git a/hplip.spec b/hplip.spec index bfa1b63..b5d9a53 100644 --- a/hplip.spec +++ b/hplip.spec @@ -7,7 +7,7 @@ Summary: HP Linux Imaging and Printing Project Name: hplip Version: 3.18.6 -Release: 3%{?dist} +Release: 4%{?dist} License: GPLv2+ and MIT and BSD Url: https://developers.hp.com/hp-linux-imaging-and-printing @@ -51,6 +51,7 @@ Patch31: hplip-use-binary-str.patch Patch32: hplip-colorlaserjet-mfp-m278-m281.patch Patch33: hplip-error-print.patch Patch34: hplip-hpfax-importerror-print.patch +Patch35: hplip-wifisetup.patch Requires: %{name}-libs%{?_isa} = %{version}-%{release} Requires: python3-pillow @@ -265,6 +266,12 @@ rm prnt/hpcups/ErnieFilter.{cpp,h} prnt/hpijs/ernieplatform.h # bug caused by more arguments than argument specifiers in formatted string %patch34 -p1 -b .hpfax-import-error-print +# 'WifiSetupDialog' object has no attribute 'wifiobj' (bug #1626877) +# upstream bug: https://bugs.launchpad.net/hplip/+bug/1752060 +# bug caused by typo in wifisetupdialog wifiObj property call +%patch35 -p1 -b .wifisetup-bad-call-fix + + sed -i.duplex-constraints \ -e 's,\(UIConstraints.* \*Duplex\),//\1,' \ prnt/drv/hpcups.drv.in @@ -550,6 +557,9 @@ rm -f %{buildroot}%{_sysconfdir}/xdg/autostart/hplip-systray.desktop %config(noreplace) %{_sysconfdir}/sane.d/dll.d/hpaio %changelog +* Tue Oct 09 2018 Tomas Korbar - 3.18.6-4 +- 1626877 - Fix AttributeError when connecting to printer via wifi + * Tue Sep 25 2018 Tomas Korbar - 3.18.6-3 - 1566938 - Fix TypeError when printing ImportError message in hpfax From 2cdc415bacc80e610c6780dbe7e0e4bc86ab6749 Mon Sep 17 00:00:00 2001 From: Tomas Korbar Date: Tue, 9 Oct 2018 16:57:09 +0200 Subject: [PATCH 9/9] 1594602 - Fix typos in QMessageBox constructor calls --- hplip-qmsgbox-typos.patch | 68 +++++++++++++++++++++++++++++++++++++++ hplip.spec | 11 ++++++- 2 files changed, 78 insertions(+), 1 deletion(-) create mode 100644 hplip-qmsgbox-typos.patch diff --git a/hplip-qmsgbox-typos.patch b/hplip-qmsgbox-typos.patch new file mode 100644 index 0000000..4a64668 --- /dev/null +++ b/hplip-qmsgbox-typos.patch @@ -0,0 +1,68 @@ +commit 7623eb3c83d91405471177d750ab0ae8fd05a0d6 +Author: Tomas Korbar +Date: Mon Oct 1 16:27:36 2018 +0200 + + Fix typos in QMessageBox constructors + +diff --git a/ui5/devmgr5.py b/ui5/devmgr5.py +index 35bdcb7..267cfba 100644 +--- a/ui5/devmgr5.py ++++ b/ui5/devmgr5.py +@@ -139,8 +139,7 @@ class PluginInstall(QObject): + install_plugin = QMessageBox.warning(self.parent, + self.parent.windowTitle(), + self.__tr("The HPLIP plugin is already installed.

Do you want to continue and re-install it?"), +- QMessageBox.Yes, +- QMessageBox.No, ++ QMessageBox.Yes | QMessageBox.No, + QMessageBox.NoButton) == QMessageBox.Yes + + if install_plugin: +@@ -149,8 +148,7 @@ class PluginInstall(QObject): + QMessageBox.critical(self.parent, + self.parent.windowTitle(), + self.__tr("Unable to find an appropriate su/sudo utility to run hp-plugin.

Install kdesu, gnomesu, or gksu.

"), +- QMessageBox.Ok, +- QMessageBox.NoButton, ++ QMessageBox.Ok | QMessageBox.NoButton, + QMessageBox.NoButton) + + +diff --git a/ui5/nodevicesdialog.py b/ui5/nodevicesdialog.py +index 6083f6d..ca86bfc 100644 +--- a/ui5/nodevicesdialog.py ++++ b/ui5/nodevicesdialog.py +@@ -64,8 +64,7 @@ class NoDevicesDialog(QDialog, Ui_NoDevicesDialog_base): + QMessageBox.critical(self, + self.windowTitle(), + self.__tr("An error occurred.

Please re-start the Device Manager and try again."), +- QMessageBox.Ok, +- QMessageBox.NoButton, ++ QMessageBox.Ok | QMessageBox.NoButton, + QMessageBox.NoButton) + + +diff --git a/ui5/setupdialog.py b/ui5/setupdialog.py +index fbfe5ac..05e2b1d 100644 +--- a/ui5/setupdialog.py ++++ b/ui5/setupdialog.py +@@ -1108,8 +1108,7 @@ class SetupDialog(QDialog, Ui_Dialog): + if QMessageBox.critical(self, + self.windowTitle(), + error_text, +- QMessageBox.Retry | QMessageBox.Default, +- QMessageBox.Cancel | QMessageBox.Escape, ++ QMessageBox.Retry | QMessageBox.Default | QMessageBox.Cancel | QMessageBox.Escape, + QMessageBox.NoButton) == QMessageBox.Cancel: + break + +@@ -1138,8 +1137,7 @@ class SetupDialog(QDialog, Ui_Dialog): + if QMessageBox.critical(self, + self.windowTitle(), + error_text, +- QMessageBox.Retry | QMessageBox.Default, +- QMessageBox.Cancel | QMessageBox.Escape, ++ QMessageBox.Retry | QMessageBox.Default | QMessageBox.Cancel | QMessageBox.Escape, + QMessageBox.NoButton) == QMessageBox.Cancel: + break + diff --git a/hplip.spec b/hplip.spec index b5d9a53..5ba9e75 100644 --- a/hplip.spec +++ b/hplip.spec @@ -7,7 +7,7 @@ Summary: HP Linux Imaging and Printing Project Name: hplip Version: 3.18.6 -Release: 4%{?dist} +Release: 5%{?dist} License: GPLv2+ and MIT and BSD Url: https://developers.hp.com/hp-linux-imaging-and-printing @@ -52,6 +52,7 @@ Patch32: hplip-colorlaserjet-mfp-m278-m281.patch Patch33: hplip-error-print.patch Patch34: hplip-hpfax-importerror-print.patch Patch35: hplip-wifisetup.patch +Patch36: hplip-qmsgbox-typos.patch Requires: %{name}-libs%{?_isa} = %{version}-%{release} Requires: python3-pillow @@ -271,6 +272,11 @@ rm prnt/hpcups/ErnieFilter.{cpp,h} prnt/hpijs/ernieplatform.h # bug caused by typo in wifisetupdialog wifiObj property call %patch35 -p1 -b .wifisetup-bad-call-fix +# TypeError: argument 5 has unexpected type 'StandardButtons' (bug #1594602) +# upstream bug: https://bugs.launchpad.net/ubuntu/+source/hplip/+bug/1745383 +# bug caused by typo in QMessageBox constructor call +# this patch fixes more of those typos +%patch36 -p1 -b .qmsgbox-typos-fix sed -i.duplex-constraints \ -e 's,\(UIConstraints.* \*Duplex\),//\1,' \ @@ -557,6 +563,9 @@ rm -f %{buildroot}%{_sysconfdir}/xdg/autostart/hplip-systray.desktop %config(noreplace) %{_sysconfdir}/sane.d/dll.d/hpaio %changelog +* Tue Oct 09 2018 Tomas Korbar - 3.18.6-5 +- 1594602 - Fix typos in QMessageBox constructor calls + * Tue Oct 09 2018 Tomas Korbar - 3.18.6-4 - 1626877 - Fix AttributeError when connecting to printer via wifi