rpms/hplip/devel hplip-out-of-paper.patch, NONE, 1.1 hplip.spec, 1.98, 1.99

fedora-cvs-commits at redhat.com fedora-cvs-commits at redhat.com
Thu Nov 23 13:59:18 UTC 2006


Author: twaugh

Update of /cvs/dist/rpms/hplip/devel
In directory cvs.devel.redhat.com:/tmp/cvs-serv15489

Modified Files:
	hplip.spec 
Added Files:
	hplip-out-of-paper.patch 
Log Message:
* Thu Nov 23 2006 Tim Waugh <twaugh at redhat.com>
- Report out-of-paper and offline conditions in CUPS backend (bug #216477).
- Resolves: rhbz#216477


hplip-out-of-paper.patch:
 hp.c |   39 ++++++++++++++++++++++++++++++++++++++-
 1 files changed, 38 insertions(+), 1 deletion(-)

--- NEW FILE hplip-out-of-paper.patch ---
--- hplip-1.6.10/backend/hp/hp.c.out-of-paper	2006-11-23 11:10:27.000000000 +0000
+++ hplip-1.6.10/backend/hp/hp.c	2006-11-23 13:40:47.000000000 +0000
@@ -408,6 +408,7 @@
    int len, vstatus, cnt;
    char buf[BUFFER_SIZE+HEADER_SIZE];
    MsgAttributes ma;
+   int paperout = 0, offline = 0;
 
    if (argc > 1)
    {
@@ -532,17 +533,53 @@
 
             if (n != size)
             {
+	       const char *state;
+
                /* IO error, get printer status. */
                vstatus = GetVStatus(hd);
 
                /* Display user error. */
                DeviceEvent(argv[0], argv[1], vstatus, "error", RETRY_TIMEOUT);
 
-               bug("INFO: %s; will retry in %d seconds...\n", GetVStatusMessage(vstatus), RETRY_TIMEOUT);
+	       switch (vstatus)
+	       {
+	       case VSTATUS_OOPA:
+		  if (!paperout)
+		  {
+		     fputs("STATE: +media-tray-empty-error\n", stderr);
+		     paperout = 1;
+		  }
+		  break;
+	       default:
+		  if (!offline)
+		  {
+		     fputs("STATE: +offline-error\n", stderr);
+		     offline = 1;
+		  }
+		  break;
+	       }
+               bug("ERROR: %s; will retry in %d seconds...\n",
+		   GetVStatusMessage(vstatus), RETRY_TIMEOUT);
                sleep(RETRY_TIMEOUT);
                retry = 1;
 
             }
+	    else
+	    {
+	       if (paperout || offline)
+		  bug("INFO: Printing...\n");
+
+	       if (paperout)
+	       {
+		  paperout = 0;
+		  fputs("STATE: -media-tray-empty-error\n", stderr);
+	       }
+	       if (offline)
+	       {
+		  offline = 0;
+		  fputs("STATE: -offline-error\n", stderr);
+	       }
+	    }
             total+=n;
             size-=n;
          }


Index: hplip.spec
===================================================================
RCS file: /cvs/dist/rpms/hplip/devel/hplip.spec,v
retrieving revision 1.98
retrieving revision 1.99
diff -u -r1.98 -r1.99
--- hplip.spec	1 Nov 2006 16:22:52 -0000	1.98
+++ hplip.spec	23 Nov 2006 13:59:16 -0000	1.99
@@ -22,6 +22,7 @@
 Patch7: hplip-loop.patch
 Patch8: hplip-ipv6.patch
 Patch9: hplip-sane-debug.patch
+Patch10: hplip-out-of-paper.patch
 BuildRoot:	%{_tmppath}/%{name}-%{version}-buildroot
 
 Requires: desktop-file-utils >= 0.2.92
@@ -97,6 +98,9 @@
 # Allow debugging of the SANE backend.
 %patch9 -p1 -b .sane-debug
 
+# Report out-of-paper and offline conditions in CUPS backend (bug #216477).
+%patch10 -p1 -b .out-of-paper
+
 autoconf # for patch4
 
 %build
@@ -197,6 +201,9 @@
 exit 0
 
 %changelog
+* Thu Nov 23 2006 Tim Waugh <twaugh at redhat.com>
+- Report out-of-paper and offline conditions in CUPS backend (bug #216477).
+
 * Wed Nov  1 2006 Tim Waugh <twaugh at redhat.com> 1.6.10-5
 - Fixed debugging patch.
 




More information about the fedora-cvs-commits mailing list