bug-texinfo
[Top][All Lists]
Advanced

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

texi2dvi: Fix -t


From: Akim Demaille
Subject: texi2dvi: Fix -t
Date: Fri, 04 Jul 2008 10:17:02 +0200
User-agent: Gnus/5.110006 (No Gnus v0.6) Emacs/22.0.95 (gnu/linux)

In the patch below, I have not well understood the point of the "rm"
in:

       if test ! -f "$_run_tex_file_name"; then
        verbose ln -s "$in_input"
        rm -f "$_run_tex_file_name"
        ln -s "$_run_tex_file_name"
       fi

I have left it, because there might happen something I don't
understand, but IMO, since we are in $tidy mode, what lies there is
only what we create with ln, so the test -f should always fire because
there is nothing (not because there is something which is not a file).

Alternative, no test, but always rm + ln would do it.

Index: ChangeLog
from  Akim Demaille  <address@hidden>

        texi2dvi: Fix -t.
        * util/texi2dvi (run_tex): The code that installs a symlink was
        installing the symlink directly to itself, instead of towards the
        actual source file.  I wonder how it worked.  As a result -t was
        not taken into account.
        Fix the symlink creation.
        * util/texi2dvi.test (one_run): Test -t support.

Index: util/texi2dvi
===================================================================
RCS file: /cvsroot/texinfo/texinfo/util/texi2dvi,v
retrieving revision 1.130
diff -u -u -r1.130 texi2dvi
--- util/texi2dvi 2 Jul 2008 23:21:15 -0000 1.130
+++ util/texi2dvi 4 Jul 2008 08:13:40 -0000
@@ -940,9 +940,9 @@
     true:*["$space$tab$newline\"#\$%\\^_{}"]*)
       _run_tex_file_name=`basename "$in_input"`
       if test ! -f "$_run_tex_file_name"; then
-       verbose ln -s "$in_input"
-       rm -f "$_run_tex_file_name"
-       ln -s "$_run_tex_file_name"
+       # It might not be a file, clear it.
+       run rm -f "$_run_tex_file_name"
+       run ln -s "$in_input"
       fi
       cmd="$cmd '$_run_tex_file_name'"
       ;;
Index: util/texi2dvi.test
===================================================================
RCS file: /cvsroot/texinfo/texinfo/util/texi2dvi.test,v
retrieving revision 1.16
diff -u -u -r1.16 texi2dvi.test
--- util/texi2dvi.test 20 Sep 2007 17:21:59 -0000 1.16
+++ util/texi2dvi.test 4 Jul 2008 08:13:40 -0000
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2003, 2005, 2006, 2007 Free Software Foundation, Inc.
+# Copyright (C) 2003, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
 #
 # This file is part of GNU Texinfo.
 #
@@ -28,8 +28,13 @@
 one_run ()
 {
   # Testing the local build mode.
-  create_input_texi </dev/null
-  TEXI2DVI_pass $(optionset_get 1 "$@") input.texi
+  # Use @foo to check that -t works properly.
+  echo "@foo" | create_input_texi
+  TEXI2DVI_pass $(optionset_get 1 "$@") \
+     -t '@macro foo' \
+     -t 'Foo'        \
+     -t '@end macro' \
+     input.texi
   # There should only be the expected FILES and the input file.
   assert_and_remove_files $(optionset_get 2 "$@") input.texi
 }




reply via email to

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