On Tue, Nov 20, 2012 at 08:25:26PM +0000, Kevin Lyda wrote:
> set -e doesn't abort on any statement with a boolean test.
>
> So if you do this:
>
> set -e
> false && false
> echo hi
>
> you'll get "hi".
>
> This is true for loops, if and case structures and the boolean
> operators. Does this help?
>
> Kevin
Not directly - the real problem appears to be a logical error, and
it is "mine, all mine!".
Thanks for the suggestion, I understood the loops part, and am
still struggling with what does and doesn't work in 'if' tests.
In fact, it is my attempt to allow for an 'if' test to fail that has
caused the problem. My scripts are more complex than I indicated -
the 'driver' scripts have lines like:
build geoclue ${SCRIPTS}/desktop6.d/geoclue &&
That used to be simple : 'build' is a function to check if a
stamp exists for the first argument. If it does, it reports that
label has already been built, otherwise it evaluated the rest of the
line.
Somewhere in the last few days I've had problems with set -e
causing 'build()' to die silently. In the end I altered the testing
so that at the end of 'build()', after reporting the name with 'echo
-n' and doing some other things, it now ends:
test -f /$STAMPDIR/${1}-stamp && MSG=" already built" || true
# if already built, echo just provides the \n
echo "$MSG"
test -z "$MSG" && eval $PARMS || true
unset MSG
Clearly, I'll have to sack myself for idiocy. In mitigation, it
works fine in the "already built" case that I was trying to solve
at the time ;-)
Thanks again.
ĸen
--
das eine Mal als Tragödie, das andere Mal als Farce
--
http://linuxfromscratch.org/mailman/listinfo/lfs-chat
FAQ: http://www.linuxfromscratch.org/faq/
Unsubscribe: See the above information page