From 4ee39f3ea0bdfc05d3aeb00d4baf77f8a5fe18ff Mon Sep 17 00:00:00 2001 From: Pierre Pronchery Date: Fri, 31 Oct 2014 18:13:40 +0100 Subject: [PATCH] Added support for source files in the OBJDIR directory --- doc/scripts/docbook.sh | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/doc/scripts/docbook.sh b/doc/scripts/docbook.sh index 95d40b9..fda4e2d 100755 --- a/doc/scripts/docbook.sh +++ b/doc/scripts/docbook.sh @@ -52,19 +52,25 @@ _docbook() { target="$1" - source="${target#$OBJDIR}" - source="${source%.*}.xml" + source="${target%.*}.xml" + [ -f "$source" ] || source="${source#$OBJDIR}" ext="${target##*.}" ext="${ext##.}" case "$ext" in html) XSL="http://docbook.sourceforge.net/release/xsl/current/xhtml/docbook.xsl" + [ -f "${source%.*}.xsl" ] && XSL="${source%.*}.xsl" [ -f "${target%.*}.xsl" ] && XSL="${target%.*}.xsl" - [ -f "${target%.*}.css.xml" ] && XSLTPROC="$XSLTPROC --param custom.css.source \"${target%.*}.css.xml\" --param generate.css.header 1" + if [ -f "${target%.*}.css.xml" ]; then + XSLTPROC="$XSLTPROC --param custom.css.source \"${target%.*}.css.xml\" --param generate.css.header 1" + elif [ -f "${source%.*}.css.xml" ]; then + XSLTPROC="$XSLTPROC --param custom.css.source \"${source%.*}.css.xml\" --param generate.css.header 1" + fi $DEBUG $XSLTPROC -o "$target" "$XSL" "$source" ;; pdf) XSL="http://docbook.sourceforge.net/release/xsl/current/fo/docbook.xsl" + [ -f "${source%.*}.xsl" ] && XSL="${source%.*}.xsl" [ -f "${target%.*}.xsl" ] && XSL="${target%.*}.xsl" $DEBUG $XSLTPROC -o "${target%.*}.fo" "$XSL" "$source" && $DEBUG $FOP -fo "${target%.*}.fo" -pdf "$target"