Bug 57371

Summary: PJL commands fail to prepend and append to ghostscript
Product: [Retired] Red Hat Linux Reporter: degraaf
Component: foomaticAssignee: Tim Waugh <twaugh>
Status: CLOSED UPSTREAM QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 7.3   
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2003-03-26 14:24:36 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---
Attachments:
Description Flags
lpdomatic doesn't append PJL; patch to fix. none

Description degraaf 2001-12-11 01:07:19 UTC
From Bugzilla Helper:
User-Agent: Mozilla/4.78 [en] (X11; U; Linux 2.4.9-13custom i686)

Description of problem:
Explanation attached.

Version-Release number of selected component (if applicable):


How reproducible:
Always

Steps to Reproduce:
1. Set  'pjl' => 1,
in /var/spool/lpd/minolta/ljet4-66528.foo
2. Set  my $debug=1;  
in /usr/sbin/lpdomatic and add extra debug prints
3. Print something and note missing prepend and append.
4. Fix logic tests and repeat.  Prepend and append work.
	

Additional info:

Comment 1 degraaf 2001-12-11 01:10:15 UTC
Created attachment 40327 [details]
lpdomatic doesn't append PJL; patch to fix.

Comment 2 Tim Waugh 2002-01-08 17:56:26 UTC
Thanks for the patch.  It looks correct, yes.


Comment 3 Tim Waugh 2002-02-08 08:59:09 UTC
Fixed in RHBA-2001:174.

Comment 4 Tim Waugh 2002-03-05 13:07:23 UTC
This incorrect change has been reverted.

Comment 5 Tim Waugh 2002-04-25 09:57:34 UTC
(foomatic-1.1-0.20020313.3)

Comment 6 degraaf 2002-06-15 23:15:47 UTC
Dammit, you've screwed up lpdomatic again in 7.3.
We're back to the same error that I bitched about in Dec 2001.

Comment 7 degraaf 2002-06-15 23:22:34 UTC
Well, I can't seem to find any way to attach my carefully crafted message.  :-)
So I'll just cut and paste it into this god-forsaken editor...


Dammit, you've screwed up lpdomatic again in 7.3.
We're back to the same error that I bitched about in Dec 2001.

I complained that lpdomatic was failing to send PJL commands to the
printer despite constructing them correctly.

On 8 Jan 2002 you said:
  +------- Additional comments from twaugh@redhat.com 2002-01-08 12:56:26 -----
  +Thanks for the patch.  It looks correct, yes.

On 8 Feb 2002 you said:
  +------- Additional comments from twaugh@redhat.com 2002-02-08 03:59:09 -------
  +Fixed in RHBA-2001:174.

On 5 Mar 2002 you said:
  +------- Additional comments from twaugh@redhat.com 2002-03-05 08:07:23 -------
  +This incorrect change has been reverted.


Well, it may be an "incorrect change", but the code is most certainly
incorrect as it was, and as it is now - "reverted".
I had assumed you'd found a better way to fix the problem.
You haven't.  I stand by my original complaint (and patch).

Sheesh!

This is a very subtle error, and requires careful testing to ensure
that it's really fixed.  Without the patch my printer fails to enter
"sleep mode" and wastes power.  Unacceptable!

Here's the diff to fix the problem with lpdomatic from
foomatic-1.1-0.20020313.3

# diff -c /usr/sbin/lpdomatic.7.3 /usr/sbin/lpdomatic
*** /usr/sbin/lpdomatic.7.3     Thu Apr  4 03:30:15 2002
--- /usr/sbin/lpdomatic Sat Jun 15 18:29:27 2002
***************
*** 799,811 ****
                print $fileh @pjlprepend;
            }
            while (<KID4_IN>) {
                print $fileh $_;
            }
!           if ( @pjlprepend > 1 ) {
                print $fileh @pjlappend;
            }

--- 799,811 ----

            # wrap the PJL around the job data, if there are any
            # options specified...
!           if ( @pjlprepend > 0 ) {
                print $fileh @pjlprepend;
            }
            while (<KID4_IN>) {
                print $fileh $_;
            }
!           if ( @pjlprepend > 0 ) {
                print $fileh @pjlappend;
            }






Comment 8 Tim Waugh 2002-06-17 12:42:02 UTC
Unfortunately although this change seems correct, it breaks for a great many 
printers.  This is because the foomatic printer database has lots of printers 
marked as PJL capable when in fact they aren't.  This issue (and your above 
proposed change) is known about upstream, but requires extensive fixes to the 
database first.  These changes are underway, but it is a slow process. :-(