This is Debian bug #478570
http://bugs.debian.org/478570
From the bug report:
I am calling ufraw-batch from a python script, and I'd like to
test the return value of the program to determine if an error
occurred. But it seems that ufraw-batch always returns 0, even
if an error occurred. This makes it impossible for my script to
test for the occurrence of an error in ufraw-batch.
Expected behavior: ufraw-batch should return a non-zero value
when an error occurs.
Here's some examples. (In bash, the command echo $? shows the
return value of the most recent command.)
This one is a normal, successful run, and ufraw-batch
returns 0 as it should.
jdietrch@io:~$ ufraw-batch CRW_6903.CRW
ufraw-batch: loaded CRW_6903.CRW
ufraw-batch: saved /home/jdietrch/CRW_6903.ppm
jdietrch@io:~$ echo $?
0
These next two show ufraw-batch reporting errors, but the return
value is still 0.
jdietrch@io:~$ ufraw-batch testbatch.png
ufraw-batch: testbatch.png: unsupported file format.
jdietrch@io:~$ echo $?
0
jdietrch@io:~$ ufraw-batch CRW_6903.CRW --output=/tmp/CRW_6903.ppm
ufraw-batch: loaded CRW_6903.CRW
Error creating file '/tmp/CRW_6903.ppm'.
No space left on device
jdietrch@io:~$ echo $?
0
Let me know if I can provide any further information.
Logged In: YES
user_id=1142938
Originator: NO
ufraw-batch can receive a list of files to convert. Therefore it is not clear what is right behavior if some files fail to convert and other succeed.
At the moment I modified CVS to exit(1) if any of the files fails to convert.
Udi
Logged In: YES
user_id=874672
Originator: YES
If ufraw-batch doesn't use the exit code for anything else, maybe it could set the exit code to the number of files that it failed to process? I don't know, just an idea.