From 3e7f8d1653421a673b3b80e0a2a467d3a5b85b10 Mon Sep 17 00:00:00 2001 From: Tim Waugh Date: Mon, 13 Dec 2010 16:47:39 +0000 Subject: [PATCH 1/5] Catch D-Bus exceptions in fax dialog (bug #645316). --- hplip-dbus-exception.patch | 18 ++++++++++++++++++ hplip.spec | 9 ++++++++- 2 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 hplip-dbus-exception.patch diff --git a/hplip-dbus-exception.patch b/hplip-dbus-exception.patch new file mode 100644 index 0000000..b32fc3d --- /dev/null +++ b/hplip-dbus-exception.patch @@ -0,0 +1,18 @@ +diff -up hplip-3.10.9/ui4/sendfaxdialog.py~ hplip-3.10.9/ui4/sendfaxdialog.py +--- hplip-3.10.9/ui4/sendfaxdialog.py~ 2010-09-26 18:07:19.000000000 +0100 ++++ hplip-3.10.9/ui4/sendfaxdialog.py 2010-12-13 16:44:56.857648866 +0000 +@@ -915,8 +915,12 @@ class SendFaxDialog(QDialog, Ui_Dialog): + def CheckTimer_timeout(self): + if not self.busy: + #log.debug("Checking for incoming faxes...") +- device_uri, printer_name, event_code, username, job_id, title, timedate, fax_file = \ +- self.service.CheckForWaitingFax(self.device_uri, prop.username, self.last_job_id) ++ try: ++ device_uri, printer_name, event_code, username, job_id, title, timedate, fax_file = \ ++ self.service.CheckForWaitingFax(self.device_uri, prop.username, self.last_job_id) ++ except Exception, e: ++ log.debug("Exception caught: %s" % e) ++ fax_file = None + + if fax_file: + self.last_job_id = 0 diff --git a/hplip.spec b/hplip.spec index 9d05f71..fb0924a 100644 --- a/hplip.spec +++ b/hplip.spec @@ -1,7 +1,7 @@ Summary: HP Linux Imaging and Printing Project Name: hplip Version: 3.10.9 -Release: 8%{?dist} +Release: 9%{?dist} License: GPLv2+ and MIT Group: System Environment/Daemons Conflicts: system-config-printer < 0.6.132 @@ -43,6 +43,7 @@ Patch26: hplip-UnicodeDecodeError.patch Patch27: hplip-emit-SIGNAL.patch Patch28: hplip-fab-root-crash.patch Patch29: hplip-addprinter.patch +Patch30: hplip-dbus-exception.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) @@ -272,6 +273,9 @@ done # that we can get an authentication callback (bug #538352). %patch29 -p1 -b .addprinter +# Catch D-Bus exceptions in fax dialog (bug #645316). +%patch30 -p1 -b .dbus-exception + sed -i.duplex-constraints \ -e 's,\(UIConstraints.* \*Duplex\),//\1,' \ prnt/drv/hpcups.drv.in @@ -498,6 +502,9 @@ fi %postun libs -p /sbin/ldconfig %changelog +* Mon Dec 13 2010 Tim Waugh - 3.10.9-9 +- Catch D-Bus exceptions in fax dialog (bug #645316). + * Fri Dec 03 2010 Jiri Popelka 3.10.9-8 - Corrected IEEE 1284 Device IDs: HP Color LaserJet CP2025dn (bug #651509). From 7ba5478f32bcdbc90e4b3eacd03c5add6d10f986 Mon Sep 17 00:00:00 2001 From: Tim Waugh Date: Mon, 13 Dec 2010 16:54:46 +0000 Subject: [PATCH 2/5] Prevent hpaio segfaulting on invalid URIs (bug #649092). --- hplip-hpaio-segfault.patch | 11 +++++++++++ hplip.spec | 5 +++++ 2 files changed, 16 insertions(+) create mode 100644 hplip-hpaio-segfault.patch diff --git a/hplip-hpaio-segfault.patch b/hplip-hpaio-segfault.patch new file mode 100644 index 0000000..936c5d0 --- /dev/null +++ b/hplip-hpaio-segfault.patch @@ -0,0 +1,11 @@ +diff -up hplip-3.10.9/io/hpmud/hpmud.c.hpaio-segfault hplip-3.10.9/io/hpmud/hpmud.c +--- hplip-3.10.9/io/hpmud/hpmud.c.hpaio-segfault 2010-12-13 16:53:16.470306314 +0000 ++++ hplip-3.10.9/io/hpmud/hpmud.c 2010-12-13 16:53:17.423332321 +0000 +@@ -305,6 +305,7 @@ static int new_device(const char *uri, e + { + BUG("invalid uri %s\n", uri); + *result = HPMUD_R_INVALID_URI; ++ index = 0; + goto bugout; + } + msp->device[i].io_mode = mode; diff --git a/hplip.spec b/hplip.spec index fb0924a..83e9a0d 100644 --- a/hplip.spec +++ b/hplip.spec @@ -44,6 +44,7 @@ Patch27: hplip-emit-SIGNAL.patch Patch28: hplip-fab-root-crash.patch Patch29: hplip-addprinter.patch Patch30: hplip-dbus-exception.patch +Patch31: hplip-hpaio-segfault.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) @@ -276,6 +277,9 @@ done # Catch D-Bus exceptions in fax dialog (bug #645316). %patch30 -p1 -b .dbus-exception +# Prevent hpaio segfaulting on invalid URIs (bug #649092). +%patch31 -p1 -b .hpaio-segfault + sed -i.duplex-constraints \ -e 's,\(UIConstraints.* \*Duplex\),//\1,' \ prnt/drv/hpcups.drv.in @@ -503,6 +507,7 @@ fi %changelog * Mon Dec 13 2010 Tim Waugh - 3.10.9-9 +- Prevent hpaio segfaulting on invalid URIs (bug #649092). - Catch D-Bus exceptions in fax dialog (bug #645316). * Fri Dec 03 2010 Jiri Popelka 3.10.9-8 From d5c7c97b54c920eeefbfca15a4ce9f7f40ed24ea Mon Sep 17 00:00:00 2001 From: Tim Waugh Date: Tue, 14 Dec 2010 15:13:00 +0000 Subject: [PATCH 3/5] Another missing newline in filter output (Ubuntu #418053). --- hplip-newline.patch | 12 ++++++++++++ hplip.spec | 7 ++++++- 2 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 hplip-newline.patch diff --git a/hplip-newline.patch b/hplip-newline.patch new file mode 100644 index 0000000..a94f67f --- /dev/null +++ b/hplip-newline.patch @@ -0,0 +1,12 @@ +diff -up hplip-3.10.9/prnt/hpcups/HPCupsFilter.cpp.newline hplip-3.10.9/prnt/hpcups/HPCupsFilter.cpp +--- hplip-3.10.9/prnt/hpcups/HPCupsFilter.cpp.newline 2010-12-14 15:10:25.730407116 +0000 ++++ hplip-3.10.9/prnt/hpcups/HPCupsFilter.cpp 2010-12-14 15:11:27.343440547 +0000 +@@ -608,7 +608,7 @@ int HPCupsFilter::processRasterData(cups + WriteBMPHeader (kfp, cups_header.cupsWidth, cups_header.cupsHeight, BLACK_RASTER); + } + +- fprintf(stderr, "PAGE: %d %s", current_page_number, m_argv[4]); ++ fprintf(stderr, "PAGE: %d %s\n", current_page_number, m_argv[4]); + // Iterating through the raster per page + for (int y = 0; y < (int) cups_header.cupsHeight; y++) { + cupsRasterReadPixels (cups_raster, m_pPrinterBuffer, cups_header.cupsBytesPerLine); diff --git a/hplip.spec b/hplip.spec index 83e9a0d..0206dd5 100644 --- a/hplip.spec +++ b/hplip.spec @@ -45,6 +45,7 @@ Patch28: hplip-fab-root-crash.patch Patch29: hplip-addprinter.patch Patch30: hplip-dbus-exception.patch Patch31: hplip-hpaio-segfault.patch +Patch32: hplip-newline.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) @@ -280,6 +281,9 @@ done # Prevent hpaio segfaulting on invalid URIs (bug #649092). %patch31 -p1 -b .hpaio-segfault +# Another missing newline in filter output (Ubuntu #418053). +%patch32 -p1 -b .newline + sed -i.duplex-constraints \ -e 's,\(UIConstraints.* \*Duplex\),//\1,' \ prnt/drv/hpcups.drv.in @@ -506,7 +510,8 @@ fi %postun libs -p /sbin/ldconfig %changelog -* Mon Dec 13 2010 Tim Waugh - 3.10.9-9 +* Tue Dec 14 2010 Tim Waugh - 3.10.9-9 +- Another missing newline in filter output (Ubuntu #418053). - Prevent hpaio segfaulting on invalid URIs (bug #649092). - Catch D-Bus exceptions in fax dialog (bug #645316). From 7ec91682f9dd220be5e7b7246cf8a442a8164562 Mon Sep 17 00:00:00 2001 From: Tim Waugh Date: Tue, 14 Dec 2010 15:53:12 +0000 Subject: [PATCH 4/5] Fixed incorrect signal name in setup dialog (bug #653626). --- hplip-emit-SIGNAL.patch | 16 ++++++++++------ hplip.spec | 1 + 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/hplip-emit-SIGNAL.patch b/hplip-emit-SIGNAL.patch index e627fd5..aa72dce 100644 --- a/hplip-emit-SIGNAL.patch +++ b/hplip-emit-SIGNAL.patch @@ -1,20 +1,24 @@ diff -up hplip-3.10.9/ui4/setupdialog.py.emit-SIGNAL hplip-3.10.9/ui4/setupdialog.py ---- hplip-3.10.9/ui4/setupdialog.py.emit-SIGNAL 2010-11-10 18:42:13.000000000 +0100 -+++ hplip-3.10.9/ui4/setupdialog.py 2010-11-11 11:59:47.000000000 +0100 -@@ -868,7 +868,7 @@ class SetupDialog(QDialog, Ui_Dialog): +--- hplip-3.10.9/ui4/setupdialog.py.emit-SIGNAL 2010-12-14 15:51:43.579041162 +0000 ++++ hplip-3.10.9/ui4/setupdialog.py 2010-12-14 15:52:02.631111875 +0000 +@@ -867,8 +867,8 @@ class SetupDialog(QDialog, Ui_Dialog): + self.printer_fax_names_same = False self.printer_name_ok = True - self.FaxNameLineEdit.emit(SIGNAL("textChanged(const QString &)"), +- self.FaxNameLineEdit.emit(SIGNAL("textChanged(const QString &)"), - (self.FaxNameLineEdit.text(),)) ++ self.FaxNameLineEdit.emit(SIGNAL("textEdited(const QString &)"), + self.FaxNameLineEdit.text()) self.setIndicators() self.setAddPrinterButton() -@@ -900,7 +900,7 @@ class SetupDialog(QDialog, Ui_Dialog): +@@ -899,8 +899,8 @@ class SetupDialog(QDialog, Ui_Dialog): + self.printer_fax_names_same = False self.fax_name_ok = True - self.PrinterNameLineEdit.emit(SIGNAL("textChanged(const QString&)"), +- self.PrinterNameLineEdit.emit(SIGNAL("textChanged(const QString&)"), - (self.PrinterNameLineEdit.text(),)) ++ self.PrinterNameLineEdit.emit(SIGNAL("textEdited(const QString &)"), + self.PrinterNameLineEdit.text()) self.setIndicators() diff --git a/hplip.spec b/hplip.spec index 0206dd5..0d16ca3 100644 --- a/hplip.spec +++ b/hplip.spec @@ -511,6 +511,7 @@ fi %changelog * Tue Dec 14 2010 Tim Waugh - 3.10.9-9 +- Fixed incorrect signal name in setup dialog (bug #653626). - Another missing newline in filter output (Ubuntu #418053). - Prevent hpaio segfaulting on invalid URIs (bug #649092). - Catch D-Bus exceptions in fax dialog (bug #645316). From 44b71e7e458e93c066b63cb265053e7d5156397e Mon Sep 17 00:00:00 2001 From: Tim Waugh Date: Wed, 15 Dec 2010 10:58:51 +0000 Subject: [PATCH 5/5] Enable D-Bus threading (and require pygobject2) (bug #600932). --- hplip-dbus-threads.patch | 16 ++++++++++++++++ hplip.spec | 8 +++++++- 2 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 hplip-dbus-threads.patch diff --git a/hplip-dbus-threads.patch b/hplip-dbus-threads.patch new file mode 100644 index 0000000..ceae607 --- /dev/null +++ b/hplip-dbus-threads.patch @@ -0,0 +1,16 @@ +diff -up hplip-3.10.9/toolbox.py.dbus-threads hplip-3.10.9/toolbox.py +--- hplip-3.10.9/toolbox.py.dbus-threads 2010-12-15 10:54:17.178739842 +0000 ++++ hplip-3.10.9/toolbox.py 2010-12-15 10:57:09.923712662 +0000 +@@ -100,8 +100,11 @@ if ui_toolkit == 'qt3': + try: + from dbus import SessionBus + import dbus.service +- from dbus.mainloop.glib import DBusGMainLoop ++ from dbus.mainloop.glib import DBusGMainLoop, threads_init + from gobject import MainLoop ++ import glib ++ glib.threads_init(); ++ dbus.mainloop.glib.threads_init() + except ImportError: + log.error("Unable to load dbus - Automatic status updates in HPLIP Device Manager will be disabled.") + disable_dbus = True diff --git a/hplip.spec b/hplip.spec index 0d16ca3..001c70c 100644 --- a/hplip.spec +++ b/hplip.spec @@ -46,6 +46,7 @@ Patch29: hplip-addprinter.patch Patch30: hplip-dbus-exception.patch Patch31: hplip-hpaio-segfault.patch Patch32: hplip-newline.patch +Patch33: hplip-dbus-threads.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) @@ -102,6 +103,7 @@ Group: Applications/System License: BSD Requires: PyQt4 Requires: python-reportlab +Requires: pygobject2 Requires(post): desktop-file-utils >= 0.2.92 Requires(postun): desktop-file-utils >= 0.2.92 Requires: %{name} = %{version}-%{release} @@ -284,6 +286,9 @@ done # Another missing newline in filter output (Ubuntu #418053). %patch32 -p1 -b .newline +# Enable D-Bus threading (and require pygobject2) (bug #600932). +%patch33 -p1 -b .dbus-threads + sed -i.duplex-constraints \ -e 's,\(UIConstraints.* \*Duplex\),//\1,' \ prnt/drv/hpcups.drv.in @@ -510,7 +515,8 @@ fi %postun libs -p /sbin/ldconfig %changelog -* Tue Dec 14 2010 Tim Waugh - 3.10.9-9 +* Wed Dec 15 2010 Tim Waugh - 3.10.9-9 +- Enable D-Bus threading (and require pygobject2) (bug #600932). - Fixed incorrect signal name in setup dialog (bug #653626). - Another missing newline in filter output (Ubuntu #418053). - Prevent hpaio segfaulting on invalid URIs (bug #649092).