It would be useful if munpack indicated success/failure as a return code: 0 - file(s) successfully decoded 1 - no files decoded This would make it compatable with uudecode. This would greatly help me in using munpack in scripts. I might at some stage have a look at the code and patch it myself, but for now I am just going to use uudecode.... for the record: fred $cat /etc/debian_version 2.2 fred $dpkg -l mpack Desired=Unknown/Install/Remove/Purge/Hold | Status=Not/Installed/Config-files/Unpacked/Failed-config/Half-installed |/ Err?=(none)/Hold/Reinst-required/X=both-problems (Status,Err: uppercase=bad) ||/ Name Version Description +++-==============-==============-============================================ ii mpack 1.5-5 Tools for encoding/decoding MIME messages. fred $uudecode test1 fred $echo $? 0 fred $uudecode test2 uudecode: test2: Short file fred $echo $? 1 fred $rm 3817_521.doc fred $munpack test1 3817_521.doc (application/octet-stream) fred $echo $? 0 fred $munpack test2 Did not find anything to unpack from test2 fred $echo $? 0
I think it would be a bad idea to make mpack's exit codes different on Debian than on other systems. The correct place to make this change is upstream, and mpack hasn't had an upstream for years. So this issue will have to remain unsolved until that changes. The compatibility problem I'm worried about is that not having anything to unpack is not a "failure" in the way that, for example, being unable to read the source file is. Changing the exit codes the way you describe would make those cases indistinguishable. It wouldn't surprise me if there are scripts that don't expect mpack to fail just because there wasn't anything to unpack. Such a script might for example run mpack on a whole newsgroup, one file at a time. Richard Braakman