Bug#352106: escputil: escp2-c42sx CUPS/cupsys-bsd: align-head doesn't work

2006-05-30 Thread Roger Leigh
tags 352106 + patch
thanks

Alex Henry Ribeiro dos Santos [EMAIL PROTECTED] writes:

 Package: escputil
 Version: 4.3.99+cvs20060121.dfsg.1-1
 Severity: normal

 I have an Epson Stylus C42SX and I'm using CUPS and cupsys-bsd.
 I get the following output when trying to align heads using the -P option 
 (All output was manually translated from 
 brazilian portuguese to english by myself):

   # escputil -a -P C42SX -m escp2-c42sx
   Wasn't able to open (null) read/write: Invalid Adress

The following patch is intended to fix this with a more informative
error.  I'm just waiting for upstream approval.


Regards,
Roger


Index: escputil.c
===
RCS file: /cvsroot/gimp-print/print/src/escputil/escputil.c,v
retrieving revision 1.86
diff -u -r1.86 escputil.c
--- escputil.c  28 May 2006 16:59:03 -  1.86
+++ escputil.c  30 May 2006 16:59:26 -
@@ -424,7 +424,7 @@
   exit(0);
 }
 
-void
+static void
 print_debug_data(const char *buf, size_t count)
 {
   int i;
@@ -737,6 +737,28 @@
   alarm_interrupt = 1;
 }
 
+static int
+open_raw_device(void)
+{
+  int fd;
+
+  if (!raw_device)
+   {
+  fprintf(stderr, _(Please specify a raw device\n));
+  exit(1);
+}
+
+  fd = open(raw_device, O_RDWR, 0666);
+  if (fd == -1)
+{
+  fprintf(stderr, _(Cannot open %s read/write: %s\n), raw_device,
+  strerror(errno));
+  exit(1);
+}
+
+  return fd;
+}
+
 static const stp_printer_t *
 initialize_printer(int quiet, int fail_if_not_found)
 {
@@ -757,13 +779,7 @@
 
   quiet = 0;
 
-  fd = open(raw_device, O_RDWR, 0666);
-  if (fd == -1)
-{
-  fprintf(stderr, _(Cannot open %s read/write: %s\n), raw_device,
-  strerror(errno));
-  exit(1);
-}
+  fd = open_raw_device();
 
   if (!printer_model)
 {
@@ -1349,13 +1365,7 @@
  printer_model,
  printer ?  : (Unknown model)));
 
-  fd = open(raw_device, O_RDWR, 0666);
-  if (fd == -1)
-{
-  fprintf(stderr, _(Cannot open %s read/write: %s\n), raw_device,
-  strerror(errno));
-  exit(1);
-}
+  fd = open_raw_device();
 
   if (isnew)
 {
@@ -1463,13 +1473,7 @@
Warning! Printer %s is not known; information may be incomplete or 
incorrect\n,
printer_model);
 
-  fd = open(raw_device, O_RDWR, 0666);
-  if (fd == -1)
-{
-  fprintf(stderr, _(Cannot open %s read/write: %s\n), raw_device,
-  strerror(errno));
-  exit(1);
-}
+  fd = open_raw_device();
 
   if (isnew)
 {


-- 
Roger Leigh
Printing on GNU/Linux?  http://gutenprint.sourceforge.net/
Debian GNU/Linuxhttp://www.debian.org/
GPG Public Key: 0x25BFB848.  Please sign and encrypt your mail.


pgp6ApuqmdGCj.pgp
Description: PGP signature


Bug#352106: escputil: escp2-c42sx CUPS/cupsys-bsd: align-head doesn't work

2006-02-10 Thread Alex Santos






  
I have an Epson Stylus C42SX and I'm using CUPS and cupsys-bsd.
I get the following output when trying to align heads using the -P option (All output was manually translated from 
brazilian portuguese to english by myself):

	# escputil -a -P C42SX -m escp2-c42sx
	Wasn't able to open (null) read/write: Invalid Adress

  
  
The (null) bit is a bug.  However, you do need to use "-r" here,
because the alignment process requires full read-write access to the
device, and so can't go via a print queue ("-P").
  

 It would be a nice addition if the program warned you about the
need for "-r" after using "-a" with "-P". Or, at last, a mention in
the "--help" output:
-a|--align-head Align the print head. This command needs
to be evoked together with the "-r" option. CAUTION: Misuse of this
utility may result in poor print quality and/or damage to the printer.

 Or even both, which would be better.

  
  
  
This is the same output I get when I run escputil through the right-click menu in the printing module of KControl.

When I use the -r option, I do not receive any error message, but when I get to the prompt

	1st Passage)

nothing has been printed, and repeating the operation ('r') produces no effect. Again no error appears, neither in 
the default nor in the error output.

  
  
Do you know what options escputil was run with from this menu?  The ps
command should be able to show you.
  


  
I don't this one was expected to work, but I think I should add it anyway:

	# escputil -a -r parallel:/dev/lp0 -m escp2-c42sx
	Wasn't able to open parallel:/dev/lp0 read/write: Invalid Adress

  
  
Try "-r /dev/lp0", i.e.

escputil -a -r /dev/lp0 -m escp2-c42sx

Does this work?
  

 Just a note, for clarification: the output I get from KControl is "Wasn't
able to open (null) read/write: Invalid Adress" as above, not the "1st
Passage)" passage one here. The second one I get when I run
escputil -a -r /dev/lp0 -m escp2-c42sx

 as you've asked me now to. This is the command that took me to the "1st
Passage)" prompt up there (and did nothing).

 Forgive me about this confusion - my mistake of not being more
clear. Does it make sense now?

 Anyway, I've tried using ps lhen using KControl, but found nothing.
I think we can assume it issues the command 
escputil -a -P C42SX -m escp2-c42sx

 because it gets us to the same bug as above - (null). If
you were willing to send me more information about
how to use ps to find this out, I can try again.




Bug#352106: escputil: escp2-c42sx CUPS/cupsys-bsd: align-head doesn't work

2006-02-09 Thread Alex Henry Ribeiro dos Santos
Package: escputil
Version: 4.3.99+cvs20060121.dfsg.1-1
Severity: normal

I have an Epson Stylus C42SX and I'm using CUPS and cupsys-bsd.
I get the following output when trying to align heads using the -P option (All 
output was manually translated from 
brazilian portuguese to english by myself):

# escputil -a -P C42SX -m escp2-c42sx
Wasn't able to open (null) read/write: Invalid Adress

This is the same output I get when I run escputil through the right-click menu 
in the printing module of KControl.

When I use the -r option, I do not receive any error message, but when I get to 
the prompt

1st Passage)

nothing has been printed, and repeating the operation ('r') produces no effect. 
Again no error appears, neither in 
the default nor in the error output.

I don't this one was expected to work, but I think I should add it anyway:

# escputil -a -r parallel:/dev/lp0 -m escp2-c42sx
Wasn't able to open parallel:/dev/lp0 read/write: Invalid Adress

-- System Information:
Debian Release: testing/unstable
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.12-1-386
Locale: LANG=pt_BR, LC_CTYPE=pt_BR (charmap=ISO-8859-1)

Versions of packages escputil depends on:
ii  libc62.3.5-8 GNU C Library: Shared libraries an
ii  libgutenprin 4.3.99+cvs20060121.dfsg.1-1 runtime for the Gutenprint printer
ii  libncurses5  5.5-1   Shared libraries for terminal hand
ii  libreadline5 5.1-5   GNU readline and history libraries

escputil recommends no packages.

-- no debconf information


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Bug#352106: escputil: escp2-c42sx CUPS/cupsys-bsd: align-head doesn't work

2006-02-09 Thread Roger Leigh
Alex Henry Ribeiro dos Santos [EMAIL PROTECTED] writes:

 I have an Epson Stylus C42SX and I'm using CUPS and cupsys-bsd.
 I get the following output when trying to align heads using the -P option 
 (All output was manually translated from 
 brazilian portuguese to english by myself):

   # escputil -a -P C42SX -m escp2-c42sx
   Wasn't able to open (null) read/write: Invalid Adress

The (null) bit is a bug.  However, you do need to use -r here,
because the alignment process requires full read-write access to the
device, and so can't go via a print queue (-P).

 This is the same output I get when I run escputil through the right-click 
 menu in the printing module of KControl.

 When I use the -r option, I do not receive any error message, but when I get 
 to the prompt

   1st Passage)

 nothing has been printed, and repeating the operation ('r') produces no 
 effect. Again no error appears, neither in 
 the default nor in the error output.

Do you know what options escputil was run with from this menu?  The ps
command should be able to show you.

 I don't this one was expected to work, but I think I should add it anyway:

   # escputil -a -r parallel:/dev/lp0 -m escp2-c42sx
   Wasn't able to open parallel:/dev/lp0 read/write: Invalid Adress

Try -r /dev/lp0, i.e.

escputil -a -r /dev/lp0 -m escp2-c42sx

Does this work?


Regards,
Roger

-- 
Roger Leigh
Printing on GNU/Linux?  http://gutenprint.sourceforge.net/
Debian GNU/Linuxhttp://www.debian.org/
GPG Public Key: 0x25BFB848.  Please sign and encrypt your mail.


pgpwsGaOovSyV.pgp
Description: PGP signature