smbd: Fix an uninitialized read
[Samba.git] / lib / ldb / docs / builddocs.sh
blob449dcb26815aff58cc11553ec526c762b2d53806
1 #!/bin/sh
2 # build ldb docs
3 # tridge@samba.org August 2006
5 XSLTPROC="$1"
6 SRCDIR="$2"
8 if [ -z "$XSLTPROC" ] || [ ! -x "$XSLTPROC" ]; then
9 echo "xsltproc not installed"
10 exit 0
13 MANXSL="http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl"
14 HTMLXSL="http://docbook.sourceforge.net/release/xsl/current/html/docbook.xsl"
16 mkdir -p man
18 for f in $SRCDIR/man/*.xml; do
19 base=`basename $f .xml`
20 out=man/"`basename $base`"
21 if [ ! -f "$out" ] || [ "$f" -nt "$out" ]; then
22 echo Processing manpage $f
23 $XSLTPROC --nonet -o "$out" "$MANXSL" $f
24 ret=$?
25 if [ "$ret" = "4" ]; then
26 echo "ignoring stylesheet error 4 for $MANXSL"
27 exit 0
29 if [ "$ret" != "0" ]; then
30 echo "xsltproc failed with error $ret"
31 exit $ret
34 done
36 for f in $SRCDIR/man/*.xml; do
37 base=`basename $f .xml`
38 out=man/"`basename $base`".html
39 if [ ! -f "$out" ] || [ "$f" -nt "$out" ]; then
40 echo Processing html $f
41 $XSLTPROC --nonet -o "$out" "$HTMLXSL" $f
42 ret=$?
43 if [ "$ret" = "4" ]; then
44 echo "ignoring stylesheet error 4 for $HTMLXSL"
45 exit 0
47 if [ "$ret" != "0" ]; then
48 echo "xsltproc failed with error $ret"
49 exit $ret
52 done