File: update-docs

package info (click to toggle)
systemtap 5.3-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 47,556 kB
  • sloc: cpp: 81,117; ansic: 54,933; xml: 49,795; exp: 43,595; sh: 11,526; python: 5,003; perl: 2,252; tcl: 1,312; makefile: 1,006; javascript: 149; lisp: 105; awk: 101; asm: 91; java: 70; sed: 16
file content (64 lines) | stat: -rwxr-xr-x 2,300 bytes parent folder | download | duplicates (6)
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
53
54
55
56
57
58
59
60
61
62
63
64
#!/usr/bin/bash
# This script regenerates the prebuilt documentation
# checked into the source tree.

set -e

echo "Generating documentation"
SCRIPT=$(readlink -f $0)
BASE=$(dirname $SCRIPT)/..
TEMP=$(mktemp -d -p /tmp) && pushd $TEMP

SBG=SystemTap_Beginners_Guide
STR=SystemTap_Tapset_Reference
DOCS=$BASE/doc

# Beginners Guide documentation

echo "Generating beginner pdf"
xmlto --with-fop --skip-validation -o $DOCS/$SBG/en-US/ -x $DOCS/$SBG/en-US/xsl/pdf.xsl pdf $DOCS/$SBG/en-US/$SBG.xml

# Tapset Reference documentation

###
# The build process is as follows (targets):
#              (xmldocs) [by docproc]
# file.tmpl --> file.xml +--> file.ps   (psdocs)   [by xmlto]
#                        +--> file.pdf  (pdfdocs)  [by xmlto]
#                        +--> DIR=file  (htmldocs) [by xmlto]
#                        +--> man/      (mandocs)  [by xmlto]

# Update syscalls docs
$(dirname $SCRIPT)/update-syscall-docs

echo "Generating tapsets.xml"
gcc -o docproc $DOCS/$STR/docproc.c
sed -e '/^!Syscalls/{r $DOCS/$STR/syscalls.xmlpart' -e 'd}' $DOCS/$STR/tapsets.tmpl > tapsets.tmpl.new
SRCTREE=$BASE/ ./docproc doc tapsets.tmpl.new > tapsets.xml.new
python $DOCS/$STR/overload.py tapsets.xml.new > tapsets.xml.new1
if [ $? -ne 0 ]; then echo "FAILED: python lxml library required"; exit 1; fi
xsltproc $DOCS/$STR/sort-tapsets.xslt tapsets.xml.new1 > tapsets.xml.new2
rm tapsets.xml.new tapsets.xml.new1 tapsets.tmpl.new
if test -s tapsets.xml && cmp tapsets.xml.new2 tapsets.xml >/dev/null ; then
    echo tapsets.xml unchanged;
    rm tapsets.xml.new2;
else
    mv tapsets.xml.new2 tapsets.xml;
fi

# Publicanize
cp tapsets.xml $DOCS/$STR/
$DOCS/$STR/publicanize.sh

echo "Generating tapsets pdf"
env pool_size=6000000 hash_extra=6000000 xmlto --with-fop --stringparam refentry.generate.name=0 --stringparam refentry.generate.title=1 pdf -o $DOCS/$STR/ tapsets.xml

echo "Generating tapsets man pages"
xmlto --stringparam man.authors.section.enabled=0 --stringparam man.copyright.section.enabled=0 man -o man3 tapsets.xml
SRCTREE=$BASE $DOCS/$STR/manpager # generate tapset::* pages
cp $DOCS/$STR/syscalls.3stap man_pages/tapset\:\:syscalls.3stap # use cached syscall page
cp -R man3 $DOCS/$STR/
cp -R man_pages $DOCS/$STR/

popd && rm -rf $TEMP
echo "Finished generating documentation"