Move setting of ioready 'wait' earlier in call chain, to
[python/dscho.git] / Doc / tools / mkinfo
blobd9527301ae2af039dde2ba0e62dd3f5109573d1a
1 #! /bin/sh
2 # -*- Ksh -*-
4 # Script to drive the HTML-info conversion process.
5 # Pass in upto three parameters:
6 # - the name of the main tex file
7 # - the name of the output file in texi format (optional)
8 # - the name of the output file in info format (optional)
10 # Written by Fred L. Drake, Jr. <fdrake@acm.org>
12 EMACS=${EMACS:-emacs}
13 MAKEINFO=${MAKEINFO:-makeinfo}
16 # Normalize file name since something called by html2texi.pl seems to
17 # screw up with relative path names.
18 FILENAME="$1"
19 DOCDIR=`dirname "$FILENAME"`
20 DOCFILE=`basename "$FILENAME"`
21 DOCNAME=`basename "$FILENAME" .tex`
22 if [ $# -gt 1 ]; then
23 TEXINAME="$2"
24 else
25 TEXINAME="python-$DOCNAME.texi"
27 if [ $# -gt 2 ]; then
28 INFONAME="$3"
29 else
30 INFONAME="python-$DOCNAME.info"
33 # Now build the real directory names, and locate our support stuff:
34 WORKDIR=`pwd`
35 cd `dirname $0`
36 TOOLSDIR=`pwd`
37 cd $DOCDIR
38 DOCDIR=`pwd`
39 cd $WORKDIR
42 run() {
43 # show what we're doing, like make does:
44 echo "$*"
45 "$@" || exit $?
49 # generate the Texinfo file:
51 run $EMACS -batch -q --no-site-file -l $TOOLSDIR/py2texi.el \
52 --eval "(setq py2texi-dirs '(\"./\" \"../texinputs/\" \"$DOCDIR\"))" \
53 --eval "(setq py2texi-texi-file-name \"$TEXINAME\")" \
54 --eval "(setq py2texi-info-file-name \"$INFONAME\")" \
55 --eval "(py2texi \"$DOCDIR/$DOCFILE\")" \
56 -f kill-emacs
57 echo Done
60 # generate the .info files:
62 run $MAKEINFO --footnote-style end --fill-column 72 \
63 --paragraph-indent 0 --output=$INFONAME $TEXINAME