Can only return from a sourced script or a function

This commit is contained in:
Pierre Pronchery 2010-03-29 23:00:14 +00:00
parent 3f64ace04d
commit 96e7707acd

View File

@ -62,24 +62,24 @@ if [ $# -eq 4 -a "$1" = "-p" -a "$3" = "install" ]; then
#PREFIX="$2" XXX doesn't work atm #PREFIX="$2" XXX doesn't work atm
lang="${4%%.mo}" lang="${4%%.mo}"
$DEBUG $MKDIR "$LOCALEDIR/$lang/LC_MESSAGES" || return 2 $DEBUG $MKDIR "$LOCALEDIR/$lang/LC_MESSAGES" || exit 2
$DEBUG $INSTALL "$4" "$LOCALEDIR/$lang/LC_MESSAGES/$PACKAGE.mo" \ $DEBUG $INSTALL "$4" "$LOCALEDIR/$lang/LC_MESSAGES/$PACKAGE.mo" \
|| return 2 || exit 2
return 0 exit 0
fi fi
if [ $# -ne 1 ]; then if [ $# -ne 1 ]; then
_usage _usage
return $? exit $?
fi fi
case "$1" in case "$1" in
*.mo) *.mo)
_gettext_mo "$PACKAGE" "${1%%.mo}" || return 2 _gettext_mo "$PACKAGE" "${1%%.mo}" || exit 2
;; ;;
*.pot) *.pot)
_gettext_pot "${1%%.pot}" || return 2 _gettext_pot "${1%%.pot}" || exit 2
;; ;;
*) *)
return 2 exit 2
;; ;;
esac esac
return 0 exit 0