summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFred Drake <fdrake@acm.org>1998-05-14 20:03:14 +0000
committerFred Drake <fdrake@acm.org>1998-05-14 20:03:14 +0000
commitf4fc476885dbc1b10d8d62736077397eff849024 (patch)
tree680944bdbc13056709b5996a2a29da5d701e0100
parent5c07d9b028898792b19b3845786d6565d11c4aba (diff)
downloadcpython-git-f4fc476885dbc1b10d8d62736077397eff849024.tar.gz
Don't run tools/toc2bkm.py unless we're building PDF.
Change the way TEXINPUTS gets defined to ensure that the directory containing the main document file comes before any other dir, to allow documents to have files that "override" like-named files elsewhere on the search path. Guido discovered we needed this.
-rwxr-xr-xDoc/tools/mkhowto.sh17
1 files changed, 11 insertions, 6 deletions
diff --git a/Doc/tools/mkhowto.sh b/Doc/tools/mkhowto.sh
index 6108330385..bf3a1a714f 100755
--- a/Doc/tools/mkhowto.sh
+++ b/Doc/tools/mkhowto.sh
@@ -15,11 +15,6 @@ DISCARD_TEMPS=true
L2H_INIT_FILE=$TOPDIR/perl/l2hinit.perl
-# This is needed to support kpathsea based TeX installations. Others are
-# not supported. ;-)
-TEXINPUTS=$TOPDIR/texinputs:$TEXINPUTS
-export TEXINPUTS
-
LOGFILE=/usr/tmp/mkhowto-$LOGNAME-$$.how
LOGGING=''
@@ -107,7 +102,7 @@ use_latex() {
$MYDIR/fix_hack $MYFILE.idx || exit $?
makeindex -s $TOPDIR/texinputs/myindex.ist $MYFILE.idx || exit $?
fi
- if [ -f $MYFILE.toc ] ; then
+ if [ -f $MYFILE.toc -a $MYLATEX = pdflatex ] ; then
$MYDIR/toc2bkm.py -c section $MYFILE
fi
$MYLATEX $MYFILE || exit $?
@@ -222,8 +217,18 @@ if [ "$QUIET" ] ; then
exec >/dev/null
fi
+COMMONTEXINPUTS=$TOPDIR/texinputs:$TEXINPUTS
+
for FILE in $@ ; do
FILE=`basename ${FILE%.tex}`
+ #
+ # Put the directory the .tex file is in is also the first directory in
+ # TEXINPUTS, to allow files there to override files in the common area.
+ #
+ FILEDIR=`dirname $FILE`
+ TEXINPUTS=$FILEDIR:$COMMONTEXINPUTS
+ export TEXINPUTS
+ #
if [ "$BUILD_DVI" -o "$BUILD_PS" ] ; then
build_dvi $FILE 2>&1 | tee -a $LOGFILE
fi