OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [gdb-5.3/] [readline/] [doc/] [texi2dvi] - Diff between revs 1183 and 1765

Go to most recent revision | Only display areas with differences | Details | Blame | View Log

Rev 1183 Rev 1765
#! /bin/sh
#! /bin/sh
# texi2dvi --- smartly produce DVI files from texinfo sources
# texi2dvi --- smartly produce DVI files from texinfo sources
# $Id: texi2dvi,v 1.2 2003-08-15 01:06:27 sfurman Exp $
# $Id: texi2dvi,v 1.2 2003-08-15 01:06:27 sfurman Exp $
#
#
# Copyright (C) 1992, 93, 94, 95, 96, 97, 98 Free Software Foundation, Inc.
# Copyright (C) 1992, 93, 94, 95, 96, 97, 98 Free Software Foundation, Inc.
#
#
# This program is free software; you can redistribute it and/or modify
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
# any later version.
#
#
# This program is distributed in the hope that it will be useful,
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
# GNU General Public License for more details.
#
#
# You should have received a copy of the GNU General Public License
# You should have received a copy of the GNU General Public License
# along with this program; if not, you can either send email to this
# along with this program; if not, you can either send email to this
# program's maintainer or write to: The Free Software Foundation,
# program's maintainer or write to: The Free Software Foundation,
# Inc.; 59 Temple Place, Suite 330; Boston, MA 02111-1307, USA.
# Inc.; 59 Temple Place, Suite 330; Boston, MA 02111-1307, USA.
#
#
# Commentary:
# Commentary:
#
#
# Author: Noah Friedman 
# Author: Noah Friedman 
#
#
# Please send bug reports, etc. to bug-texinfo@gnu.org.
# Please send bug reports, etc. to bug-texinfo@gnu.org.
# If possible, please send a copy of the output of the script called with
# If possible, please send a copy of the output of the script called with
# the `--debug' option when making a bug report.
# the `--debug' option when making a bug report.
#
#
# In the interest of general portability, some common bourne shell
# In the interest of general portability, some common bourne shell
# constructs were avoided because they weren't guaranteed to be available
# constructs were avoided because they weren't guaranteed to be available
# in some earlier implementations.  I've tried to make this program as
# in some earlier implementations.  I've tried to make this program as
# portable as possible.  Welcome to unix, where the lowest common
# portable as possible.  Welcome to unix, where the lowest common
# denominator is rapidly diminishing.
# denominator is rapidly diminishing.
#
#
# Among the more interesting lossages I noticed among Bourne shells:
# Among the more interesting lossages I noticed among Bourne shells:
#     * No shell functions.
#     * No shell functions.
#     * No `unset' builtin.
#     * No `unset' builtin.
#     * `shift' cannot take a numeric argument, and signals an error if
#     * `shift' cannot take a numeric argument, and signals an error if
#       there are no arguments to shift.
#       there are no arguments to shift.
#
#
# Code:
# Code:
# Name by which this script was invoked.
# Name by which this script was invoked.
progname=`echo "$0" | sed -e 's/[^\/]*\///g'`
progname=`echo "$0" | sed -e 's/[^\/]*\///g'`
# This string is expanded by rcs automatically when this file is checked out.
# This string is expanded by rcs automatically when this file is checked out.
rcs_revision='$Revision: 1.2 $'
rcs_revision='$Revision: 1.2 $'
version=`set - $rcs_revision; echo $2`
version=`set - $rcs_revision; echo $2`
# To prevent hairy quoting and escaping later.
# To prevent hairy quoting and escaping later.
bq='`'
bq='`'
eq="'"
eq="'"
usage="Usage: $0 [OPTION]... FILE...
usage="Usage: $0 [OPTION]... FILE...
Run a Texinfo document through TeX.
Run a Texinfo document through TeX.
Options:
Options:
-b, --batch          No interaction (\nonstopmode in TeX).
-b, --batch          No interaction (\nonstopmode in TeX).
-c, --clean          Remove all auxiliary files.
-c, --clean          Remove all auxiliary files.
-D, --debug          Turn on shell debugging ($bq${bq}set -x$eq$eq).
-D, --debug          Turn on shell debugging ($bq${bq}set -x$eq$eq).
-t, --texinfo CMD    Insert CMD after @setfilename before running TeX.
-t, --texinfo CMD    Insert CMD after @setfilename before running TeX.
--verbose            Report on what is done.
--verbose            Report on what is done.
-h, --help           Display this help and exit.
-h, --help           Display this help and exit.
-v, --version        Display version information and exit.
-v, --version        Display version information and exit.
The values of the TEX, TEXINDEX, and MAKEINFO environment variables are
The values of the TEX, TEXINDEX, and MAKEINFO environment variables are
used to run those commands, if they are set.
used to run those commands, if they are set.
Email bug reports to bug-texinfo@gnu.org."
Email bug reports to bug-texinfo@gnu.org."
# Initialize variables.
# Initialize variables.
# Don't use `unset' since old bourne shells don't have this command.
# Don't use `unset' since old bourne shells don't have this command.
# Instead, assign them an empty value.
# Instead, assign them an empty value.
# Some of these, like TEX and TEXINDEX, may be inherited from the environment.
# Some of these, like TEX and TEXINDEX, may be inherited from the environment.
backup_extension=.bak # these files get deleted if all goes well.
backup_extension=.bak # these files get deleted if all goes well.
batch=
batch=
clean=
clean=
debug=
debug=
orig_pwd="`pwd`"
orig_pwd="`pwd`"
textra=
textra=
verbose=false
verbose=false
makeinfo="${MAKEINFO-makeinfo}"
makeinfo="${MAKEINFO-makeinfo}"
texindex="${TEXINDEX-texindex}"
texindex="${TEXINDEX-texindex}"
tex="${TEX-tex}"
tex="${TEX-tex}"
# Save this so we can construct a new TEXINPUTS path for each file.
# Save this so we can construct a new TEXINPUTS path for each file.
TEXINPUTS_orig="$TEXINPUTS"
TEXINPUTS_orig="$TEXINPUTS"
export TEXINPUTS
export TEXINPUTS
# Parse command line arguments.
# Parse command line arguments.
# Make sure that all wildcarded options are long enough to be unambiguous.
# Make sure that all wildcarded options are long enough to be unambiguous.
# It's a good idea to document the full long option name in each case.
# It's a good idea to document the full long option name in each case.
# Long options which take arguments will need a `*' appended to the
# Long options which take arguments will need a `*' appended to the
# canonical name to match the value appended after the `=' character.
# canonical name to match the value appended after the `=' character.
while :; do
while :; do
  test $# -eq 0 && break
  test $# -eq 0 && break
  case "$1" in
  case "$1" in
    -b | --batch | --b* ) batch=t; shift ;;
    -b | --batch | --b* ) batch=t; shift ;;
    -c | --clean | --c* ) clean=t; shift ;;
    -c | --clean | --c* ) clean=t; shift ;;
    -D | --debug | --d* ) debug=t; shift ;;
    -D | --debug | --d* ) debug=t; shift ;;
    -h | --help | --h* )   echo "$usage"; exit 0 ;;
    -h | --help | --h* )   echo "$usage"; exit 0 ;;
    # OK, we should do real option parsing here, but be lazy for now.
    # OK, we should do real option parsing here, but be lazy for now.
    -t | --texinfo | --t*) shift; textra="$textra $1"; shift ;;
    -t | --texinfo | --t*) shift; textra="$textra $1"; shift ;;
    -v | --vers* )
    -v | --vers* )
      echo "$progname (GNU Texinfo 3.12) $version"
      echo "$progname (GNU Texinfo 3.12) $version"
      echo "Copyright (C) 1998 Free Software Foundation, Inc.
      echo "Copyright (C) 1998 Free Software Foundation, Inc.
There is NO warranty.  You may redistribute this software
There is NO warranty.  You may redistribute this software
under the terms of the GNU General Public License.
under the terms of the GNU General Public License.
For more information about these matters, see the files named COPYING."
For more information about these matters, see the files named COPYING."
      exit 0 ;;
      exit 0 ;;
    --verb* )            verbose=echo; shift ;;
    --verb* )            verbose=echo; shift ;;
    -- )     # Stop option processing
    -- )     # Stop option processing
      shift
      shift
      break ;;
      break ;;
    -* )
    -* )
      case "$1" in
      case "$1" in
        --*=* ) arg=`echo "$1" | sed -e 's/=.*//'` ;;
        --*=* ) arg=`echo "$1" | sed -e 's/=.*//'` ;;
        * )     arg="$1" ;;
        * )     arg="$1" ;;
      esac
      esac
      exec 1>&2
      exec 1>&2
      echo "$progname: Unknown or ambiguous option $bq$arg$eq."
      echo "$progname: Unknown or ambiguous option $bq$arg$eq."
      echo "$progname: Try $bq--help$eq for more information."
      echo "$progname: Try $bq--help$eq for more information."
      exit 1 ;;
      exit 1 ;;
    * ) break ;;
    * ) break ;;
   esac
   esac
done
done
# See if there are any command line args left (which will be interpreted as
# See if there are any command line args left (which will be interpreted as
# filename arguments).
# filename arguments).
if test $# -eq 0; then
if test $# -eq 0; then
  exec 1>&2
  exec 1>&2
  echo "$progname: At least one file name is required as an argument."
  echo "$progname: At least one file name is required as an argument."
  echo "$progname: Try $bq--help$eq for more information."
  echo "$progname: Try $bq--help$eq for more information."
  exit 2
  exit 2
fi
fi
test "$debug" = t && set -x
test "$debug" = t && set -x
# Texify files
# Texify files
for command_line_filename in ${1+"$@"}; do
for command_line_filename in ${1+"$@"}; do
  $verbose "Processing $command_line_filename ..."
  $verbose "Processing $command_line_filename ..."
  # See if file exists.  If it doesn't we're in trouble since, even
  # See if file exists.  If it doesn't we're in trouble since, even
  # though the user may be able to reenter a valid filename at the tex
  # though the user may be able to reenter a valid filename at the tex
  # prompt (assuming they're attending the terminal), this script won't
  # prompt (assuming they're attending the terminal), this script won't
  # be able to find the right index files and so forth.
  # be able to find the right index files and so forth.
  if test ! -r "${command_line_filename}"; then
  if test ! -r "${command_line_filename}"; then
    echo "$0: Could not read ${command_line_filename}." >&2
    echo "$0: Could not read ${command_line_filename}." >&2
    continue
    continue
  fi
  fi
  # Roughly equivalent to `dirname ...`, but more portable
  # Roughly equivalent to `dirname ...`, but more portable
  directory="`echo ${command_line_filename} | sed 's/\/[^\/]*$//'`"
  directory="`echo ${command_line_filename} | sed 's/\/[^\/]*$//'`"
  filename_texi="`basename ${command_line_filename}`"
  filename_texi="`basename ${command_line_filename}`"
  # Strip off the last extension part (probably .texinfo or .texi)
  # Strip off the last extension part (probably .texinfo or .texi)
  filename_noext="`echo ${filename_texi} | sed 's/\.[^.]*$//'`"
  filename_noext="`echo ${filename_texi} | sed 's/\.[^.]*$//'`"
  # Use same basename since we want to generate aux files with the same
  # Use same basename since we want to generate aux files with the same
  # basename as the manual.  Use extension .texi for the temp file so
  # basename as the manual.  Use extension .texi for the temp file so
  # that TeX will ignore it.  Thus, we must use a subdirectory.
  # that TeX will ignore it.  Thus, we must use a subdirectory.
  #
  #
  # Output the macro-expanded file to here.  The vastly abbreviated
  # Output the macro-expanded file to here.  The vastly abbreviated
  # temporary directory name is so we don't have collisions on 8.3 or
  # temporary directory name is so we don't have collisions on 8.3 or
  # 14-character filesystems.
  # 14-character filesystems.
  tmp_dir=${TMPDIR-/tmp}/txi2d.$$
  tmp_dir=${TMPDIR-/tmp}/txi2d.$$
  filename_tmp=$tmp_dir/$filename_noext.texi
  filename_tmp=$tmp_dir/$filename_noext.texi
  # Output the file with the user's extra commands to here.
  # Output the file with the user's extra commands to here.
  tmp_dir2=${tmp_dir}.2
  tmp_dir2=${tmp_dir}.2
  filename_tmp2=$tmp_dir2/$filename_noext.texi
  filename_tmp2=$tmp_dir2/$filename_noext.texi
  mkdir $tmp_dir $tmp_dir2
  mkdir $tmp_dir $tmp_dir2
  # Always remove the temporary directories.
  # Always remove the temporary directories.
  trap "rm -rf $tmp_dir $tmp_dir2" 1 2 15
  trap "rm -rf $tmp_dir $tmp_dir2" 1 2 15
  # If directory and file are the same, then it's probably because there's
  # If directory and file are the same, then it's probably because there's
  # no pathname component.  Set dirname to `.', the current directory.
  # no pathname component.  Set dirname to `.', the current directory.
  if test "z${directory}" = "z${command_line_filename}"; then
  if test "z${directory}" = "z${command_line_filename}"; then
    directory=.
    directory=.
  fi
  fi
  # Source file might @include additional texinfo sources.  Put `.' and
  # Source file might @include additional texinfo sources.  Put `.' and
  # directory where source file(s) reside in TEXINPUTS before anything
  # directory where source file(s) reside in TEXINPUTS before anything
  # else.  `.' goes first to ensure that any old .aux, .cps, etc. files in
  # else.  `.' goes first to ensure that any old .aux, .cps, etc. files in
  # ${directory} don't get used in preference to fresher files in `.'.
  # ${directory} don't get used in preference to fresher files in `.'.
  TEXINPUTS=".:${directory}:${TEXINPUTS_orig}"
  TEXINPUTS=".:${directory}:${TEXINPUTS_orig}"
  # Expand macro commands in the original source file using Makeinfo;
  # Expand macro commands in the original source file using Makeinfo;
  #   the macro syntax bfox implemented is impossible to implement in TeX.
  #   the macro syntax bfox implemented is impossible to implement in TeX.
  # Always use `end' footnote style, since the `separate' style
  # Always use `end' footnote style, since the `separate' style
  #   generates different output (arguably this is a bug in -E).
  #   generates different output (arguably this is a bug in -E).
  # Discard main info output, the user asked to run TeX, not makeinfo.
  # Discard main info output, the user asked to run TeX, not makeinfo.
  # Redirect output to /dev/null to throw away `Making info file...' msg.
  # Redirect output to /dev/null to throw away `Making info file...' msg.
  $verbose "Macro-expanding $command_line_filename to $filename_tmp ..."
  $verbose "Macro-expanding $command_line_filename to $filename_tmp ..."
  $makeinfo --footnote-style=end -E $filename_tmp -o /dev/null \
  $makeinfo --footnote-style=end -E $filename_tmp -o /dev/null \
    $command_line_filename >/dev/null
    $command_line_filename >/dev/null
  # But if there were no macros, or makeinfo failed for some reason,
  # But if there were no macros, or makeinfo failed for some reason,
  # just use the original file.  (It shouldn't make any difference, but
  # just use the original file.  (It shouldn't make any difference, but
  # let's be safe.)
  # let's be safe.)
  if test $? -ne 0 || cmp -s $filename_tmp $command_line_filename; then
  if test $? -ne 0 || cmp -s $filename_tmp $command_line_filename; then
    $verbose "Reverting to $command_line_filename ..."
    $verbose "Reverting to $command_line_filename ..."
    cp -p $command_line_filename $filename_tmp
    cp -p $command_line_filename $filename_tmp
  fi
  fi
  filename_input=$filename_tmp
  filename_input=$filename_tmp
  dirname_input=$tmp_dir
  dirname_input=$tmp_dir
  # Used most commonly for @finalout, @smallbook, etc.
  # Used most commonly for @finalout, @smallbook, etc.
  if test -n "$textra"; then
  if test -n "$textra"; then
    $verbose "Inserting extra commands: $textra."
    $verbose "Inserting extra commands: $textra."
    sed '/^@setfilename/a\
    sed '/^@setfilename/a\
'"$textra" $filename_input >$filename_tmp2
'"$textra" $filename_input >$filename_tmp2
   filename_input=$filename_tmp2
   filename_input=$filename_tmp2
   dirname_input=$tmp_dir2
   dirname_input=$tmp_dir2
  fi
  fi
  # If clean mode was specified, then move to the temporary directory.
  # If clean mode was specified, then move to the temporary directory.
  if test "$clean" = t; then
  if test "$clean" = t; then
    $verbose "cd $dirname_input"
    $verbose "cd $dirname_input"
    cd $dirname_input || exit 1
    cd $dirname_input || exit 1
    filename_input=`basename $filename_input`
    filename_input=`basename $filename_input`
  fi
  fi
  while true; do # will break out of loop below
  while true; do # will break out of loop below
    # "Unset" variables that might have values from previous iterations and
    # "Unset" variables that might have values from previous iterations and
    # which won't be completely reset later.
    # which won't be completely reset later.
    definite_index_files=
    definite_index_files=
    # Find all files having root filename with a two-letter extension,
    # Find all files having root filename with a two-letter extension,
    # determine whether they're really index files, and save them.  Foo.aux
    # determine whether they're really index files, and save them.  Foo.aux
    # is actually the cross-references file, but we need to keep track of
    # is actually the cross-references file, but we need to keep track of
    # that too.
    # that too.
    possible_index_files="`eval echo ${filename_noext}.?? ${filename_noext}.aux`"
    possible_index_files="`eval echo ${filename_noext}.?? ${filename_noext}.aux`"
    for this_file in ${possible_index_files}; do
    for this_file in ${possible_index_files}; do
      # If file is empty, forget it.
      # If file is empty, forget it.
      test -s "${this_file}" || continue
      test -s "${this_file}" || continue
      # Examine first character of file.  If it's not suitable to be an
      # Examine first character of file.  If it's not suitable to be an
      # index or xref file, don't process it.
      # index or xref file, don't process it.
      first_character="`sed -n '1s/^\(.\).*$/\1/p;q' ${this_file}`"
      first_character="`sed -n '1s/^\(.\).*$/\1/p;q' ${this_file}`"
      if test "x${first_character}" = "x\\" \
      if test "x${first_character}" = "x\\" \
         || test "x${first_character}" = "x'"; then
         || test "x${first_character}" = "x'"; then
        definite_index_files="${definite_index_files} ${this_file}"
        definite_index_files="${definite_index_files} ${this_file}"
      fi
      fi
    done
    done
    orig_index_files="${definite_index_files}"
    orig_index_files="${definite_index_files}"
    orig_index_files_sans_aux="`echo ${definite_index_files} \
    orig_index_files_sans_aux="`echo ${definite_index_files} \
                                 | sed 's/'${filename_noext}'\.aux//;
                                 | sed 's/'${filename_noext}'\.aux//;
                                        s/^[ ]*//;s/[ ]*$//;'`"
                                        s/^[ ]*//;s/[ ]*$//;'`"
    # Now save copies of original index files so we have some means of
    # Now save copies of original index files so we have some means of
    # comparison later.
    # comparison later.
    $verbose "Backing up current index files: $orig_index_files ..."
    $verbose "Backing up current index files: $orig_index_files ..."
    for index_file_to_save in ${orig_index_files}; do
    for index_file_to_save in ${orig_index_files}; do
      cp "${index_file_to_save}" "${index_file_to_save}${backup_extension}"
      cp "${index_file_to_save}" "${index_file_to_save}${backup_extension}"
    done
    done
    # Run texindex on current index files.  If they already exist, and
    # Run texindex on current index files.  If they already exist, and
    # after running TeX a first time the index files don't change, then
    # after running TeX a first time the index files don't change, then
    # there's no reason to run TeX again.  But we won't know that if the
    # there's no reason to run TeX again.  But we won't know that if the
    # index files are out of date or nonexistent.
    # index files are out of date or nonexistent.
    if test -n "${orig_index_files_sans_aux}"; then
    if test -n "${orig_index_files_sans_aux}"; then
      $verbose "Running $texindex $orig_index_files_sans_aux ..."
      $verbose "Running $texindex $orig_index_files_sans_aux ..."
      ${texindex} ${orig_index_files_sans_aux}
      ${texindex} ${orig_index_files_sans_aux}
    fi
    fi
    # Finally, run TeX.
    # Finally, run TeX.
    if test "$batch" = t; then
    if test "$batch" = t; then
      tex_mode='\nonstopmode'
      tex_mode='\nonstopmode'
    else
    else
      tex_mode=
      tex_mode=
    fi
    fi
    $verbose "Running $tex $filename_input ..."
    $verbose "Running $tex $filename_input ..."
    cmd="$tex $tex_mode \\input $filename_input"
    cmd="$tex $tex_mode \\input $filename_input"
    $cmd
    $cmd
    # Check if index files changed.
    # Check if index files changed.
    #
    #
    definite_index_files=
    definite_index_files=
    # Get list of new index files.
    # Get list of new index files.
    possible_index_files="`eval echo ${filename_noext}.?? ${filename_noext}.aux`"
    possible_index_files="`eval echo ${filename_noext}.?? ${filename_noext}.aux`"
    for this_file in ${possible_index_files}; do
    for this_file in ${possible_index_files}; do
       # If file is empty, forget it.
       # If file is empty, forget it.
       test -s "${this_file}" || continue
       test -s "${this_file}" || continue
       # Examine first character of file.  If it's not a backslash or
       # Examine first character of file.  If it's not a backslash or
       # single quote, then it's definitely not an index or xref file.
       # single quote, then it's definitely not an index or xref file.
       # (Will have to check for @ when we switch to Texinfo syntax in
       # (Will have to check for @ when we switch to Texinfo syntax in
       # all these files...)
       # all these files...)
       first_character="`sed -n '1s/^\(.\).*$/\1/p;q' ${this_file}`"
       first_character="`sed -n '1s/^\(.\).*$/\1/p;q' ${this_file}`"
       if test "x${first_character}" = "x\\" \
       if test "x${first_character}" = "x\\" \
          || test "x${first_character}" = "x'"; then
          || test "x${first_character}" = "x'"; then
         definite_index_files="${definite_index_files} ${this_file}"
         definite_index_files="${definite_index_files} ${this_file}"
       fi
       fi
    done
    done
    new_index_files="${definite_index_files}"
    new_index_files="${definite_index_files}"
    new_index_files_sans_aux="`echo ${definite_index_files} \
    new_index_files_sans_aux="`echo ${definite_index_files} \
                               | sed 's/'${filename_noext}'\.aux//;
                               | sed 's/'${filename_noext}'\.aux//;
                                      s/^[ ]*//;s/[ ]*$//;'`"
                                      s/^[ ]*//;s/[ ]*$//;'`"
    # If old and new list don't at least have the same file list, then one
    # If old and new list don't at least have the same file list, then one
    # file or another has definitely changed.
    # file or another has definitely changed.
    $verbose "Original index files =$orig_index_files"
    $verbose "Original index files =$orig_index_files"
    $verbose "New index files =$new_index_files"
    $verbose "New index files =$new_index_files"
    if test "z${orig_index_files}" != "z${new_index_files}"; then
    if test "z${orig_index_files}" != "z${new_index_files}"; then
      index_files_changed_p=t
      index_files_changed_p=t
    else
    else
      # File list is the same.  We must compare each file until we find a
      # File list is the same.  We must compare each file until we find a
      # difference.
      # difference.
      index_files_changed_p=
      index_files_changed_p=
      for this_file in ${new_index_files}; do
      for this_file in ${new_index_files}; do
        $verbose "Comparing index file $this_file ..."
        $verbose "Comparing index file $this_file ..."
        # cmp -s will return nonzero exit status if files differ.
        # cmp -s will return nonzero exit status if files differ.
        cmp -s "${this_file}" "${this_file}${backup_extension}"
        cmp -s "${this_file}" "${this_file}${backup_extension}"
        if test $? -ne 0; then
        if test $? -ne 0; then
          # We only need to keep comparing until we find *one* that
          # We only need to keep comparing until we find *one* that
          # differs, because we'll have to run texindex & tex no
          # differs, because we'll have to run texindex & tex no
          # matter what.
          # matter what.
          index_files_changed_p=t
          index_files_changed_p=t
          $verbose "Index file $this_file differed:"
          $verbose "Index file $this_file differed:"
          test $verbose = echo \
          test $verbose = echo \
          && diff -c "${this_file}${backup_extension}" "${this_file}"
          && diff -c "${this_file}${backup_extension}" "${this_file}"
          break
          break
        fi
        fi
      done
      done
    fi
    fi
    # If index files have changed since TeX has been run, or if the aux
    # If index files have changed since TeX has been run, or if the aux
    # file wasn't present originally, run texindex and TeX again.
    # file wasn't present originally, run texindex and TeX again.
    if test "${index_files_changed_p}"; then :; else
    if test "${index_files_changed_p}"; then :; else
      # Nothing changed.  We're done with TeX.
      # Nothing changed.  We're done with TeX.
      break
      break
    fi
    fi
  done
  done
  # If we were in clean mode, compilation was in a tmp directory.
  # If we were in clean mode, compilation was in a tmp directory.
  # Copy the DVI file into the directory where the compilation
  # Copy the DVI file into the directory where the compilation
  # has been done.  (The temp dir is about to get removed anyway.)
  # has been done.  (The temp dir is about to get removed anyway.)
  # We also return to the original directory so that
  # We also return to the original directory so that
  # - the next file is processed in correct conditions
  # - the next file is processed in correct conditions
  # - the temporary file can be removed
  # - the temporary file can be removed
  if test -n "$clean"; then
  if test -n "$clean"; then
    $verbose "Copying DVI file from `pwd` to $orig_pwd"
    $verbose "Copying DVI file from `pwd` to $orig_pwd"
    cp -p $filename_noext.dvi $orig_pwd
    cp -p $filename_noext.dvi $orig_pwd
    cd $orig_pwd || exit 1
    cd $orig_pwd || exit 1
  fi
  fi
  # Generate list of files to delete, then call rm once with the entire
  # Generate list of files to delete, then call rm once with the entire
  # list.  This is significantly faster than multiple executions of rm.
  # list.  This is significantly faster than multiple executions of rm.
  file_list=
  file_list=
  for file in ${orig_index_files}; do
  for file in ${orig_index_files}; do
    file_list="${file_list} ${file}${backup_extension}"
    file_list="${file_list} ${file}${backup_extension}"
  done
  done
  if test -n "${file_list}"; then
  if test -n "${file_list}"; then
    $verbose "Removing $file_list $tmp_dir $tmp_dir2 ..."
    $verbose "Removing $file_list $tmp_dir $tmp_dir2 ..."
    rm -f ${file_list}
    rm -f ${file_list}
    rm -rf $tmp_dir $tmp_dir2
    rm -rf $tmp_dir $tmp_dir2
  fi
  fi
done
done
$verbose "$0 done."
$verbose "$0 done."
true # exit successfully.
true # exit successfully.
 
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.