From ff3ca018e71b2dca3da02fd34087583e448de94c Mon Sep 17 00:00:00 2001 From: Pierre Pronchery Date: Fri, 9 May 2014 02:56:43 +0200 Subject: [PATCH] Newer version of the script upstream --- doc/docbook.sh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/doc/docbook.sh b/doc/docbook.sh index e94749c..73a435a 100755 --- a/doc/docbook.sh +++ b/doc/docbook.sh @@ -33,6 +33,7 @@ FOP="fop" INSTALL="install -m 0644" MKDIR="mkdir -m 0755 -p" RM="rm -f" +XMLLINT="xmllint" XSLTPROC="xsltproc --nonet --xinclude" @@ -149,7 +150,14 @@ while [ $# -gt 0 ]; do ext="${target##*.}" ext="${ext##.}" case "$ext" in - html|pdf) + html) + source="${target%.*}.xml" + xpath="string(/refentry/refmeta/manvolnum)" + section=$($XMLLINT --xpath "$xpath" "$source") + [ $? -eq 0 -a -n "$section" ] || exit 2 + instdir="$DATADIR/man/html$section" + ;; + pdf) instdir="$DATADIR/doc/$ext/$PACKAGE" ;; 1|2|3|4|5|6|7|8|9)