Fabien Thomas reports that a Bourne (not Again) sh on FreeBSD just
ignores the return and continues executing with the rest of the script.
So just wrap everything that was skipped by the return using other
shells in a big if instead.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Closes: http://bugs.debian.org/516188
## Dispatch
# We were sourced from another script for our utility functions;
## Dispatch
# We were sourced from another script for our utility functions;
-# this is set by hooks.
-[ -z "$tg__include" ] || return 0
+# this is set by hooks. Skip the rest of the file. A simple return doesn't
+# work as expected in every shell. See http://bugs.debian.org/516188
+if [ -z "$tg__include" ]; then
if [ "$1" = "-r" ]; then
shift
if [ "$1" = "-r" ]; then
shift
. "@cmddir@"/tg-$cmd;;
esac
. "@cmddir@"/tg-$cmd;;
esac