| Line 1... |
Line 1... |
| 1 |
#! /bin/sh
|
1 |
#! /bin/sh
|
| 2 |
# texi2dvi --- produce DVI (or PDF) files from Texinfo (or LaTeX) sources.
|
2 |
# texi2dvi --- produce DVI (or PDF) files from Texinfo (or LaTeX) sources.
|
| 3 |
# $Id: texi2dvi,v 1.3 2004/02/17 16:59:46 karl Exp $
|
3 |
# $Id: texi2dvi,v 1.34 2004/12/01 18:35:36 karl Exp $
|
| 4 |
#
|
4 |
#
|
| 5 |
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2001,
|
5 |
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2001,
|
| 6 |
# 2002, 2003, 2004 Free Software Foundation, Inc.
|
6 |
# 2002, 2003, 2004 Free Software Foundation, Inc.
|
| 7 |
#
|
7 |
#
|
| 8 |
# This program is free software; you can redistribute it and/or modify
|
8 |
# This program is free software; you can redistribute it and/or modify
|
| Line 16... |
Line 16... |
| 16 |
# GNU General Public License for more details.
|
16 |
# GNU General Public License for more details.
|
| 17 |
#
|
17 |
#
|
| 18 |
# You should have received a copy of the GNU General Public License
|
18 |
# You should have received a copy of the GNU General Public License
|
| 19 |
# along with this program; if not, you can either send email to this
|
19 |
# along with this program; if not, you can either send email to this
|
| 20 |
# program's maintainer or write to: The Free Software Foundation,
|
20 |
# program's maintainer or write to: The Free Software Foundation,
|
| 21 |
# Inc.; 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
21 |
# Inc.; 59 Temple Place, Suite 330; Boston, MA 02111-1307, USA.
|
| 22 |
#
|
22 |
#
|
| 23 |
# Original author: Noah Friedman.
|
23 |
# Original author: Noah Friedman.
|
| 24 |
#
|
24 |
#
|
| 25 |
# Please send bug reports, etc. to bug-texinfo@gnu.org.
|
25 |
# Please send bug reports, etc. to bug-texinfo@gnu.org.
|
| 26 |
# If possible, please send a copy of the output of the script called with
|
26 |
# If possible, please send a copy of the output of the script called with
|
| 27 |
# the `--debug' option when making a bug report.
|
27 |
# the `--debug' option when making a bug report.
|
| 28 |
|
28 |
|
| 29 |
# This string is expanded by rcs automatically when this file is checked out.
|
29 |
# This string is expanded by rcs automatically when this file is checked out.
|
| 30 |
rcs_revision='$Rev: 37351 $'
|
30 |
rcs_revision='$Revision: 37939 $'
|
| 31 |
rcs_version=`set - $rcs_revision; echo $2`
|
31 |
rcs_version=`set - $rcs_revision; echo $2`
|
| 32 |
program=`echo $0 | sed -e 's!.*/!!'`
|
32 |
program=`echo $0 | sed -e 's!.*/!!'`
|
| 33 |
version="texi2dvi (GNU Texinfo 4.7) $rcs_version
|
33 |
version="texi2dvi (GNU Texinfo 4.8) $rcs_version
|
| 34 |
|
34 |
|
| 35 |
Copyright (C) 2004 Free Software Foundation, Inc.
|
35 |
Copyright (C) 2004 Free Software Foundation, Inc.
|
| 36 |
There is NO warranty. You may redistribute this software
|
36 |
There is NO warranty. You may redistribute this software
|
| 37 |
under the terms of the GNU General Public License.
|
37 |
under the terms of the GNU General Public License.
|
| 38 |
For more information about these matters, see the files named COPYING."
|
38 |
For more information about these matters, see the files named COPYING."
|
| Line 63... |
Line 63... |
| 63 |
-@ use @input instead of \input; for preloaded Texinfo
|
63 |
-@ use @input instead of \input; for preloaded Texinfo
|
| 64 |
-e, -E, --expand force macro expansion using makeinfo
|
64 |
-e, -E, --expand force macro expansion using makeinfo
|
| 65 |
-I DIR search DIR for Texinfo files
|
65 |
-I DIR search DIR for Texinfo files
|
| 66 |
-l, --language=LANG specify the LANG of FILE (LaTeX or Texinfo)
|
66 |
-l, --language=LANG specify the LANG of FILE (LaTeX or Texinfo)
|
| 67 |
-p, --pdf use pdftex or pdflatex for processing
|
67 |
-p, --pdf use pdftex or pdflatex for processing
|
| - |
|
68 |
-r, --recode call recode before TeX to translate input characters
|
| 68 |
-t, --command=CMD insert CMD in copy of input file;
|
69 |
-t, --command=CMD insert CMD in copy of input file
|
| 69 |
or --texinfo=CMD multiple values accumulate
|
70 |
or --texinfo=CMD multiple values accumulate
|
| 70 |
|
71 |
|
| 71 |
The values of the BIBTEX, LATEX (or PDFLATEX), MAKEINDEX, MAKEINFO,
|
72 |
The values of the BIBTEX, LATEX (or PDFLATEX), MAKEINDEX, MAKEINFO,
|
| 72 |
TEX (or PDFTEX), TEXINDEX, and THUMBPDF environment variables are used
|
73 |
TEX (or PDFTEX), TEXINDEX, and THUMBPDF environment variables are used
|
| 73 |
to run those commands, if they are set. Any CMD strings are added
|
74 |
to run those commands, if they are set. Any CMD strings are added
|
| Line 87... |
Line 88... |
| 87 |
expand= # t for expansion via makeinfo
|
88 |
expand= # t for expansion via makeinfo
|
| 88 |
miincludes= # makeinfo include path
|
89 |
miincludes= # makeinfo include path
|
| 89 |
oformat=dvi
|
90 |
oformat=dvi
|
| 90 |
oname= # --output
|
91 |
oname= # --output
|
| 91 |
quiet= # by default let the tools' message be displayed
|
92 |
quiet= # by default let the tools' message be displayed
|
| - |
|
93 |
recode=false
|
| 92 |
set_language=
|
94 |
set_language=
|
| 93 |
textra= # Extra TeX commands to insert in the input file.
|
95 |
textra= # Extra TeX commands to insert in the input file.
|
| 94 |
textra_cmd= # sed command to insert TEXTRA where appropriate
|
96 |
textra_cmd= # sed command to insert TEXTRA where appropriate
|
| 95 |
tmpdir=${TMPDIR:-/tmp}/t2d$$ # avoid collisions on 8.3 filesystems.
|
97 |
tmpdir=${TMPDIR:-/tmp}/t2d$$ # avoid collisions on 8.3 filesystems.
|
| 96 |
txincludes= # TEXINPUTS extensions, with trailing colon
|
98 |
txincludes= # TEXINPUTS extensions, with trailing colon
|
| Line 112... |
Line 114... |
| 112 |
|
114 |
|
| 113 |
# In case someone crazy insists on using grep -E.
|
115 |
# In case someone crazy insists on using grep -E.
|
| 114 |
: ${EGREP=egrep}
|
116 |
: ${EGREP=egrep}
|
| 115 |
|
117 |
|
| 116 |
# return true if program $1 is somewhere in PATH, else false.
|
118 |
# return true if program $1 is somewhere in PATH, else false.
|
| 117 |
#
|
119 |
#
|
| 118 |
findprog () {
|
120 |
findprog () {
|
| 119 |
foundprog=false
|
121 |
foundprog=false
|
| 120 |
for dir in `echo $PATH | tr "$path_sep" " "`; do
|
122 |
for dir in `echo $PATH | tr "$path_sep" " "`; do
|
| 121 |
if test -x "$dir/$1"; then # does anyone still need test -f?
|
123 |
if test -x "$dir/$1"; then # does anyone still need test -f?
|
| 122 |
foundprog=true
|
124 |
foundprog=true
|
| Line 168... |
Line 170... |
| 168 |
# This recognizes --quark as --quiet. So what.
|
170 |
# This recognizes --quark as --quiet. So what.
|
| 169 |
case "$1" in
|
171 |
case "$1" in
|
| 170 |
-@ ) escape=@;;
|
172 |
-@ ) escape=@;;
|
| 171 |
# Silently and without documentation accept -b and --b[atch] as synonyms.
|
173 |
# Silently and without documentation accept -b and --b[atch] as synonyms.
|
| 172 |
-b | --b*) batch=true;;
|
174 |
-b | --b*) batch=true;;
|
| 173 |
-q | -s | --q* | --s*) quiet=t; batch=true;;
|
- |
|
| 174 |
-c | --c*) clean=t;;
|
175 |
-c | --c*) clean=t;;
|
| 175 |
-D | --d*) debug=t;;
|
176 |
-D | --d*) debug=t;;
|
| 176 |
-e | -E | --e*) expand=t;;
|
177 |
-e | -E | --e*) expand=t;;
|
| 177 |
-h | --h*) echo "$usage"; exit 0;;
|
178 |
-h | --h*) echo "$usage"; exit 0;;
|
| 178 |
-I | --I*)
|
179 |
-I | --I*)
|
| Line 187... |
Line 188... |
| 187 |
case "$1" in
|
188 |
case "$1" in
|
| 188 |
/* | ?:/*) oname=$1;;
|
189 |
/* | ?:/*) oname=$1;;
|
| 189 |
*) oname="$orig_pwd/$1";;
|
190 |
*) oname="$orig_pwd/$1";;
|
| 190 |
esac;;
|
191 |
esac;;
|
| 191 |
-p | --p*) oformat=pdf;;
|
192 |
-p | --p*) oformat=pdf;;
|
| - |
|
193 |
-q | -s | --q* | --s*) quiet=t; batch=true;;
|
| - |
|
194 |
-r | --r*) recode=true;;
|
| 192 |
-t | --tex* | --com* ) shift; textra="$textra\\
|
195 |
-t | --tex* | --com* ) shift; textra="$textra\\
|
| 193 |
"`echo "$1" | sed 's/\\\\/\\\\\\\\/g'`;;
|
196 |
"`echo "$1" | sed 's/\\\\/\\\\\\\\/g'`;;
|
| 194 |
-v | --vers*) echo "$version"; exit 0;;
|
197 |
-v | --vers*) echo "$version"; exit 0;;
|
| 195 |
-V | --verb*) verbose=echo;;
|
198 |
-V | --verb*) verbose=echo;;
|
| 196 |
--) # What remains are not options.
|
199 |
--) # What remains are not options.
|
| Line 227... |
Line 230... |
| 227 |
;;
|
230 |
;;
|
| 228 |
esac
|
231 |
esac
|
| 229 |
|
232 |
|
| 230 |
|
233 |
|
| 231 |
# We can't do much without tex.
|
234 |
# We can't do much without tex.
|
| 232 |
#
|
235 |
#
|
| 233 |
if findprog ${TEX:-tex}; then :; else cat <<EOM
|
236 |
if findprog ${TEX:-tex}; then :; else cat <<EOM
|
| 234 |
You don't have a working TeX binary (${TEX:-tex}) installed anywhere in
|
237 |
You don't have a working TeX binary (${TEX:-tex}) installed anywhere in
|
| 235 |
your PATH, and texi2dvi cannot proceed without one. If you want to use
|
238 |
your PATH, and texi2dvi cannot proceed without one. If you want to use
|
| 236 |
this script, you'll need to install TeX (if you don't have it) or change
|
239 |
this script, you'll need to install TeX (if you don't have it) or change
|
| 237 |
your PATH or TEX environment variable (if you do). See the --help
|
240 |
your PATH or TEX environment variable (if you do). See the --help
|
| Line 247... |
Line 250... |
| 247 |
|
250 |
|
| 248 |
# We want to use etex (or pdftex) if they are available, and the user
|
251 |
# We want to use etex (or pdftex) if they are available, and the user
|
| 249 |
# didn't explicitly specify. We don't check for elatex and pdfelatex
|
252 |
# didn't explicitly specify. We don't check for elatex and pdfelatex
|
| 250 |
# because (as of 2003), the LaTeX team has asked that new distributions
|
253 |
# because (as of 2003), the LaTeX team has asked that new distributions
|
| 251 |
# use etex by default anyway.
|
254 |
# use etex by default anyway.
|
| 252 |
#
|
255 |
#
|
| 253 |
# End up with the TEX and PDFTEX variables set to what we are going to use.
|
256 |
# End up with the TEX and PDFTEX variables set to what we are going to use.
|
| 254 |
if test -z "$TEX"; then
|
257 |
if test -z "$TEX"; then
|
| 255 |
if findprog etex; then TEX=etex; else TEX=tex; fi
|
258 |
if findprog etex; then TEX=etex; else TEX=tex; fi
|
| 256 |
fi
|
259 |
fi
|
| 257 |
#
|
260 |
#
|
| Line 308... |
Line 311... |
| 308 |
uncomment_iftex_sed=$utildir/uncomment.sed
|
311 |
uncomment_iftex_sed=$utildir/uncomment.sed
|
| 309 |
cat <<EOF >$uncomment_iftex_sed
|
312 |
cat <<EOF >$uncomment_iftex_sed
|
| 310 |
s/^@c texi2dvi//
|
313 |
s/^@c texi2dvi//
|
| 311 |
EOF
|
314 |
EOF
|
| 312 |
|
315 |
|
| 313 |
# A shell script that computes the list of xref files.
|
316 |
# Compute the list of xref files.
|
| 314 |
# Takes the filename (without extension) of which we look for xref
|
317 |
# Takes the filename (without extension) of which we look for xref
|
| 315 |
# files as argument. The index files must be reported last.
|
318 |
# files as argument. The index files must be reported last.
|
| 316 |
get_xref_files=$utildir/get_xref.sh
|
- |
|
| 317 |
cat <<\EOF >$get_xref_files
|
319 |
get_xref_files ()
|
| 318 |
#! /bin/sh
|
- |
|
| 319 |
|
320 |
{
|
| 320 |
# Get list of xref files (indexes, tables and lists).
|
321 |
# Get list of xref files (indexes, tables and lists).
|
| 321 |
# Find all files having root filename with a two-letter extension,
|
322 |
# Find all files having root filename with a two-letter extension,
|
| 322 |
# saves the ones that are really Texinfo-related files. .?o? catches
|
323 |
# saves the ones that are really Texinfo-related files. .?o? catches
|
| 323 |
# many files: .toc, .log, LaTeX tables and lists, FiXme's .lox, maybe more.
|
324 |
# many files: .toc, .log, LaTeX tables and lists, FiXme's .lox, maybe more.
|
| 324 |
for this_file in "$1".?o? "$1".aux "$1".?? "$1".idx; do
|
325 |
for this_file in "$1".?o? "$1".aux "$1".?? "$1".idx; do
|
| 325 |
# If file is empty, skip it.
|
326 |
# If file is empty, skip it.
|
| 326 |
test -s "$this_file" || continue
|
327 |
test -s "$this_file" || continue
|
| 327 |
# If the file is not suitable to be an index or xref file, don't
|
328 |
# If the file is not suitable to be an index or xref file, don't
|
| 328 |
# process it. It's suitable if the first character is a
|
329 |
# process it. It's suitable if the first character is a
|
| 329 |
# backslash or right quote, as long as the first line isn't
|
330 |
# backslash or right quote or at, as long as the first line isn't
|
| 330 |
# \input texinfo.
|
331 |
# \input texinfo.
|
| 331 |
first_character=`sed -n '1s/^\(.\).*$/\1/p;q' $this_file`
|
332 |
first_character=`sed -n '1s/^\(.\).*$/\1/p;q' $this_file`
|
| 332 |
if (test "x$first_character" = "x\\" \
|
333 |
if (test "x$first_character" = "x\\" \
|
| 333 |
&& sed 1q $this_file | grep -v '^\\input *texinfo' >/dev/null) \
|
334 |
&& sed 1q $this_file | grep -v '^\\input *texinfo' >/dev/null) \
|
| - |
|
335 |
|| test "x$first_character" = "x'" \
|
| 334 |
|| test "x$first_character" = "x'"; then
|
336 |
|| test "x$first_character" = "x@"; then
|
| 335 |
xref_files="$xref_files ./$this_file"
|
337 |
xref_files="$xref_files ./$this_file"
|
| 336 |
fi
|
338 |
fi
|
| 337 |
done
|
339 |
done
|
| 338 |
echo "$xref_files"
|
340 |
echo "$xref_files"
|
| 339 |
EOF
|
341 |
}
|
| 340 |
chmod 500 $get_xref_files
|
- |
|
| 341 |
|
342 |
|
| 342 |
# File descriptor usage:
|
343 |
# File descriptor usage:
|
| 343 |
# 0 standard input
|
344 |
# 0 standard input
|
| 344 |
# 1 standard output (--verbose messages)
|
345 |
# 1 standard output (--verbose messages)
|
| 345 |
# 2 standard error
|
346 |
# 2 standard error
|
| Line 402... |
Line 403... |
| 402 |
|
403 |
|
| 403 |
# _xtr. The file with the user's extra commands.
|
404 |
# _xtr. The file with the user's extra commands.
|
| 404 |
tmpdir_xtr=$tmpdir/xtr
|
405 |
tmpdir_xtr=$tmpdir/xtr
|
| 405 |
filename_xtr=$tmpdir_xtr/$filename_noext.$ext
|
406 |
filename_xtr=$tmpdir_xtr/$filename_noext.$ext
|
| 406 |
|
407 |
|
| - |
|
408 |
# _rcd. The Texinfo file recoded in 7bit.
|
| - |
|
409 |
tmpdir_rcd=$tmpdir/rcd
|
| - |
|
410 |
filename_rcd=$tmpdir_rcd/$filename_noext.$ext
|
| - |
|
411 |
|
| 407 |
# _bak. Copies of the previous xref files (another round is run if
|
412 |
# _bak. Copies of the previous xref files (another round is run if
|
| 408 |
# they differ from the new one).
|
413 |
# they differ from the new one).
|
| 409 |
tmpdir_bak=$tmpdir/bak
|
414 |
tmpdir_bak=$tmpdir/bak
|
| 410 |
|
415 |
|
| 411 |
# Make all those directories and give up if we can't succeed.
|
416 |
# Make all those directories and give up if we can't succeed.
|
| 412 |
mkdir $tmpdir_src $tmpdir_xtr $tmpdir_bak || exit 1
|
417 |
mkdir $tmpdir_src $tmpdir_xtr $tmpdir_rcd $tmpdir_bak || exit 1
|
| 413 |
|
418 |
|
| 414 |
# Source file might include additional sources.
|
419 |
# Source file might include additional sources.
|
| 415 |
# We want `.:$orig_pwd' before anything else. (We'll add `.:' later
|
420 |
# We want `.:$orig_pwd' before anything else. (We'll add `.:' later
|
| 416 |
# after all other directories have been turned into absolute paths.)
|
421 |
# after all other directories have been turned into absolute paths.)
|
| 417 |
# `.' goes first to ensure that any old .aux, .cps,
|
422 |
# `.' goes first to ensure that any old .aux, .cps,
|
| Line 486... |
Line 491... |
| 486 |
# we just guessed, or from the file extension if not set yet.
|
491 |
# we just guessed, or from the file extension if not set yet.
|
| 487 |
case ${language:-$filename_ext} in
|
492 |
case ${language:-$filename_ext} in
|
| 488 |
[lL]a[tT]e[xX] | *.ltx | *.tex)
|
493 |
[lL]a[tT]e[xX] | *.ltx | *.tex)
|
| 489 |
# Assume a LaTeX file. LaTeX needs bibtex and uses latex for
|
494 |
# Assume a LaTeX file. LaTeX needs bibtex and uses latex for
|
| 490 |
# compilation. No makeinfo.
|
495 |
# compilation. No makeinfo.
|
| - |
|
496 |
language=latex
|
| 491 |
bibtex=${BIBTEX:-bibtex}
|
497 |
bibtex=${BIBTEX:-bibtex}
|
| 492 |
makeinfo= # no point in running makeinfo on latex source.
|
498 |
makeinfo= # no point in running makeinfo on latex source.
|
| 493 |
texindex=${MAKEINDEX:-makeindex}
|
499 |
texindex=${MAKEINDEX:-makeindex}
|
| 494 |
textra_cmd=1i
|
500 |
textra_cmd=1i
|
| 495 |
if test $oformat = dvi; then
|
501 |
if test $oformat = dvi; then
|
| Line 500... |
Line 506... |
| 500 |
thumbpdf=${THUMBPDF:-thumbpdf}
|
506 |
thumbpdf=${THUMBPDF:-thumbpdf}
|
| 501 |
;;
|
507 |
;;
|
| 502 |
|
508 |
|
| 503 |
*)
|
509 |
*)
|
| 504 |
# Assume a Texinfo file. Texinfo files need makeinfo, texindex and tex.
|
510 |
# Assume a Texinfo file. Texinfo files need makeinfo, texindex and tex.
|
| - |
|
511 |
language=texinfo
|
| 505 |
bibtex=
|
512 |
bibtex=
|
| 506 |
texindex=${TEXINDEX:-texindex}
|
513 |
texindex=${TEXINDEX:-texindex}
|
| 507 |
textra_cmd='/^@setfilename/a'
|
514 |
textra_cmd='/^@setfilename/a'
|
| 508 |
if test $oformat = dvi; then
|
515 |
if test $oformat = dvi; then
|
| - |
|
516 |
# MetaPost also uses the TEX environment variable. If the user
|
| - |
|
517 |
# has set TEX=latex for that reason, don't bomb out.
|
| - |
|
518 |
if echo $TEX | grep 'latex$' >/dev/null; then
|
| - |
|
519 |
tex=tex # don't bother trying to find etex
|
| - |
|
520 |
else
|
| 509 |
tex=$TEX
|
521 |
tex=$TEX
|
| - |
|
522 |
fi
|
| 510 |
else
|
523 |
else
|
| 511 |
tex=$PDFTEX
|
524 |
tex=$PDFTEX
|
| 512 |
fi
|
525 |
fi
|
| 513 |
# Unless required by the user, makeinfo expansion is wanted only
|
526 |
# Unless required by the user, makeinfo expansion is wanted only
|
| 514 |
# if texinfo.tex is too old.
|
527 |
# if texinfo.tex is too old.
|
| Line 552... |
Line 565... |
| 552 |
tex_help=`cd $tmpdir >/dev/null && $tex --help </dev/null 2>&1`
|
565 |
tex_help=`cd $tmpdir >/dev/null && $tex --help </dev/null 2>&1`
|
| 553 |
|
566 |
|
| 554 |
# If possible, make TeX report error locations in GNU format.
|
567 |
# If possible, make TeX report error locations in GNU format.
|
| 555 |
tex_args=
|
568 |
tex_args=
|
| 556 |
case $tex_help in
|
569 |
case $tex_help in
|
| 557 |
*file-line-error-style*) tex_args="$tex_args --file-line-error-style";;
|
570 |
*file-line-error*) tex_args="$tex_args --file-line-error";;
|
| 558 |
esac
|
571 |
esac
|
| 559 |
|
572 |
|
| 560 |
# Tell TeX to be batch if requested. (\batchmode does not show
|
573 |
# Tell TeX to be batch if requested. (\batchmode does not show
|
| 561 |
# terminal output at all, so we don't want that.)
|
574 |
# terminal output at all, so we don't want that.)
|
| 562 |
$batch && tex_args="$tex_args ${escape}nonstopmode ${escape}input"
|
575 |
$batch && tex_args="$tex_args ${escape}nonstopmode ${escape}input"
|
| Line 583... |
Line 596... |
| 583 |
|
596 |
|
| 584 |
# Used most commonly for @finalout, @smallbook, etc.
|
597 |
# Used most commonly for @finalout, @smallbook, etc.
|
| 585 |
if test -n "$textra"; then
|
598 |
if test -n "$textra"; then
|
| 586 |
$verbose "Inserting extra commands: $textra"
|
599 |
$verbose "Inserting extra commands: $textra"
|
| 587 |
sed "$textra_cmd\\
|
600 |
sed "$textra_cmd\\
|
| 588 |
$textra" "$filename_input" >$filename_xtr
|
601 |
$textra" "$filename_input" >"$filename_xtr"
|
| 589 |
filename_input=$filename_xtr
|
602 |
filename_input=$filename_xtr
|
| 590 |
fi
|
603 |
fi
|
| 591 |
|
604 |
|
| - |
|
605 |
# If this is a Texinfo file with a specified input encoding, and
|
| - |
|
606 |
# recode is available, then recode to plain 7 bit Texinfo.
|
| - |
|
607 |
if test $language = texinfo; then
|
| - |
|
608 |
pgm='s/\(^\|.* \)@documentencoding *\([^ ][^ ]*\)\( .*\|$\)/\2/
|
| - |
|
609 |
t found
|
| - |
|
610 |
d
|
| - |
|
611 |
:found
|
| - |
|
612 |
q'
|
| - |
|
613 |
encoding=`sed -e "$pgm" "$filename_input"`
|
| - |
|
614 |
if $recode && test -n "$encoding" && findprog recode; then
|
| - |
|
615 |
$verbose "Recoding from $encoding to Texinfo."
|
| - |
|
616 |
if recode "$encoding"..texinfo <"$filename_input" >"$filename_rcd" \
|
| - |
|
617 |
&& test -s "$filename_rcd"; then
|
| - |
|
618 |
filename_input=$filename_rcd
|
| - |
|
619 |
else
|
| - |
|
620 |
$verbose "Recoding failed, using original input."
|
| - |
|
621 |
fi
|
| - |
|
622 |
fi
|
| - |
|
623 |
fi
|
| - |
|
624 |
|
| 592 |
# If clean mode was specified, then move to the temporary directory.
|
625 |
# If clean mode was specified, then move to the temporary directory.
|
| 593 |
if test "$clean" = t; then
|
626 |
if test "$clean" = t; then
|
| 594 |
$verbose "cd $tmpdir_src"
|
627 |
$verbose "cd $tmpdir_src"
|
| 595 |
cd "$tmpdir_src" || exit 1
|
628 |
cd "$tmpdir_src" || exit 1
|
| 596 |
fi
|
629 |
fi
|
| 597 |
|
630 |
|
| 598 |
while :; do # will break out of loop below
|
631 |
while :; do # will break out of loop below
|
| 599 |
orig_xref_files=`$get_xref_files "$filename_noext"`
|
632 |
orig_xref_files=`get_xref_files "$filename_noext"`
|
| 600 |
|
633 |
|
| 601 |
# Save copies of originals for later comparison.
|
634 |
# Save copies of originals for later comparison.
|
| 602 |
if test -n "$orig_xref_files"; then
|
635 |
if test -n "$orig_xref_files"; then
|
| 603 |
$verbose "Backing up xref files: `echo $orig_xref_files | sed 's|\./||g'`"
|
636 |
$verbose "Backing up xref files: `echo $orig_xref_files | sed 's|\./||g'`"
|
| 604 |
cp $orig_xref_files $tmpdir_bak
|
637 |
cp $orig_xref_files $tmpdir_bak
|
| Line 655... |
Line 688... |
| 655 |
$texindex $index_files 2>&5 1>&2 ||
|
688 |
$texindex $index_files 2>&5 1>&2 ||
|
| 656 |
fatal "$texindex exited with bad status, quitting."
|
689 |
fatal "$texindex exited with bad status, quitting."
|
| 657 |
fi
|
690 |
fi
|
| 658 |
|
691 |
|
| 659 |
# Finally, run TeX.
|
692 |
# Finally, run TeX.
|
| 660 |
cmd="$tex $tex_args $filename_input"
|
693 |
cmd="$tex $tex_args"
|
| 661 |
$verbose "Running $cmd ..."
|
694 |
$verbose "Running $cmd $filename_input ..."
|
| 662 |
if $cmd >&5; then :; else
|
695 |
if $cmd "$filename_input" >&5; then :; else
|
| 663 |
echo "$0: $tex exited with bad status, quitting." >&2
|
696 |
echo "$0: $tex exited with bad status, quitting." >&2
|
| 664 |
echo "$0: see $filename_noext.log for errors." >&2
|
697 |
echo "$0: see $filename_noext.log for errors." >&2
|
| 665 |
test "$clean" = t \
|
698 |
test "$clean" = t \
|
| 666 |
&& cp "$filename_noext.log" "$orig_pwd"
|
699 |
&& cp "$filename_noext.log" "$orig_pwd"
|
| 667 |
exit 1
|
700 |
exit 1
|
| Line 679... |
Line 712... |
| 679 |
if grep "Rerun to get" "$filename_noext.log" >&6 2>&1; then
|
712 |
if grep "Rerun to get" "$filename_noext.log" >&6 2>&1; then
|
| 680 |
finished=
|
713 |
finished=
|
| 681 |
fi
|
714 |
fi
|
| 682 |
|
715 |
|
| 683 |
# Check if xref files changed.
|
716 |
# Check if xref files changed.
|
| 684 |
new_xref_files=`$get_xref_files "$filename_noext"`
|
717 |
new_xref_files=`get_xref_files "$filename_noext"`
|
| 685 |
$verbose "Original xref files = `echo $orig_xref_files | sed 's|\./||g'`"
|
718 |
$verbose "Original xref files = `echo $orig_xref_files | sed 's|\./||g'`"
|
| 686 |
$verbose "New xref files = `echo $new_xref_files | sed 's|\./||g'`"
|
719 |
$verbose "New xref files = `echo $new_xref_files | sed 's|\./||g'`"
|
| 687 |
|
720 |
|
| 688 |
# If old and new lists don't at least have the same file list,
|
721 |
# If old and new lists don't at least have the same file list,
|
| 689 |
# then one file or another has definitely changed.
|
722 |
# then one file or another has definitely changed.
|
| Line 719... |
Line 752... |
| 719 |
then
|
752 |
then
|
| 720 |
$verbose "Running $thumbpdf $filename_noext ..."
|
753 |
$verbose "Running $thumbpdf $filename_noext ..."
|
| 721 |
$thumbpdf "$filename_noext" >&5 ||
|
754 |
$thumbpdf "$filename_noext" >&5 ||
|
| 722 |
fatal "$thumbpdf exited with bad status, quitting."
|
755 |
fatal "$thumbpdf exited with bad status, quitting."
|
| 723 |
|
756 |
|
| 724 |
$verbose "Running $cmd ..."
|
757 |
$verbose "Running $cmd $filename_input..."
|
| 725 |
if $cmd >&5; then :; else
|
758 |
if $cmd "$filename_input" >&5; then :; else
|
| 726 |
echo "$0: $tex exited with bad status, quitting." >&2
|
759 |
echo "$0: $tex exited with bad status, quitting." >&2
|
| 727 |
echo "$0: see $filename_noext.log for errors." >&2
|
760 |
echo "$0: see $filename_noext.log for errors." >&2
|
| 728 |
test "$clean" = t \
|
761 |
test "$clean" = t \
|
| 729 |
&& cp "$filename_noext.log" "$orig_pwd"
|
762 |
&& cp "$filename_noext.log" "$orig_pwd"
|
| 730 |
exit 1
|
763 |
exit 1
|