init.sh: penalize a set-x-impaired shell; don't disqualify it
authorJim Meyering <meyering@redhat.com>
Wed, 8 Sep 2010 20:24:22 +0000 (22:24 +0200)
committerJim Meyering <meyering@redhat.com>
Thu, 9 Sep 2010 08:44:28 +0000 (10:44 +0200)
commitf7a9af7f49d267d084e47fab6853c81ad65f09e9
treef68a549fedc7ee4aea8d25e035eda9163d1016c4
parentda59166b23ea84c65ce3827a9928bcf201ca09f3
init.sh: penalize a set-x-impaired shell; don't disqualify it

* tests/init.sh: Too many shells corrupt application stderr when
you set -x, so we can't afford to disqualify them, since at least
on Irix-6.5, that would disqualify all bourne shells.
Instead, use a more discerning approach.
When iterating through candidate shells, give each a score
of 10 for perfect, 9 if corrupts stderr upon set -x but passes
all other tests, and some other value if it is unacceptable.
Use the first shell that gets a score of 10.
If no shell scores 10, use the first that scored 9.
Finally, when VERBOSE=yes is requested and set -x might cause trouble, simply
issue a warning and refrain from enabling debug output.
ChangeLog
tests/init.sh