"Anthony J. Bentley" <anth...@cathet.us> writes:

> Ted Unangst writes:
>> Once upon a time, I used to scan things like this:
>> scanimage > scan.pnm
>> 
>> (I'd usually just pipe it into other commands, but something like
>> that.  Just like it says in the man page.)
>> 
>> Now the trouble is, the rest of my pipeline is failing because instead
>> of printing a pnm file, scanimage is printing "Failed cupsGetDevices"
>> followed by the scan output.  pnm files are not supposed to start with
>> the magic phrase "Failed cupsGetDevices", and so the pnm utilities are
>> now refusing to operate on my scans.

It's sad that you didn't speak up earlier.  The ports tree is locked.

>> Why is this happening?  How do I make it stop?
>
> I don't know the cause of the warning or how to fix it, but the fact that
> it goes to stdout is an upstream bug; see:
> https://alioth.debian.org/tracker/index.php?func=detail&aid=313851&group_id=30186&atid=410366
>
> Supposedly it has been fixed, but apparently the entire file has since been
> rewritten (unless I'm misreading the source) so it's not a simple patch to our
> current port.
>
> Workaround in the meantime: pipe through grep -v. Anyone with a better fix,
> or a way to make the warning simply not appear?

grep -v or sed 1d

or one of those:
- comment the "net autodiscovery" line in your kodakaio.conf
- completely unhook the kodakaio backend (dll.conf)
- enable cupsd

For when the ports tree is unlocked, or for those who want a local patch
for 5.3-stable, the quick'n'dirty...:

Index: Makefile
===================================================================
RCS file: /cvs/ports/graphics/sane-backends/Makefile,v
retrieving revision 1.54
diff -u -p -r1.54 Makefile
--- Makefile    5 Jan 2013 12:53:09 -0000       1.54
+++ Makefile    25 Feb 2013 22:41:29 -0000
@@ -3,7 +3,7 @@
 COMMENT=       API for accessing scanners, backends
 
 DISTNAME=      sane-backends-1.0.23
-REVISION=      0
+REVISION=      1
 
 SHARED_LIBS=   sane 2.0 # .1.0
 CATEGORIES=    graphics
Index: patches/patch-backend_kodakaio_c
===================================================================
RCS file: patches/patch-backend_kodakaio_c
diff -N patches/patch-backend_kodakaio_c
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-backend_kodakaio_c    25 Feb 2013 23:04:28 -0000
@@ -0,0 +1,13 @@
+$OpenBSD$
+Don't print error messages on stdout (corrupts output).
+--- backend/kodakaio.c.orig    Mon Feb 25 23:40:02 2013
++++ backend/kodakaio.c Mon Feb 25 23:40:57 2013
+@@ -2197,7 +2197,7 @@ First version only does autodiscovery */
+ 
+       reply = cupsGetDevices(CUPS_HTTP_DEFAULT, CUPS_TIMEOUT_DEFAULT, 
+               "dnssd", CUPS_EXCLUDE_NONE, ProcessDevice, Dummy);
+-      if(reply != IPP_OK) printf("Failed cupsGetDevices\n");
++      if(reply != IPP_OK) fprintf(stderr, "Failed cupsGetDevices\n");
+ 
+       return 0;
+ }

Reply via email to