Log changes
[latex2e.git] / latex2e-20151001 / scripts / maketlg
blobfecd7289bb66daa7036bb095b685ae9bb5952219
1 #! /bin/sh
3 # This file is part of the validate package.
4 # ------------------------------------------
6 # Makes a .tlg file from a test file with the extension .lvt
7 # Run's tex two times to get aux files etc.
9 # usage: maketlg <format name> <test file base> [translation table]
12 # check number of args and set format etc.
14 if [ $# -lt 2 -o $# -gt 3 ] ; then
15 echo >&2 Usage: maketlg format file [translation_table]
16 exit 1
19 TRANSLATE=""
20 if [ $# = 3 ]
21 then
22 TRANSLATE="--translate-file=$3"
24 LATEX="etex $TRANSLATE -efmt=`dirname $1`/`basename $1 .fmt`"
25 BASE=`basename $2 .lvt`
26 BASEDIR=`dirname $2`
28 LANG=C ; export LANG
30 TLG_BASE=$BASE
32 # remove all kind of rubbish
34 rm -f $BASE.log $BASE.au? $BASE.tmp.tlg $BASE.tlg.diff $BASE.dvi
35 rm -f $BASE.lvt.log $BASE.lvt.au? $BASE.lvt.dvi
36 rm -f $BASE.glo $BASE.idx $BASE.lof $BASE.toc $BASE.lot
37 rm -f $BASE.lvt.glo $BASE.lvt.idx $BASE.lvt.lof $BASE.lvt.toc $BASE.lvt.lot
39 # run TeX twice with chosen format
41 yes "" | $LATEX $BASE.lvt
42 yes "" | $LATEX $BASE.lvt
44 if test -r $BASE.lvt.log ; then LOG=$BASE.lvt.log ; else LOG=$BASE.log ; fi
46 # remove stuff from the log which is of no interest and save the result
47 # in tmp file
49 #test "$LTOPDIR" && EXTRA=-e\ s#$LTOPDIR/latex2/#../../#
50 #sed -e "1,/START-TEST-LOG/d" \
51 # -e "/END-TEST-LOG/,//d" \
52 # -e "/OMIT/,/TIMO/d" \
53 # -e "s/$BASE//" \
54 # -e "/([^ ]*fd/,/^[ ]*)/d" \
55 # -e "\![^<][0-9][0-9][0-9][0-9]/[0-9][0-9]/[0-9][0-9]!d" \
56 # $EXTRA \
57 # $BASE.log > ${TLG_PREFIX}$BASE.tlg
58 rm -f ${TLG_PREFIX}$BASE.new.tlg
59 perl `dirname $0`/log2tlg $BASE < $LOG > ${TLG_PREFIX}$BASE.new.tlg
61 echo TLG file produced for $BASE in `pwd`/$BASE.new.tlg