On Sat, 23 Oct 2010 05:06:10 +0000, Clint Adams <sch...@debian.org> wrote: > I think that that is a false analogy. I would liken it more to setting > your bicycle to fall apart if ever it is ridden at a speed of exactly > 5 miles per hour.
I think that's an even falser analogy. Because we're using bash, we're calling out to a lot of secondary processes. You really think the program should just blithely continue running if one of those subprocesses fails? I certainly don't. I think that's probably a really bad idea, actually, especially when it means potentially locking someone out of a machine, or opening it up to attack. To follow your analogy, that's more like saying that you should just keep riding your bike even after your tire has just blown out. The assumption when using "set -e" is that if a call fails, it means there's a problem. If we *expect* a call to return non-zero, or to occasionally return non-zero, then we should be capturing it's return code and acting accordingly. If we're not, then that's a bug. Your proposal to not use "set -e" would make everything much harder. Not using "set -e" means we either just ignore all return codes, which I already said I think is a bad idea, or we have to capture the return code of *every* call, and check to make sure that it's returned what we expect (which is usually just 0). That's a much more onerous task, and one much more prone to failure. As it is now, we just have to capture the return of the calls that we *expect* to occasionally return non-zero. > Yes, monkeysphere update-authorized_keys failed because "set -e" considers > ((nline=0)) to be an error. Thus I am running a monkeysphere with the > "set -e" removed. So the bug here is really that the use of "((nline=0))" is problematic, not with the overall use of "set -e". If "((nline=0))" is expected to return non-zero, then we should be properly capturing it's return code, or using a different function call. I think the nline issue has actually been dealt with upstream.
pgpCDZJ3QPHWb.pgp
Description: PGP signature