File: builddocs.sh

package info (click to toggle)
samba 2%3A3.5.6~dfsg-3squeeze13
  • links: PTS, VCS
  • area: main
  • in suites: squeeze-lts
  • size: 146,276 kB
  • ctags: 140,269
  • sloc: ansic: 1,269,622; xml: 115,137; perl: 26,869; python: 13,704; sh: 13,575; makefile: 4,936; asm: 3,281; cpp: 2,225; yacc: 1,930; exp: 1,784; ada: 1,681; pascal: 1,089; cs: 879; lex: 561; awk: 540; csh: 58; sed: 45; php: 6
file content (52 lines) | stat: -rwxr-xr-x 1,202 bytes parent folder | download | duplicates (23)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#!/bin/sh
# build ldb docs
# tridge@samba.org August 2006

XSLTPROC="$1"
SRCDIR="$2"

if [ -z "$XSLTPROC" ] || [ ! -x "$XSLTPROC" ]; then
    echo "xsltproc not installed"
    exit 0
fi

MANXSL="http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl"
HTMLXSL="http://docbook.sourceforge.net/release/xsl/current/html/docbook.xsl"

mkdir -p man

for f in $SRCDIR/man/*.xml; do
    base=`basename $f .xml`
    out=man/"`basename $base`"
    if [ ! -f "$out" ] || [ "$f" -nt "$out" ]; then
	echo Processing manpage $f
	$XSLTPROC --nonet -o "$out" "$MANXSL" $f
	ret=$?
	if [ "$ret" = "4" ]; then
	    echo "ignoring stylesheet error 4 for $MANXSL"
	    exit 0
	fi
	if [ "$ret" != "0" ]; then
	    echo "xsltproc failed with error $ret"
	    exit $ret
	fi
    fi
done

for f in $SRCDIR/man/*.xml; do
    base=`basename $f .xml`
    out=man/"`basename $base`".html
    if [ ! -f "$out" ] || [ "$f" -nt "$out" ]; then
	echo Processing html $f
	$XSLTPROC --nonet -o "$out" "$HTMLXSL" $f
	ret=$?
	if [ "$ret" = "4" ]; then
	    echo "ignoring stylesheet error 4 for $HTMLXSL"
	    exit 0
	fi
	if [ "$ret" != "0" ]; then
	    echo "xsltproc failed with error $ret"
	    exit $ret
	fi
    fi
done