blob: 76bbda6555ea8582184ab73a0178027f798414dd [file] [log] [blame]
Fred Drake566b6d51998-10-27 21:59:03 +00001#! /usr/bin/env ksh
Fred Drakee2e904f1998-03-10 23:23:05 +00002
Fred Drakec794c381998-08-12 17:50:07 +00003# This script may be invoked by naming it directly or via a shell alias,
4# but NOT through a symbolic link. Perhaps a future version will allow
5# the use of a symbolic link.
6#
7# Using a symbolic link will cause the script to not be able to locate
8# its support files.
9
Fred Drakee2e904f1998-03-10 23:23:05 +000010MYDIR=`dirname $0`
Fred Drakef558e311998-03-24 17:48:20 +000011WORKDIR=`pwd`
12cd $MYDIR
13MYDIR=`pwd`
Fred Drakeac8f91a1998-04-02 15:37:13 +000014cd ..
15TOPDIR=`pwd`
Fred Drakef558e311998-03-24 17:48:20 +000016cd $WORKDIR
Fred Drakee2e904f1998-03-10 23:23:05 +000017
18# DEFAULT_FORMAT must be upper case...
19DEFAULT_FORMAT=PDF
20USE_DEFAULT_FORMAT=true
Fred Drakedbc879e1998-03-11 15:33:44 +000021DISCARD_TEMPS=true
Fred Drakee2e904f1998-03-10 23:23:05 +000022
Fred Drake5d59d3d1999-02-15 16:27:42 +000023CONFIG_FILES=''
Fred Drake11300cc1998-08-05 04:48:18 +000024ICONSERVER=''
25
Fred Drakee1feb8f1998-08-28 20:21:04 +000026TEMPBASE=mkhowto-$LOGNAME-$$
Fred Drakeac8f91a1998-04-02 15:37:13 +000027
Fred Drakee1feb8f1998-08-28 20:21:04 +000028L2H_INIT_FILE=$TOPDIR/perl/l2hinit.perl
29L2H_AUX_INIT_FILE=/usr/tmp/$TEMPBASE.perl
30
31LOGFILE=/usr/tmp/$TEMPBASE.how
Fred Drakedbc879e1998-03-11 15:33:44 +000032LOGGING=''
33
Fred Drakee2e904f1998-03-10 23:23:05 +000034usage() {
Fred Drakeac8f91a1998-04-02 15:37:13 +000035 MYNAME=`basename $0`
Fred Drakeac8f91a1998-04-02 15:37:13 +000036 cat <<EOF
Fred Drakea5de7301998-10-19 19:14:42 +000037usage: $MYNAME [options...] file ...
Fred Drakeac8f91a1998-04-02 15:37:13 +000038
39Options specifying formats to build:
40 --html HyperText Markup Language
41 --pdf Portable Document Format (default)
42 --ps PostScript
43 --dvi "DeVice Indepentent" format from TeX
Fred Drakea5de7301998-10-19 19:14:42 +000044 --text ASCII text (requires lynx)
Fred Drakeac8f91a1998-04-02 15:37:13 +000045
Fred Drake9f6f0da1998-08-12 18:07:51 +000046 More than one output format may be specified, or --all.
Fred Drakeac8f91a1998-04-02 15:37:13 +000047
48HTML options:
49 --address, -a Specify an address for page footers.
Fred Drake88053541998-04-24 21:57:12 +000050 --link Specify the number of levels to include on each page.
Fred Drake437ff861998-10-07 16:46:54 +000051 --split, -s Specify a section level for page splitting, default: $MAX_SPLIT_DEPTH.
Fred Drake11300cc1998-08-05 04:48:18 +000052 --iconserver, -i Specify location of icons (default: ../).
Fred Drakeac8f91a1998-04-02 15:37:13 +000053
54Other options:
Fred Drake1a3541c1998-05-11 19:04:56 +000055 --a4 Format for A4 paper.
Fred Draked5d473f1998-05-11 20:40:24 +000056 --letter Format for US letter paper (the default).
Fred Drakeac8f91a1998-04-02 15:37:13 +000057 --help, -H Show this text.
58 --logging, -l Log stdout and stderr to a file (*.how).
59 --debugging, -D Echo commands as they are executed.
60 --keep, -k Keep temporary files around.
61 --quiet, -q Do not print command output to stdout.
62 (stderr is also lost, sorry; see *.how for errors)
63
64EOF
Fred Drake9f6f0da1998-08-12 18:07:51 +000065 if [ "$2" ] ; then
66 echo "$2"
67 echo
68 fi
Fred Drakeac8f91a1998-04-02 15:37:13 +000069 exit $1
Fred Drakee2e904f1998-03-10 23:23:05 +000070}
71
Fred Drake88053541998-04-24 21:57:12 +000072# These are LaTeX2HTML controls; they reflect l2h variables of the same name.
73# The values here are the defaults after modification by perl/l2hinit.perl.
74#
75ADDRESS=''
76MAX_LINK_DEPTH=3
Fred Drake437ff861998-10-07 16:46:54 +000077MAX_SPLIT_DEPTH=6
Fred Drake88053541998-04-24 21:57:12 +000078
Fred Drakee2e904f1998-03-10 23:23:05 +000079build_html() {
Fred Drake19c7c841998-05-07 21:20:39 +000080 TEXFILE=`kpsewhich $1.tex`
Fred Drakeb5210951998-10-16 17:34:34 +000081 TEXFILE="${TEXFILE#./}"
Fred Drake9940bd71998-08-06 20:15:20 +000082 BUILDDIR=${2:-$1}
Fred Drake11300cc1998-08-05 04:48:18 +000083 latex2html \
84 -init_file $L2H_INIT_FILE \
85 -init_file $L2H_AUX_INIT_FILE \
Fred Drake9940bd71998-08-06 20:15:20 +000086 -dir $BUILDDIR $TEXFILE || exit $?
Fred Drakef6838c01999-02-16 20:43:53 +000087 cp $TOPDIR/html/style.css $BUILDDIR/$1.css
Fred Drake88053541998-04-24 21:57:12 +000088 if [ "$MAX_SPLIT_DEPTH" -ne 1 ] ; then
Fred Drake9940bd71998-08-06 20:15:20 +000089 (cd $BUILDDIR; $MYDIR/node2label.pl *.html) || exit $?
Fred Drakeac8f91a1998-04-02 15:37:13 +000090 fi
Fred Drakee2e904f1998-03-10 23:23:05 +000091}
92
Fred Drake12f842e1998-04-17 02:52:12 +000093use_latex() {
94 # two args: <file> <latextype>
95 MYFILE=$1
96 MYLATEX=$2
97 #
98 # We really have to do it three times to get all the page numbers right,
99 # since the length of the ToC makes a real difference.
100 #
101 $MYDIR/newind.py >$MYFILE.ind
102 $MYDIR/newind.py modindex >mod$MYFILE.ind
103 $MYLATEX $MYFILE || exit $?
104 if [ -f mod$MYFILE.idx ] ; then
105 makeindex mod$MYFILE.idx
Fred Drakee2e904f1998-03-10 23:23:05 +0000106 fi
Fred Drake12f842e1998-04-17 02:52:12 +0000107 if [ -f $MYFILE.idx ] ; then
108 $MYDIR/fix_hack $MYFILE.idx
109 makeindex $MYFILE.idx
110 $MYDIR/indfix.py $MYFILE.ind
111 fi
Fred Drake566b6d51998-10-27 21:59:03 +0000112 if [ `grep -c '^\\\\bibdata{' $MYFILE.aux` -ne 0 ] ; then
113 USE_BIBTEX=true
114 bibtex $MYFILE
115 else
116 USE_BIBTEX=''
117 fi
Fred Drake8cab5491998-07-23 19:13:52 +0000118 if [ -f $MYFILE.syn ] ; then
119 # This hack is due to a bug with the module synopsis support that
120 # causes the last module synopsis to be written out twice in
121 # howto documents (not present for manuals). Repeated below.
122 uniq $MYFILE.syn >TEMP.syn && mv TEMP.syn $MYFILE.syn || exit $?
123 fi
Fred Drake12f842e1998-04-17 02:52:12 +0000124 $MYLATEX $MYFILE || exit $?
125 if [ -f mod$MYFILE.idx ] ; then
126 makeindex mod$MYFILE.idx
127 fi
128 if [ -f $MYFILE.idx ] ; then
129 $MYDIR/fix_hack $MYFILE.idx || exit $?
Fred Drakefbdddde1998-10-19 21:48:05 +0000130 makeindex -s $TOPDIR/texinputs/python.ist $MYFILE.idx || exit $?
Fred Drake12f842e1998-04-17 02:52:12 +0000131 fi
Fred Drakef4fc4761998-05-14 20:03:14 +0000132 if [ -f $MYFILE.toc -a $MYLATEX = pdflatex ] ; then
Fred Drake12f842e1998-04-17 02:52:12 +0000133 $MYDIR/toc2bkm.py -c section $MYFILE
134 fi
Fred Drake8cab5491998-07-23 19:13:52 +0000135 if [ -f $MYFILE.syn ] ; then
136 uniq $MYFILE.syn >TEMP.syn && mv TEMP.syn $MYFILE.syn || exit $?
137 fi
Fred Drake566b6d51998-10-27 21:59:03 +0000138 if [ "$USE_BIBTEX" ] ; then
139 bibtex $MYFILE
140 fi
Fred Drake12f842e1998-04-17 02:52:12 +0000141 $MYLATEX $MYFILE || exit $?
Fred Drakee2e904f1998-03-10 23:23:05 +0000142}
143
Fred Drake12f842e1998-04-17 02:52:12 +0000144build_dvi() {
145 use_latex $1 latex
Fred Drakee2e904f1998-03-10 23:23:05 +0000146}
147
148build_pdf() {
Fred Drake12f842e1998-04-17 02:52:12 +0000149 use_latex $1 pdflatex
150}
151
152build_ps() {
Fred Drake79842561998-04-17 20:06:16 +0000153 dvips -N0 -o $1.ps $1 || exit $?
Fred Drake12f842e1998-04-17 02:52:12 +0000154}
155
Fred Drake9940bd71998-08-06 20:15:20 +0000156build_text() {
157 lynx -nolist -dump $2/index.html >$1.txt
158}
159
Fred Drake11300cc1998-08-05 04:48:18 +0000160l2hoption() {
161 if [ "$2" ] ; then
Fred Drakeca6d6351998-11-30 20:30:26 +0000162 VALUE=`echo "$2" | sed 's/[$"@]/\\\\&/g'`
163 echo "\$$1 = \"$VALUE\";" >>$L2H_AUX_INIT_FILE
Fred Drake11300cc1998-08-05 04:48:18 +0000164 fi
165}
166
Fred Drake12f842e1998-04-17 02:52:12 +0000167cleanup() {
Fred Drake75ab7a61999-03-02 16:22:26 +0000168 rm -f $1.aux $1.log $1.out $1.toc $1.bkm $1.idx $1.ilg $1.ind $1.syn $1.pla
Fred Drakec9b8a571998-04-29 21:28:25 +0000169 rm -f mod$1.idx mod$1.ilg mod$1.ind
Fred Drake12f842e1998-04-17 02:52:12 +0000170 if [ ! "$BUILD_DVI" ] ; then
Fred Drake19c7c841998-05-07 21:20:39 +0000171 rm -f $1.dvi
Fred Drakee2e904f1998-03-10 23:23:05 +0000172 fi
Fred Drake9940bd71998-08-06 20:15:20 +0000173 rm -rf $1.temp-html
Fred Drake8dbf46a1998-05-15 17:13:08 +0000174 rm -f $1/IMG* $1/*.pl $1/WARNINGS $1/index.dat $1/modindex.dat
Fred Drake566b6d51998-10-27 21:59:03 +0000175 # bibtex stuff
176 rm -f $1.bbl $1.blg
Fred Drakee2e904f1998-03-10 23:23:05 +0000177}
178
Fred Drakee1feb8f1998-08-28 20:21:04 +0000179parse_option() {
180 # When using a long option with a parameter separated by '=',
181 # generalize the parsing of the two:
182 OPTION="$1"
183 unset VALUE
184 STUFF=`echo "$1" | grep '^--[-a-zA-Z0-9]*='`
185 if [ "$STUFF" ] ; then
186 # This leaves OPTION=--option= and VALUE=value
187 OPTION=`echo "$STUFF" | sed 's/^\(--[-a-zA-Z0-9]*=\)\(.*\)$/\1/'`
188 VALUE=`echo "$STUFF" | sed 's/^\(--[-a-zA-Z0-9]*=\)\(.*\)$/\2/'`
189 fi
190}
191
Fred Drakee2e904f1998-03-10 23:23:05 +0000192# figure out what our targets are:
193while [ "$1" ] ; do
Fred Drakee1feb8f1998-08-28 20:21:04 +0000194 parse_option "$1"
195 case "$OPTION" in
Fred Drake9f6f0da1998-08-12 18:07:51 +0000196 --all|--al)
197 BUILD_PDF=true
198 BUILD_PS=true
199 BUILD_DVI=true
200 BUILD_HTML=true
201 BUILD_TEXT=true
202 USE_DEFAULT_FORMAT=false
203 shift 1
204 ;;
Fred Drakee2e904f1998-03-10 23:23:05 +0000205 --pdf|--pd)
206 BUILD_PDF=true
207 USE_DEFAULT_FORMAT=false
208 shift 1
209 ;;
Fred Drake88053541998-04-24 21:57:12 +0000210 --ps|--postscript|--postscrip|--postscri|--postscr|--postsc|--posts|--post|--pos|--po)
Fred Drakee2e904f1998-03-10 23:23:05 +0000211 BUILD_PS=true
212 USE_DEFAULT_FORMAT=false
213 shift 1
214 ;;
215 --dvi|--dv|--d)
216 BUILD_DVI=true
217 USE_DEFAULT_FORMAT=false
218 shift 1
219 ;;
Fred Drakeac8f91a1998-04-02 15:37:13 +0000220 --html|--htm|--ht)
Fred Drakee2e904f1998-03-10 23:23:05 +0000221 BUILD_HTML=true
222 USE_DEFAULT_FORMAT=false
223 shift 1
224 ;;
Fred Drake9940bd71998-08-06 20:15:20 +0000225 --text|--tex|--te|--t)
226 BUILD_TEXT=true
227 USE_DEFAULT_FORMAT=false
228 shift 1
229 ;;
Fred Drakeac8f91a1998-04-02 15:37:13 +0000230 -H|--help|--hel|--he)
231 usage 0
232 ;;
Fred Drake11300cc1998-08-05 04:48:18 +0000233 -i|--iconserver|--iconserve|--iconserv|--iconser|--iconse|--icons|--icon|--ico|--ic|--i)
234 ICONSERVER="$2"
235 shift 2
236 ;;
Fred Drakee1feb8f1998-08-28 20:21:04 +0000237 --iconserver=*|--iconserve=*|--iconserv=*|--iconser=*|--iconse=*|--icons=*|--icon=*|--ico=*|--ic=*|--i=*)
238 ICONSERVER="$VALUE"
239 shift 1
240 ;;
Fred Drake35049521998-05-11 19:04:06 +0000241 -a|--address|--addres|--addre|-addr|--add|--ad)
Fred Drakee2e904f1998-03-10 23:23:05 +0000242 ADDRESS="$2"
243 shift 2
244 ;;
Fred Drakee1feb8f1998-08-28 20:21:04 +0000245 --address=*|--addres=*|--addre=*|-addr=*|--add=*|--ad=*)
246 ADDRESS="$VALUE"
247 shift 1
248 ;;
Fred Drake35049521998-05-11 19:04:06 +0000249 --a4)
250 TEXINPUTS=$TOPDIR/paper-a4:$TEXINPUTS
251 shift 1
252 ;;
Fred Drake5d59d3d1999-02-15 16:27:42 +0000253 --l2h-config|--l2h-confi|--l2h-conf|--l2h-con|--l2h-co|--l2h-c|--l2h-|--l2h|--l2)
254 CONFIG_FILES="$CONFIG_FILES $2"
255 shift 2
256 ;;
Fred Draked5d473f1998-05-11 20:40:24 +0000257 --letter|--lette|--lett|--let|--le)
258 shift 1
259 ;;
Fred Drake88053541998-04-24 21:57:12 +0000260 --link|--lin|--li)
261 LINK="$2"
Fred Drakeac8f91a1998-04-02 15:37:13 +0000262 shift 2
263 ;;
Fred Drakee1feb8f1998-08-28 20:21:04 +0000264 --link=*|--lin=*|--li=*)
265 LINK="$VALUE"
266 shift 1
267 ;;
Fred Drake88053541998-04-24 21:57:12 +0000268 -s|--split|--spli|--spl|--sp|--s)
269 MAX_SPLIT_DEPTH="$2"
270 shift 2
271 ;;
Fred Drakee1feb8f1998-08-28 20:21:04 +0000272 --split=|--spli=|--spl=|--sp=|--s=)
273 MAX_SPLIT_DEPTH="$VALUE"
274 shift 1
275 ;;
Fred Drake88053541998-04-24 21:57:12 +0000276 -l|--logging|--loggin|--loggi|--logg|--log|--lo)
Fred Drakedbc879e1998-03-11 15:33:44 +0000277 LOGGING=true
278 shift 1
279 ;;
280 -D|--debugging|--debuggin|--debuggi|--debugg|--debug|--debu|--deb|--de)
281 DEBUGGING=true
282 shift 1
283 ;;
284 -k|--keep|--kee|--ke|--k)
285 DISCARD_TEMPS=''
286 shift 1
287 ;;
Fred Drakeac8f91a1998-04-02 15:37:13 +0000288 -q|--quiet|--quie|--qui|--qu|--q)
Fred Drake664b36f1998-03-11 15:41:21 +0000289 QUIET=true
290 shift 1
291 ;;
Fred Drake88053541998-04-24 21:57:12 +0000292 --)
Fred Drakec9b8a571998-04-29 21:28:25 +0000293 shift 1
Fred Drake88053541998-04-24 21:57:12 +0000294 break
295 ;;
Fred Drakee2e904f1998-03-10 23:23:05 +0000296 -*)
Fred Drakee1feb8f1998-08-28 20:21:04 +0000297 usage 2 "Unknown option: ${VALUE%=}"
Fred Drakee2e904f1998-03-10 23:23:05 +0000298 ;;
299 *)
300 break;;
301 esac
302done
303
304if [ $# = 0 ] ; then
Fred Drake9940bd71998-08-06 20:15:20 +0000305 # check for a single .tex file in .
306 COUNT=`ls -1 *.tex | wc -l | sed 's/[ ]//g'`
307 if [ "$COUNT" -eq 1 ] ; then
308 set -- `ls -1 *.tex`
Fred Drake9f6f0da1998-08-12 18:07:51 +0000309 elif [ "$COUNT" -gt 1 ] ; then
310 usage 2 "Could not deduce which file(s) to process as HOWTO documents."
Fred Drake9940bd71998-08-06 20:15:20 +0000311 else
Fred Drake9f6f0da1998-08-12 18:07:51 +0000312 usage 2 "No file to process."
Fred Drake9940bd71998-08-06 20:15:20 +0000313 fi
Fred Drakee2e904f1998-03-10 23:23:05 +0000314fi
315
316if [ $USE_DEFAULT_FORMAT = true ] ; then
317 eval "BUILD_$DEFAULT_FORMAT=true"
318fi
319
Fred Drake664b36f1998-03-11 15:41:21 +0000320if [ "$QUIET" ] ; then
321 exec >/dev/null
322fi
323
Fred Drake9940bd71998-08-06 20:15:20 +0000324if [ "$DEBUGGING" ] ; then
325 set -x
326fi
327
Fred Drake11300cc1998-08-05 04:48:18 +0000328echo '# auxillary init file for latex2html' >$L2H_AUX_INIT_FILE
Fred Drakea5de7301998-10-19 19:14:42 +0000329echo '# generated by mkhowto.sh -- do not edit' >>$L2H_AUX_INIT_FILE
Fred Drake5d59d3d1999-02-15 16:27:42 +0000330for FILE in XXX $CONFIG_FILES ; do
331 if [ ! "$FILE" = XXX ] ; then
332 cat >>$L2H_AUX_INIT_FILE $FILE
333 cat >>$L2H_AUX_INIT_FILE <<EOF
334
335print "\\ninitializing from file: $FILE";
336EOF
337 fi
338done
Fred Drakee1feb8f1998-08-28 20:21:04 +0000339if [ "$ICONSERVER" ] ; then
340 ICONSERVER="${ICONSERVER%/}"
341fi
Fred Drake11300cc1998-08-05 04:48:18 +0000342l2hoption ICONSERVER "$ICONSERVER"
343l2hoption ADDRESS "$ADDRESS"
344l2hoption MAX_LINK_DEPTH "$MAX_LINK_DEPTH"
345l2hoption MAX_SPLIT_DEPTH "$MAX_SPLIT_DEPTH"
346echo '1;' >>$L2H_AUX_INIT_FILE
Fred Drakef4fc4761998-05-14 20:03:14 +0000347
Fred Drakee2e904f1998-03-10 23:23:05 +0000348for FILE in $@ ; do
Fred Drakedf825a11998-05-14 20:36:49 +0000349 FILEDIR=`dirname $FILE`
Fred Drakee1feb8f1998-08-28 20:21:04 +0000350 FILE=`basename $FILE .tex`
Fred Drakef4fc4761998-05-14 20:03:14 +0000351 #
352 # Put the directory the .tex file is in is also the first directory in
353 # TEXINPUTS, to allow files there to override files in the common area.
354 #
Fred Drake11300cc1998-08-05 04:48:18 +0000355 TEXINPUTS=$FILEDIR:$TOPDIR/texinputs:$TEXINPUTS
Fred Drakef4fc4761998-05-14 20:03:14 +0000356 export TEXINPUTS
357 #
Fred Drakee2e904f1998-03-10 23:23:05 +0000358 if [ "$BUILD_DVI" -o "$BUILD_PS" ] ; then
Fred Drakedbc879e1998-03-11 15:33:44 +0000359 build_dvi $FILE 2>&1 | tee -a $LOGFILE
Fred Drake9940bd71998-08-06 20:15:20 +0000360 HAVE_TEMPS=true
Fred Drakee2e904f1998-03-10 23:23:05 +0000361 fi
362 if [ "$BUILD_PDF" ] ; then
Fred Drakedbc879e1998-03-11 15:33:44 +0000363 build_pdf $FILE 2>&1 | tee -a $LOGFILE
Fred Drake9940bd71998-08-06 20:15:20 +0000364 HAVE_TEMPS=true
Fred Drakee2e904f1998-03-10 23:23:05 +0000365 fi
366 if [ "$BUILD_PS" ] ; then
Fred Drakedbc879e1998-03-11 15:33:44 +0000367 build_ps $FILE 2>&1 | tee -a $LOGFILE
Fred Drakee2e904f1998-03-10 23:23:05 +0000368 fi
369 if [ "$BUILD_HTML" ] ; then
Fred Drake9940bd71998-08-06 20:15:20 +0000370 if [ ! "$HAVE_TEMPS" ] ; then
Fred Drakee2e904f1998-03-10 23:23:05 +0000371 # need to get aux file
Fred Drakedbc879e1998-03-11 15:33:44 +0000372 build_dvi $FILE 2>&1 | tee -a $LOGFILE
Fred Drake9940bd71998-08-06 20:15:20 +0000373 HAVE_TEMPS=true
Fred Drakee2e904f1998-03-10 23:23:05 +0000374 fi
Fred Drake9940bd71998-08-06 20:15:20 +0000375 build_html $FILE $FILE 2>&1 | tee -a $LOGFILE
Fred Drakea5de7301998-10-19 19:14:42 +0000376 if [ "$ICONSERVER" = "." ] ; then
377 cp $TOPDIR/icons/*.gif $FILE/
378 fi
Fred Drakee2e904f1998-03-10 23:23:05 +0000379 fi
Fred Drake9940bd71998-08-06 20:15:20 +0000380 if [ "$BUILD_TEXT" ] ; then
381 if [ ! "$HAVE_TEMPS" ] ; then
382 # need to get aux file
383 build_dvi $FILE 2>&1 | tee -a $LOGFILE
384 HAVE_TEMPS=true
385 fi
386 # this is why building text really has to be last:
387 if [ "$MAX_SPLIT_DEPTH" -ne 1 ] ; then
388 echo '# re-hack this file for --text:' >>$L2H_AUX_INIT_FILE
389 l2hoption MAX_SPLIT_DEPTH 1
390 echo '1;' >>$L2H_AUX_INIT_FILE
391 TEMPDIR=$FILE.temp-html
392 build_html $FILE $TEMPDIR 2>&1 | tee -a $LOGFILE
393 else
394 TEMPDIR=$FILE
395 fi
396 build_text $FILE $TEMPDIR 2>&1 | tee -a $LOGFILE
397 fi
398
Fred Drakedbc879e1998-03-11 15:33:44 +0000399 if [ "$DISCARD_TEMPS" ] ; then
Fred Drake12f842e1998-04-17 02:52:12 +0000400 cleanup $FILE 2>&1 | tee -a $LOGFILE
Fred Drakee2e904f1998-03-10 23:23:05 +0000401 fi
Fred Drake12f842e1998-04-17 02:52:12 +0000402 # keep the logfile around
Fred Drakedbc879e1998-03-11 15:33:44 +0000403 if [ "$LOGGING" ] ; then
404 cp $LOGFILE $FILE.how
405 fi
406 rm -f $LOGFILE
Fred Drakee2e904f1998-03-10 23:23:05 +0000407done
Fred Drake11300cc1998-08-05 04:48:18 +0000408
Fred Drakeb0b19001998-10-07 16:41:40 +0000409if [ ! "$DEBUGGING" ] ; then
410 rm -f $L2H_AUX_INIT_FILE
411fi