bug-texinfo
[Top][All Lists]
Advanced

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

FYI: texi2dvi -I DIRS


From: Akim Demaille
Subject: FYI: texi2dvi -I DIRS
Date: Mon, 16 Jun 2008 12:20:07 +0200
User-agent: Gnus/5.110006 (No Gnus v0.6) Emacs/22.0.95 (gnu/linux)

I have installed the following patch.

Index: ChangeLog
from  Akim Demaille  <address@hidden>

        Support -I dir1:dir2, as per the documentation.
        Reported by Vincent Ordy.
        * bin/texi2dvi: (list_concat_dirs): New.
        Currently mostly a copy of absolute_filenames, but the latter
        is scheduled for removal.
        Use list_concat_dirs for -I support.
        (--I*): Remove, not documented anywhere, and too accepting.

Index: doc/version-stnd.texi
===================================================================
RCS file: /cvsroot/texinfo/texinfo/doc/version-stnd.texi,v
retrieving revision 1.36
diff -u -u -r1.36 version-stnd.texi
--- doc/version-stnd.texi 12 Jun 2008 16:12:06 -0000 1.36
+++ doc/version-stnd.texi 16 Jun 2008 10:19:32 -0000
@@ -1,4 +1,4 @@
address@hidden UPDATED 22 May 2008
address@hidden UPDATED-MONTH May 2008
address@hidden UPDATED 16 June 2008
address@hidden UPDATED-MONTH June 2008
 @set EDITION 4.12.91
 @set VERSION 4.12.91
Index: doc/version.texi
===================================================================
RCS file: /cvsroot/texinfo/texinfo/doc/version.texi,v
retrieving revision 1.64
diff -u -u -r1.64 version.texi
--- doc/version.texi 12 Jun 2008 16:12:06 -0000 1.64
+++ doc/version.texi 16 Jun 2008 10:19:32 -0000
@@ -1,4 +1,4 @@
address@hidden UPDATED 22 May 2008
address@hidden UPDATED-MONTH May 2008
address@hidden UPDATED 16 June 2008
address@hidden UPDATED-MONTH June 2008
 @set EDITION 4.12.91
 @set VERSION 4.12.91
Index: util/texi2dvi
===================================================================
RCS file: /cvsroot/texinfo/texinfo/util/texi2dvi,v
retrieving revision 1.124
diff -u -u -r1.124 texi2dvi
--- util/texi2dvi 3 Jun 2008 23:02:46 -0000 1.124
+++ util/texi2dvi 16 Jun 2008 10:19:32 -0000
@@ -388,6 +388,42 @@
   eval $la_l=\""$@"\"
 }
 
+
+# list_concat_dirs LIST-NAME DIR-LIST
+# -----------------------------------
+# Append to LIST-NAME all the components (included empty) from
+# the $path_sep separated list DIR-LIST.  Make the paths absolute.
+list_concat_dirs ()
+{
+  local lcd_list="$1"
+  # Empty path components are meaningful to tex.  We rewrite them as
+  # `EMPTY' so they don't get lost when we split on $path_sep.
+  # Hopefully no one will have an actual directory named EMPTY.
+  local replace_EMPTY="-e 's/^$path_sep/EMPTY$path_sep/g' \
+                       -e 's/$path_sep\$/${path_sep}EMPTY/g' \
+                       -e 's/$path_sep$path_sep/${path_sep}EMPTY:/g'"
+  save_IFS=$IFS
+  IFS=$path_sep
+  set x `echo "$2" | eval sed $replace_EMPTY`; shift
+  IFS=$save_IFS
+  local dir
+  for dir
+  do
+    case $dir in
+      EMPTY)
+       list_append $lcd_list ""
+       ;;
+      *)
+       if test -d $dir; then
+          dir=`absolute "$dir"`
+         list_append $lcd_list "$dir"
+       fi
+       ;;
+    esac
+  done
+}
+
+
 # list_prefix LIST-NAME SEP -> STRING
 # -----------------------------------
 # Return a string that is composed of the LIST-NAME with each item
@@ -488,16 +524,15 @@
 # ---------------------------------------
 # Convert relative paths to absolute paths, so we can run in another
 # directory (e.g., in tidy build mode, or during the macro-support
-# detection).
-#
-# Empty path components are meaningful to tex.  We rewrite them
-# as `EMPTY' so they don't get lost when we split on $path_sep.
-# Hopefully no one will have an actual directory named EMPTY.
+# detection).  Prepend ".".
 absolute_filenames ()
 {
+  # Empty path components are meaningful to tex.  We rewrite them as
+  # `EMPTY' so they don't get lost when we split on $path_sep.
+  # Hopefully no one will have an actual directory named EMPTY.
   local replace_empty="-e 's/^$path_sep/EMPTY$path_sep/g' \
-                      -e 's/$path_sep\$/${path_sep}EMPTY/g' \
-                      -e 's/$path_sep$path_sep/${path_sep}EMPTY:/g'"
+                       -e 's/$path_sep\$/${path_sep}EMPTY/g' \
+                       -e 's/$path_sep$path_sep/${path_sep}EMPTY:/g'"
   local res
   res=`echo "$1" | eval sed $replace_empty`
   save_IFS=$IFS
@@ -703,7 +738,7 @@
     esac
   done |
   # Filter existing files matching the criterion.
-  # 
+  #
   # With an input file name containing a space, this produces a
   # "command not found" message (and filtering is ineffective).
   # The situation with a newline is presumably even worse.
@@ -853,19 +888,19 @@
   # we'd like to handle arbitrary input file names, such as a~b.tex.
   # This isn't a general way to do it :), though it does work, kind of.
   # cmd="$cmd '${escape}catcode126=12 \input '"
-  
+
   # TeX's \input does not (easily or reliably) support whitespace
   # characters or other special characters in file names.  Our intensive
   # use of absolute file names makes this worse: the enclosing directory
   # names may include white spaces.  Improve the situation using a
   # symbolic link to the filename in the current directory, in tidy mode
   # only.  Do not alter in_input.
-  # 
+  #
   # The filename is almost always tokenized using plain TeX conventions
   # (the exception would be if the user made a texinfo.fmt file).  Not
   # all the plain TeX special characters cause trouble, but there's no
   # harm in making the link.
-  # 
+  #
   case $tidy:`func_dirname "$in_input"` in
     true:*["$space$tab$newline\"#\$%\\^_{}"]*)
       _run_tex_file_name=`basename "$in_input"`
@@ -1333,7 +1368,7 @@
     eval val="\$common\$${var}_orig"
     # Convert relative paths to absolute paths, so we can run in another
     # directory (e.g., in clean build mode, or during the macro-support
-    # detection).
+    # detection). ".:" is added here.
     val=`absolute_filenames "$val"`
     eval $var="\"$val\""
     export $var
@@ -1438,12 +1473,7 @@
     -e | -E | --expand) expand=t;;
     -h | --help) echo "$usage"; exit 0;;
         --html) out_lang=html;;
-    -I | --I*)
-      shift
-      # Use absolute dir names in the includes.
-      val=`absolute "$1"`
-      list_append includes "$val"
-      ;;
+    -I)   shift; list_concat_dirs includes "$1";;
     --info) out_lang=info;;
     -l | --lang | --language) shift; set_language=$1;;
     --mostly-clean) action=mostly-clean;;




reply via email to

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