From bd35b8c8c9e61cde970dd1d2bd7495811973f52a Mon Sep 17 00:00:00 2001 From: Ondrej Vasik Date: Apr 08 2014 18:36:27 +0000 Subject: xmlto.in: use correctly exit code from xsltproc git-svn-id: https://svn.fedorahosted.org/svn/xmlto@77 eb1b79c1-ba03-4820-82f3-b60cf523859b --- diff --git a/ChangeLog b/ChangeLog index 4148df7..7ed3f09 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,6 @@ +2014-04-08 Knut Schönfels + * xmlto.in: use correctly exit code from xsltproc + 2014-04-05 Ole Streicher * format/docbook/epub: fix mime type of epub file diff --git a/THANKS b/THANKS index 558d6b4..d551ec8 100644 --- a/THANKS +++ b/THANKS @@ -23,3 +23,4 @@ Matthias Andree Kacper Perschke Marko Lindqvist Ole Streicher +Knut Schönfels diff --git a/xmlto.in b/xmlto.in index 4489698..030ee75 100755 --- a/xmlto.in +++ b/xmlto.in @@ -584,10 +584,13 @@ else # eval is for SEARCHPATH_FORMATTED's proper expansion eval "\"${XSLTPROC_PATH}\" ${XSLTOPTS} ${SEARCHPATH_FORMATTED} -o \"${XSLT_PROCESSED}\" \"${STYLESHEET}\" \"${INPUT_FILE}\"" + # remember the xsltproc exit code for later checks + xsltproc_status=$? + #xsltproc may return no file on empty input, touch it to have it for sure touch "$XSLT_PROCESSED" - if [ $? == 4 ] + if [ $xsltproc_status == 4 ] then XSLTOPTS="${XSLTOPTS} --catalogs" if [ "$VERBOSE" -ge 1 ]; then @@ -595,9 +598,10 @@ else echo -e >&2 "${XSLTPROC_PATH} ${XSLTOPTS} ${SEARCHPATH_FORMATTED}\\\\\n -o \"${XSLT_PROCESSED}\" \\\\\n \"${STYLESHEET}\" \\\\\n \"${INPUT_FILE}\"" fi eval "\"${XSLTPROC_PATH}\"" ${XSLTOPTS} ${SEARCHPATH_FORMATTED} -o "\"${XSLT_PROCESSED}\"" "\"${STYLESHEET}\"" "\"${INPUT_FILE}\"" + xsltproc_status=$? fi - xsltproc_status=$? + # xsltproc returned an exit code - exit the script [ ${xsltproc_status} -gt 0 ] && exit ${xsltproc_status} fi