Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit f4fc476

Browse files
committed
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.
1 parent 5c07d9b commit f4fc476

1 file changed

Lines changed: 11 additions & 6 deletions

File tree

Doc/tools/mkhowto.sh

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,6 @@ DISCARD_TEMPS=true
1515

1616
L2H_INIT_FILE=$TOPDIR/perl/l2hinit.perl
1717

18-
# This is needed to support kpathsea based TeX installations. Others are
19-
# not supported. ;-)
20-
TEXINPUTS=$TOPDIR/texinputs:$TEXINPUTS
21-
export TEXINPUTS
22-
2318
LOGFILE=/usr/tmp/mkhowto-$LOGNAME-$$.how
2419
LOGGING=''
2520

@@ -107,7 +102,7 @@ use_latex() {
107102
$MYDIR/fix_hack $MYFILE.idx || exit $?
108103
makeindex -s $TOPDIR/texinputs/myindex.ist $MYFILE.idx || exit $?
109104
fi
110-
if [ -f $MYFILE.toc ] ; then
105+
if [ -f $MYFILE.toc -a $MYLATEX = pdflatex ] ; then
111106
$MYDIR/toc2bkm.py -c section $MYFILE
112107
fi
113108
$MYLATEX $MYFILE || exit $?
@@ -222,8 +217,18 @@ if [ "$QUIET" ] ; then
222217
exec >/dev/null
223218
fi
224219

220+
COMMONTEXINPUTS=$TOPDIR/texinputs:$TEXINPUTS
221+
225222
for FILE in $@ ; do
226223
FILE=`basename ${FILE%.tex}`
224+
#
225+
# Put the directory the .tex file is in is also the first directory in
226+
# TEXINPUTS, to allow files there to override files in the common area.
227+
#
228+
FILEDIR=`dirname $FILE`
229+
TEXINPUTS=$FILEDIR:$COMMONTEXINPUTS
230+
export TEXINPUTS
231+
#
227232
if [ "$BUILD_DVI" -o "$BUILD_PS" ] ; then
228233
build_dvi $FILE 2>&1 | tee -a $LOGFILE
229234
fi

0 commit comments

Comments
 (0)