bug-texinfo
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

texi2dvi: set -e, use tar


From: Akim Demaille
Subject: texi2dvi: set -e, use tar
Date: Mon, 09 Jan 2006 10:51:14 +0100
User-agent: Gnus/5.110004 (No Gnus v0.4) Emacs/21.4 (gnu/linux)

Index: ChangeLog
from  Akim Demaille  <address@hidden>

        * util/texi2dvi: set -e.
        Stop using the idiom "test && action" in favor of "if test; then
        action; fi".
        (xref_files_save): Use tar instead of cp.
        (run_makeinfo): Fix a "local" use.

Index: doc/texi2dvi.1
===================================================================
RCS file: /cvsroot/texinfo/texinfo/doc/texi2dvi.1,v
retrieving revision 1.45
diff -u -u -r1.45 texi2dvi.1
--- doc/texi2dvi.1 22 Dec 2005 15:15:30 -0000 1.45
+++ doc/texi2dvi.1 9 Jan 2006 09:49:18 -0000
@@ -1,5 +1,5 @@
 .\" DO NOT MODIFY THIS FILE!  It was generated by help2man 1.36.
-.TH TEXI2DVI "1" "December 2005" "texi2dvi 1.68" "User Commands"
+.TH TEXI2DVI "1" "January 2006" "texi2dvi 1.70" "User Commands"
 .SH NAME
 texi2dvi \- convert Texinfo documents to DVI
 .SH SYNOPSIS
@@ -23,7 +23,7 @@
 .PP
 Makeinfo is used to perform Texinfo macro expansion before running TeX
 when needed.
-.SS "Operation modes:"
+.SS "General options:"
 .TP
 \fB\-b\fR, \fB\-\-batch\fR
 no interaction
@@ -33,10 +33,12 @@
 .TP
 \fB\-h\fR, \fB\-\-help\fR
 display this help and exit successfully
+.HP
+\fB\-\-no\-line\-error\fR do not pass \fB\-\-file\-line\-error\fR to TeX
 .TP
 \fB\-o\fR, \fB\-\-output\fR=\fIOFILE\fR
 leave output in OFILE (implies \fB\-\-clean\fR);
-Only one input FILE may be specified in this case
+only one input FILE may be specified in this case
 .TP
 \fB\-q\fR, \fB\-\-quiet\fR
 no output unless errors (implies \fB\-\-batch\fR)
Index: doc/version.texi
===================================================================
RCS file: /cvsroot/texinfo/texinfo/doc/version.texi,v
retrieving revision 1.34
diff -u -u -r1.34 version.texi
--- doc/version.texi 22 Dec 2005 15:15:30 -0000 1.34
+++ doc/version.texi 9 Jan 2006 09:49:18 -0000
@@ -1,4 +1,4 @@
address@hidden UPDATED 22 December 2005
address@hidden UPDATED-MONTH December 2005
address@hidden UPDATED 2 January 2006
address@hidden UPDATED-MONTH January 2006
 @set EDITION 4.8
 @set VERSION 4.8
Index: util/texi2dvi
===================================================================
RCS file: /cvsroot/texinfo/texinfo/util/texi2dvi,v
retrieving revision 1.70
diff -u -u -r1.70 texi2dvi
--- util/texi2dvi 25 Dec 2005 19:13:56 -0000 1.70
+++ util/texi2dvi 9 Jan 2006 09:49:18 -0000
@@ -3,7 +3,7 @@
 # $Id: texi2dvi,v 1.70 2005/12/25 19:13:56 karl Exp $
 #
 # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2001,
-# 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
+# 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
 #
 # 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
@@ -31,6 +31,9 @@
   && { RUNNING_KSH=true; export RUNNING_KSH; exec /bin/ksh $0 ${1+"$@"}; }
 unset RUNNING_KSH
 
+# No failure shall remain unpunished.
+set -e
+
 # This string is expanded by rcs automatically when this file is checked out.
 rcs_revision='$Revision: 1.70 $'
 rcs_version=`set - $rcs_revision; echo $2`
@@ -275,7 +278,9 @@
 # Report some verbose information.
 verbose ()
 {
-  $verb && echo >&2 "$0: $@"
+  if $verb; then
+    echo >&2 "$0: $@"
+  fi
 }
 
 # fatal EXIT_STATUS LINE1 LINE2...
@@ -409,7 +414,9 @@
         res=$res$path_sep
         ;;
       *)
-        test -d $dir && res=$res$path_sep`absolute "$dir"`
+        if test -d $dir; then
+         res=$res$path_sep`absolute "$dir"`
+       fi
         ;;
     esac
   done
@@ -521,7 +528,9 @@
     case $language in
       (texinfo)
         # texindex: texinfo.cp -> texinfo.cps
-       index_file_p $file && echo ${file}s
+       if index_file_p $file; then
+         echo ${file}s
+       fi
        ;;
       (latex)
        # bibtex: *.aux -> *.bbl and *.blg.
@@ -551,7 +560,10 @@
   xref_files_orig=`generated_files_get "$in_noext" xref_file_p`
   if test -n "$xref_files_orig"; then
     verbose "Backing up xref files: $xref_files_orig"
-    cp $xref_files_orig "$work_bak"
+    # The following line improves `cp $xref_files_orig "$work_bak"'
+    # by preserving the directory parts.  Think of
+    # cp chap1/main.aux chap2/main.aux $work_bak.
+    tar cf - $xref_files_orig | (cd "$work_bak" && tar xf -)
   fi
 }
 
@@ -566,16 +578,18 @@
   # subdirs, since texi2dvi does not try to compare xref files in
   # subdirs.  Performing xref files test is still good since LaTeX
   # does not report changes in xref files.
-  grep "Rerun to get" "$in_noext.log" >&6 2>&1 &&
+  if grep "Rerun to get" "$in_noext.log" >&6 2>&1; then
     return 0
+  fi
 
   # If old and new lists don't at least have the same file list,
   # then one file or another has definitely changed.
   xref_files_new=`generated_files_get "$in_noext" xref_file_p`
   verbose "Original xref files = $xref_files_orig"
   verbose "New xref files      = $xref_files_new"
-  test "x$xref_files_orig" != "x$xref_files_new" &&
+  if test "x$xref_files_orig" != "x$xref_files_new"; then
     return 0
+  fi
 
   # Compare each file until we find a difference.
   for this_file in $xref_files_new; do
@@ -583,7 +597,9 @@
     # cmp -s returns nonzero exit status if files differ.
     if cmp -s "$this_file" "$work_bak/$this_file"; then :; else
       verbose "xref file `echo $this_file | sed 's|\./||g'` differed ..."
-      $debug && diff -u "$work_bak/$this_file" "$this_file"
+      if $debug; then
+       diff -u "$work_bak/$this_file" "$this_file"
+      fi
       return 0
     fi
   done
@@ -645,8 +661,8 @@
   if $no_line_error; then :; else
     # The mk program and perhaps others want to parse TeX's
     # original error messages.
-    $line_error && case $tex_help in
-      *file-line-error*) cmd="$cmd --file-line-error";;
+    case $line_error:$tex_help in
+      true:*file-line-error*) cmd="$cmd --file-line-error";;
     esac
   fi
 
@@ -727,8 +743,8 @@
          (grep '^\\bibstyle[{]' "$f"   \
           && grep '^\\bibdata[{]' "$f" \
          ## The following line is suspicious: fails when there
-         ## are citations in sub aux files.  We need to be
-         ## smarter in this case.
+          ## are citations in sub aux files.  We need to be
+          ## smarter in this case.
           ## && grep '^\\citation[{]' "$f"
          ) >&6 2>&1; then
         verbose "Running $bibtex $f ..."
@@ -888,7 +904,9 @@
         makeinfo=${MAKEINFO:-makeinfo}
       fi
       # As long as we had to run TeX, offer the user this convenience:
-      test "$txiformat" = Texinfo && escape=@
+      if test "$txiformat" = Texinfo; then
+       escape=@
+      fi
     fi
 
     if test -n "$makeinfo"; then
@@ -897,7 +915,7 @@
       work_src=$workdir/src
       ensure_dir "$work_src"
       in_src=$work_src/$in_base
-      local $miincludes=`list_prefix includes -I`
+      local miincludes=`list_prefix includes -I`
       verbose "Macro-expanding $command_line_filename to $in_src ..."
       sed "$comment_iftex" "$command_line_filename" \
         | $makeinfo --footnote-style=end -I "$in_dir" $miincludes \
@@ -1308,7 +1326,9 @@
   in_dir=`func_dirname "$command_line_filename"`
   in_dir_abs=`absolute "$in_dir"`
   # In a clean build, we `cd', so get an absolute file name.
-  $tidy && in_dir=$in_dir_abs
+  if $tidy; then
+    in_dir=$in_dir_abs
+  fi
 
   # Strip directory part but leave extension.
   in_base=`basename "$command_line_filename"`
@@ -1357,8 +1377,9 @@
              sed 's,/,!,g'`
   esac
   # Remove it at exit if clean mode.
-  $clean &&
+  if $clean; then
     trap "mostly_clean" 0 1 2 15
+  fi
 
   ensure_dir "$build_dir" "$t2ddir"
 
@@ -1389,7 +1410,9 @@
       # Compile the document.
       compile
       # Remove temporary files.
-      $clean && mostly_clean
+      if $clean; then
+       mostly_clean
+      fi
       ;;
 
     mostly-clean)





reply via email to

[Prev in Thread] Current Thread [Next in Thread]