From fd06888db253335e86f72846c16d73de160c3cb5 Mon Sep 17 00:00:00 2001 From: Tim Waugh Date: Mon, 18 Oct 2010 17:25:20 +0100 Subject: [PATCH 1/2] Fixed bogus low ink warnings from hpijs driver (bug #643643). --- hplip-hpijs-marker-supply.patch | 31 +++++++++++++++++++++++++++++++ hplip.spec | 9 ++++++++- 2 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 hplip-hpijs-marker-supply.patch diff --git a/hplip-hpijs-marker-supply.patch b/hplip-hpijs-marker-supply.patch new file mode 100644 index 0000000..c5fce9c --- /dev/null +++ b/hplip-hpijs-marker-supply.patch @@ -0,0 +1,31 @@ +diff -up hplip-3.10.9/prnt/hpijs/hpijs.cpp.hpijs-marker-supply hplip-3.10.9/prnt/hpijs/hpijs.cpp +--- hplip-3.10.9/prnt/hpijs/hpijs.cpp.hpijs-marker-supply 2010-10-18 16:58:23.882993673 +0100 ++++ hplip-3.10.9/prnt/hpijs/hpijs.cpp 2010-10-18 17:00:00.510869032 +0100 +@@ -585,6 +585,7 @@ int main (int argc, char *argv[], char * + char *raster = NULL, *k_raster = NULL; + int status = EXIT_FAILURE; + int ret, n, i, kn=0, width, k_width; ++ int low_marker = 0; + + openlog("hpijs", LOG_PID, LOG_DAEMON); + +@@ -666,14 +667,17 @@ int main (int argc, char *argv[], char * + case WARN_LOW_INK_YELLOW: + case WARN_LOW_INK_MULTIPLE_PENS: + { +- fputs("STATE: +marker-supply-low-warning\n", stderr); ++ low_marker = 1; + break; + } + default: +- fputs("STATE: +marker-supply-low-warning\n", stderr); ++ low_marker = 1; + } + } + ++ fprintf(stderr, "STATE: %cmarker-supply-low-warning\n", ++ low_marker ? "+" : "-"); ++ + #if 0 + BUG("device model=%s\n", pSS->pPC->PrinterModel()); + BUG("device class=%s\n", pSS->pPC->PrintertypeToString(pSS->pPC->SelectedDevice())); diff --git a/hplip.spec b/hplip.spec index cd87a80..d998fc9 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: 2%{?dist} +Release: 3%{?dist} License: GPLv2+ and MIT Group: System Environment/Daemons Conflicts: system-config-printer < 0.6.132 @@ -24,6 +24,7 @@ Patch7: hplip-udev-rules.patch Patch8: hplip-retry-open.patch Patch9: hplip-snmp-quirks.patch Patch10: hplip-discovery-method.patch +Patch11: hplip-hpijs-marker-supply.patch Patch12: hplip-clear-old-state-reasons.patch Patch13: hplip-env-python.patch Patch14: hplip-hpcups-sigpipe.patch @@ -171,6 +172,9 @@ rm -rf $RPM_BUILD_DIR/%{name}-%{version} # Fixed hp-setup traceback when discovery page is skipped (bug #523685). %patch10 -p1 -b .discovery-method +# Fixed bogus low ink warnings from hpijs driver (bug #643643). +%patch11 -p1 -b .hpijs-marker-supply + # Clear old printer-state-reasons we used to manage (bug #510926). %patch12 -p1 -b .clear-old-state-reasons @@ -460,6 +464,9 @@ fi %postun libs -p /sbin/ldconfig %changelog +* Mon Oct 18 2010 Tim Waugh - 3.10.9-3 +- Fixed bogus low ink warnings from hpijs driver (bug #643643). + * Thu Oct 14 2010 Jiri Popelka - 3.10.9-2 - Fixed utils.addgroup() to return array instead of string (bug #642771). From 39b6ecf5b378531520fddbc2978b1a5d59956471 Mon Sep 17 00:00:00 2001 From: Tim Waugh Date: Mon, 18 Oct 2010 17:31:24 +0100 Subject: [PATCH 2/2] Fixed traceback on error condition in device.py (bug #628125). --- hplip-raw_deviceID-traceback.patch | 24 ++++++++++++++++++++++++ hplip.spec | 5 +++++ 2 files changed, 29 insertions(+) create mode 100644 hplip-raw_deviceID-traceback.patch diff --git a/hplip-raw_deviceID-traceback.patch b/hplip-raw_deviceID-traceback.patch new file mode 100644 index 0000000..062c331 --- /dev/null +++ b/hplip-raw_deviceID-traceback.patch @@ -0,0 +1,24 @@ +diff -up hplip-3.10.9/base/device.py.raw_deviceID-traceback hplip-3.10.9/base/device.py +--- hplip-3.10.9/base/device.py.raw_deviceID-traceback 2010-10-18 17:22:55.138868192 +0100 ++++ hplip-3.10.9/base/device.py 2010-10-18 17:24:02.965869220 +0100 +@@ -1368,6 +1368,8 @@ class Device(object): + + def getDeviceID(self): + needs_close = False ++ self.raw_deviceID = '' ++ self.deviceID = {} + if self.io_state != IO_STATE_HP_OPEN: + try: + self.open() +@@ -1377,10 +1379,7 @@ class Device(object): + + result_code, data = hpmudext.get_device_id(self.device_id) + +- if result_code != hpmudext.HPMUD_R_OK: +- self.raw_deviceID = '' +- self.deviceID = {} +- else: ++ if result_code == hpmudext.HPMUD_R_OK: + self.raw_deviceID = data + self.deviceID = parseDeviceID(data) + diff --git a/hplip.spec b/hplip.spec index d998fc9..d3c46c8 100644 --- a/hplip.spec +++ b/hplip.spec @@ -38,6 +38,7 @@ Patch21: hplip-openPPD.patch Patch22: hplip-ppd-ImageableArea.patch Patch23: hplip-network-timeout.patch Patch24: hplip-addgroup.patch +Patch25: hplip-raw_deviceID-traceback.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) @@ -238,6 +239,9 @@ done # utils.addgroup() was returning string instead of array (bug #642771). %patch24 -p1 -b .addgroup +# Fixed traceback on error condition in device.py (bug #628125). +%patch25 -p1 -b .raw_deviceID-traceback + sed -i.duplex-constraints \ -e 's,\(UIConstraints.* \*Duplex\),//\1,' \ prnt/drv/hpcups.drv.in @@ -465,6 +469,7 @@ fi %changelog * Mon Oct 18 2010 Tim Waugh - 3.10.9-3 +- Fixed traceback on error condition in device.py (bug #628125). - Fixed bogus low ink warnings from hpijs driver (bug #643643). * Thu Oct 14 2010 Jiri Popelka - 3.10.9-2