help-texinfo
[Top][All Lists]
Advanced

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

Re: [help-texinfo] texi2dvi: Preserve foo.log


From: Akim Demaille
Subject: Re: [help-texinfo] texi2dvi: Preserve foo.log
Date: Fri, 24 Jun 2005 16:55:22 +0200
User-agent: Gnus/5.1007 (Gnus v5.10.7) Emacs/21.4 (gnu/linux)

>>> "Karl" == Karl Berry <address@hidden> writes:

 > Thanks, I installed it ...

I'm afraid my patch was incomplete :(  It fails to compile Texinfo
properly, I'm sorry about that.

Index: ChangeLog
from  Akim Demaille  <address@hidden>

        * util/texi2dvi: Move the computation of $makeinfo to...
        (run_makeinfo): here.

Index: util/texi2dvi
===================================================================
RCS file: /cvsroot/texinfo/texinfo/util/texi2dvi,v
retrieving revision 1.56
diff -u -u -r1.56 texi2dvi
--- util/texi2dvi 24 Jun 2005 13:01:37 -0000 1.56
+++ util/texi2dvi 24 Jun 2005 14:54:01 -0000
@@ -529,26 +531,66 @@
 # main info output, the user asked to run TeX, not makeinfo.
 run_makeinfo ()
 {
-  if test -n "$makeinfo"; then
-    # filename_src: the file with macros expanded.
-    # Use the same basename to generate the same aux file names.
-    work_src=$workdir/src
-    ensure_dir "$work_src"
-    filename_src=$work_src/$filename_noext.$ext
-
-    verbose "Macro-expanding $command_line_filename to $filename_src ..."
-    sed "$comment_iftex" "$command_line_filename" \
-      | $makeinfo --footnote-style=end -I "$filename_dir" $miincludes \
-        -o /dev/null --macro-expand=- \
-      | sed "$uncomment_iftex" >"$filename_src"
-    # Continue only if everything succeeded.
-    if test $? -ne 0 \
-       || test ! -r "$filename_src"; then
-      verbose "Expansion failed, ignored...";
+  case $language in
+  texinfo)
+    # Unless required by the user, makeinfo expansion is wanted only
+    # if texinfo.tex is too old.
+    if test "$expand" = t; then
+      makeinfo=${MAKEINFO:-makeinfo}
     else
-      filename_input=$filename_src
+      # Check if texinfo.tex performs macro expansion by looking for
+      # its version.  The version is a date of the form YEAR-MO-DA.
+      # We don't need to use [0-9] to match the digits since anyway
+      # the comparison with $txiprereq, a number, will fail with non
+      # digits.
+      # Run in a temporary directory to avoid leaving files.
+      version_test_dir=$t2ddir/version_test
+      ensure_dir $version_test_dir
+      (
+         cd $version_test_dir
+         echo '\input texinfo.tex @bye' >txiversion.tex
+         # Be sure that if tex wants to fail, it is not interactive:
+         # close stdin.
+         tex txiversion.tex </dev/null >txiversion.out 2>txiversion.err
+      )
+      if test $? != 0; then
+        cat $version_test_dir/txiversion.out
+        cat $version_test_dir/txiversion.err >&2
+        fatal 1 "texinfo.tex appears to be broken, quitting."
+      fi
+      eval `sed -n 's/^.*\[\(.*\)version 
\(....\)-\(..\)-\(..\).*$/txiformat=\1 txiversion="\2\3\4"/p' 
$version_test_dir/txiversion.out`
+      verbose "texinfo.tex preloaded as \`$txiformat', version is 
\`$txiversion' ..."
+      if test "$txiprereq" -le "$txiversion" >&6 2>&1; then
+        makeinfo=
+      else
+        makeinfo=${MAKEINFO:-makeinfo}
+      fi
+      # As long as we had to run TeX, offer the user this convenience:
+      test "$txiformat" = Texinfo && escape=@
     fi
-  fi
+
+    if test -n "$makeinfo"; then
+      # filename_src: the file with macros expanded.
+      # Use the same basename to generate the same aux file names.
+      work_src=$workdir/src
+      ensure_dir "$work_src"
+      filename_src=$work_src/$filename_noext.$ext
+
+      verbose "Macro-expanding $command_line_filename to $filename_src ..."
+      sed "$comment_iftex" "$command_line_filename" \
+        | $makeinfo --footnote-style=end -I "$filename_dir" $miincludes \
+          -o /dev/null --macro-expand=- \
+        | sed "$uncomment_iftex" >"$filename_src"
+      # Continue only if everything succeeded.
+      if test $? -ne 0 \
+         || test ! -r "$filename_src"; then
+        verbose "Expansion failed, ignored...";
+      else
+        filename_input=$filename_src
+      fi
+    fi
+    ;;
+  esac
 }
 
 # insert_commands ()
@@ -865,7 +907,6 @@
       # Assume a LaTeX file.  LaTeX needs bibtex and uses latex for
       # compilation.  No makeinfo.
       language=latex
-      makeinfo= # no point in running makeinfo on latex source.
       textra_cmd=1i
       ;;
 
@@ -873,41 +914,6 @@
       # Assume a Texinfo file.
       language=texinfo
       textra_cmd='/address@hidden/a'
-      # Unless required by the user, makeinfo expansion is wanted only
-      # if texinfo.tex is too old.
-      if test "$expand" = t; then
-        makeinfo=${MAKEINFO:-makeinfo}
-      else
-        # Check if texinfo.tex performs macro expansion by looking for
-        # its version.  The version is a date of the form YEAR-MO-DA.
-        # We don't need to use [0-9] to match the digits since anyway
-        # the comparison with $txiprereq, a number, will fail with non
-        # digits.
-        # Run in a temporary directory to avoid leaving files.
-       version_test_dir=$t2ddir/version_test
-       ensure_dir $version_test_dir
-       (
-           cd $version_test_dir
-          echo '\input texinfo.tex @bye' >txiversion.tex
-          # Be sure that if tex wants to fail, it is not interactive:
-          # close stdin.
-           $tex txiversion.tex </dev/null >txiversion.out 2>txiversion.err
-       )
-       if test $? != 0; then
-         cat $version_test_dir/txiversion.out
-         cat $version_test_dir/txiversion.err >&2
-         fatal 1 "texinfo.tex appears to be broken, quitting."
-        fi
-       eval `sed -n 's/^.*\[\(.*\)version 
\(....\)-\(..\)-\(..\).*$/txiformat=\1 txiversion="\2\3\4"/p' 
$version_test_dir/txiversion.out`
-        verbose "texinfo.tex preloaded as \`$txiformat', version is 
\`$txiversion' ..."
-        if test "$txiprereq" -le "$txiversion" >&6 2>&1; then
-          makeinfo=
-        else
-          makeinfo=${MAKEINFO:-makeinfo}
-        fi
-        # As long as we had to run TeX, offer the user this convenience:
-        test "$txiformat" = Texinfo && escape=@
-      fi
       ;;
   esac
 





reply via email to

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