texinfo-commits
[Top][All Lists]
Advanced

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

texinfo update (Mon Jun 19 05:52:01 EDT 2006)


From: Karl Berry
Subject: texinfo update (Mon Jun 19 05:52:01 EDT 2006)
Date: Mon, 19 Jun 2006 05:52:03 -0400

Index: ChangeLog
===================================================================
RCS file: /sources/texinfo/texinfo/ChangeLog,v
retrieving revision 1.608
retrieving revision 1.609
diff -u -r1.608 -r1.609
--- ChangeLog   18 Jun 2006 23:39:43 -0000      1.608
+++ ChangeLog   19 Jun 2006 09:35:01 -0000      1.609
@@ -1,3 +1,18 @@
+2006-06-19  Akim Demaille  <address@hidden>
+
+       Support dvips and dvipdf for sake of pstricks, and to
+       spare the use tweaking TEXINPUTS.
+       * util/defs.in (optionset_get, assert_and_remove_files): New.
+       * util/texi2dvi (out_lang_tex, out_lang_ext): New.
+       Use them.
+       ($language): Rename as...
+       ($in_lang): this for consistency.
+       Support --dvipdf and --ps.
+       Not documented yet.
+       * util/dvipdf.test: New.
+       * util/Makefile.am (TESTS): Adjust.
+       * util/texi2dvi.tests (one_run): New.
+
 2006-06-18  Karl Berry  <address@hidden>
 
        * gnulib: new subdirectory, managed by gnulib-tool.
Index: util/Makefile.am
===================================================================
RCS file: /sources/texinfo/texinfo/util/Makefile.am,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -r1.22 -r1.23
--- util/Makefile.am    18 Jun 2006 23:39:43 -0000      1.22
+++ util/Makefile.am    19 Jun 2006 09:35:01 -0000      1.23
@@ -1,4 +1,4 @@
-# $Id: Makefile.am,v 1.22 2006/06/18 23:39:43 karl Exp $
+# $Id: Makefile.am,v 1.23 2006/06/19 09:35:01 akim Exp $
 # Makefile.am for texinfo/util.
 # Run automake in .. to produce Makefile.in from this.
 #
@@ -59,6 +59,7 @@
 
 TESTS =        \
 bibtex.test \
+dvipdf.test \
 latex2html.test \
 local.test \
 texi2dvi.test
Index: util/defs.in
===================================================================
RCS file: /sources/texinfo/texinfo/util/defs.in,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- util/defs.in        30 May 2006 15:02:33 -0000      1.4
+++ util/defs.in        19 Jun 2006 09:35:01 -0000      1.5
@@ -226,6 +226,30 @@
 }
 
 
+# optionset_get N OPTIONSET<1> -- OPTIONSET<2> -- ...
+# ---------------------------------------------------
+# Return OPTIONSET<N>
+optionset_get ()
+{
+  n=$1
+  shift
+  # Find the optionset.
+  while test $n != 1; do
+    case $1 in
+      --) n=$(expr $n - 1);;
+    esac
+    shift
+  done
+  # Return the optionset.
+  while true; do
+    case $#:$1 in
+      0:) break;;
+    *:--) shift; break;;
+       *) echo "$1"; shift;;
+    esac
+  done
+}
+
 # list_files ()
 # -------------
 # Return the sorted list of files in this directory, except the "invisible" 
ones.
@@ -254,6 +278,17 @@
   diff -u ls.expected ls.value
 }
 
+
+# assert_and_remove_files (EXPECTED-FILES)
+# ----------------------------------------
+# Only those files are valid in the current directory.  Remove them
+# afterwards.
+assert_and_remove_files ()
+{
+  assert_files "$@"
+  rm -rf "$@"
+}
+
 # Turn on shell traces when VERBOSE is set.
 if test -n "$VERBOSE"; then
   set -x
Index: util/texi2dvi
===================================================================
RCS file: /sources/texinfo/texinfo/util/texi2dvi,v
retrieving revision 1.83
retrieving revision 1.84
diff -u -r1.83 -r1.84
--- util/texi2dvi       3 Jun 2006 20:31:29 -0000       1.83
+++ util/texi2dvi       19 Jun 2006 09:35:01 -0000      1.84
@@ -1,6 +1,6 @@
 #! /bin/sh
 # texi2dvi --- produce DVI (or PDF) files from Texinfo (or (La)TeX) sources.
-# $Id: texi2dvi,v 1.83 2006/06/03 20:31:29 karl Exp $
+# $Id: texi2dvi,v 1.84 2006/06/19 09:35:01 akim Exp $
 #
 # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2001,
 # 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
@@ -35,7 +35,7 @@
 set -e
 
 # This string is expanded by rcs automatically when this file is checked out.
-rcs_revision='$Revision: 1.83 $'
+rcs_revision='$Revision: 1.84 $'
 rcs_version=`set - $rcs_revision; echo $2`
 program=`echo $0 | sed -e 's!.*/!!'`
 version="texi2dvi (GNU Texinfo 4.8) $rcs_version
@@ -395,6 +395,38 @@
   eval $ld_l=\"address@hidden"
 }
 
+
+## ------------------------------ ##
+## Language auxiliary functions.  ##
+## ------------------------------ ##
+
+# out_lang_tex
+# ------------
+# Return the tex output language (DVI or PDF) for $OUT_LANG.
+out_lang_tex ()
+{
+  case $out_lang in
+    dvi | ps | dvipdf ) echo dvi;;
+    pdf ) echo $out_lang;;
+    html | info | text ) echo $out_lang;;
+    *)    fatal "$0: invalid out_lang: $1";;
+  esac
+}
+
+
+# out_lang_ext
+# ------------
+# Return the extension for $OUT_LANG.
+out_lang_ext ()
+{
+  case $out_lang in
+    dvipdf ) echo pdf;;
+    dvi | html | info | pdf | ps | text ) echo $out_lang;;
+    *)    fatal "$0: invalid out_lang: $1";;
+  esac
+}
+
+
 ## ------------------------- ##
 ## TeX auxiliary functions.  ##
 ## ------------------------- ##
@@ -568,7 +600,7 @@
   # Depending on these files, infer outputs from other tools.
   while read file; do
     echo $file
-    case $language in
+    case $in_lang in
       (texinfo)
         # texindex: texinfo.cp -> texinfo.cps
        if index_file_p $file; then
@@ -657,12 +689,14 @@
 ## Running the TeX suite.  ##
 ## ----------------------- ##
 
+
+
 # run_tex ()
 # ----------
 # Run TeX as "$tex $in_input", taking care of errors and logs.
 run_tex ()
 {
-  case $language:$out_lang in
+  case $in_lang:$(out_lang_tex) in
     latex:dvi)   tex=${LATEX:-latex};;
     latex:pdf)   tex=${PDFLATEX:-pdflatex};;
     texinfo:dvi)
@@ -674,12 +708,12 @@
         esac;;
     texinfo:pdf) tex=$PDFTEX;;
 
-    *) fatal 1 "$out_lang not supported for $language";;
+    *) fatal 1 "$0: $out_lang not supported for $in_lang";;
   esac
 
   # Beware of aux files in subdirectories that require the
   # subdirectory to exist.
-  case $language:$tidy in
+  case $in_lang:$tidy in
     latex:true)
        sed -n 's|^[ ]*\\include{\(.*\)/.*}.*|\1|p' "$in_input" |
        sort -u |
@@ -745,7 +779,9 @@
 
   echo "$0: Running $cmd ..."
   if eval "$cmd" >&5; then
-    move_to_dest "$in_noext.$out_lang"
+    case $out_lang in
+      dvi | pdf ) move_to_dest "$in_noext.$out_lang";;
+    esac
   else
     fatal 1 "$tex exited with bad status, quitting."
   fi
@@ -769,7 +805,7 @@
 # easier, though we take the risk to match false messages.
 run_bibtex ()
 {
-  case $language in
+  case $in_lang in
     latex)   bibtex=${BIBTEX:-bibtex};;
     texinfo) return;;
   esac
@@ -799,7 +835,7 @@
 # that if the index files are out of date or nonexistent.
 run_index ()
 {
-  case $language in
+  case $in_lang in
     latex)   texindex=${MAKEINDEX:-makeindex};;
     texinfo) texindex=${TEXINDEX:-texindex};;
   esac
@@ -816,7 +852,7 @@
 # ---------------
 run_thumbpdf ()
 {
-  if test $out_lang = pdf \
+  if test $(out_lang_tex) = pdf \
      && test -r "$in_noext.log" \
      && grep 'thumbpdf\.sty'  "$in_noext.log" >&6 2>&1; \
   then
@@ -859,6 +895,19 @@
   # If we were using thumbpdf and producing PDF, then run thumbpdf
   # and TeX one last time.
   run_thumbpdf
+
+  # Install the result if we didn't already (i.e., if the output is
+  # dvipdf or ps).
+  case $out_lang in
+    dvipdf)
+      dvipdf "$in_noext.$(out_lang_tex)" "$in_noext.$(out_lang_ext)"
+      move_to_dest "$in_noext.$(out_lang_ext)"
+      ;;
+    ps)
+      dvips -o "$in_noext.$(out_lang_ext)" "$in_noext.$(out_lang_tex)"
+      move_to_dest "$in_noext.$(out_lang_ext)"
+      ;;
+  esac
 }
 
 ## -------------------------------- ##
@@ -908,7 +957,7 @@
 # main info output, the user asked to run TeX, not makeinfo.
 run_makeinfo ()
 {
-  case $language in
+  case $in_lang in
   texinfo)
     # Unless required by the user, makeinfo expansion is wanted only
     # if texinfo.tex is too old.
@@ -982,10 +1031,10 @@
 insert_commands ()
 {
   local textra_cmd
-  case $language in
+  case $in_lang in
     latex)   textra_cmd=1i;;
     texinfo) textra_cmd='/address@hidden/a';;
-    *)       echo "$0: internal error, unknown language: $language" >&2;
+    *)       echo "$0: internal error, unknown language: $in_lang" >&2;
   esac
 
   if test -n "$textra"; then
@@ -1009,7 +1058,7 @@
   local from
   local to
 
-  if test $language = texinfo; then
+  if test $in_lang = texinfo; then
     pgm='s/^ address@hidden  *\([^ ][^ ]*\) *$/\1/
        t found
        d
@@ -1103,13 +1152,13 @@
     cd "$work_build" || exit 1
   fi
 
-  case $language:$out_lang in
+  case $in_lang:$(out_lang_tex) in
     *:dvi|*:pdf)
        run_tex_suite;;
     latex:html|latex:text|latex:info)
        run_hevea $out_lang;;
     *)
-       fatal "invalid input/output combination: $language/$out_lang";;
+       fatal "invalid input/output combination: $in_lang/$out_lang";;
   esac
 
   cd_orig
@@ -1233,6 +1282,7 @@
     -c | --clean) build_mode=clean;;
     -D | --debug) debug=true;;
          --dvi)   out_lang=dvi;;
+         --dvipdf)   out_lang=dvipdf;;
     -e | -E | --expand) expand=t;;
     -h | --help) echo "$usage"; exit 0;;
          --html) out_lang=html;;
@@ -1251,6 +1301,7 @@
       # Make it absolute, just in case we also have --clean, or whatever.
       oname=`absolute "$1"`;;
     -p | --pdf) out_lang=pdf;;
+         --ps)  out_lang=ps;;
     -q | -s | --quiet | --silent) quiet=true; batch=true;;
     -r | --recode) recode=true;;
     --recode-from) shift; recode=true; recode_from="$1";;
@@ -1436,7 +1487,7 @@
   if test x"$oname" != x; then
     out_name=$oname
   else
-    out_name=$in_noext.$out_lang
+    out_name=$in_noext.$(out_lang_ext)
   fi
   out_dir=`func_dirname "$out_name"`
   out_dir_abs=`absolute "$out_dir"`
@@ -1455,7 +1506,7 @@
   input_file_name_decode
 
   # `texinfo' or `latex'?
-  language=`compute_language $command_line_filename`
+  in_lang=`compute_language $command_line_filename`
 
   # An auxiliary directory used for all the auxiliary tasks involved
   # in compiling this document.
@@ -1478,7 +1529,7 @@
   # Sometimes there are incompatibilities between auxiliary files for
   # DVI and PDF.  The contents can also change whether we work on PDF
   # and/or DVI.  So keep separate spaces for each.
-  workdir=$t2ddir/$out_lang
+  workdir=$t2ddir/$(out_lang_tex)
   ensure_dir "$workdir"
 
   # _build.  In a tidy build, where the auxiliary files are output.
Index: util/texi2dvi.test
===================================================================
RCS file: /sources/texinfo/texinfo/util/texi2dvi.test,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- util/texi2dvi.test  30 May 2006 14:44:04 -0000      1.10
+++ util/texi2dvi.test  19 Jun 2006 09:35:01 -0000      1.11
@@ -22,45 +22,58 @@
 
 set -e
 
-create_input_texi </dev/null
+# one_run ARGS -- FILES
+# ---------------------
+# Run texi2dvi with ARGS, expect the FILES to be left.  Remove them.
+one_run ()
+{
+  # Testing the local build mode.
+  create_input_texi </dev/null
+  TEXI2DVI_pass $(optionset_get 1 "$@") input.texi
+  # There should only be the expected FILES and the input file.
+  assert_and_remove_files $(optionset_get 2 "$@") input.texi
+}
+
+one_run --batch \
+   -- \
+   input.aux input.cp input.dvi input.fn input.ky input.log \
+   input.pg input.tp input.vr
+
+
+one_run --batch -o output.dvi \
+   -- \
+   input.aux input.cp input.dvi input.fn input.ky input.log \
+   input.pg input.tp input.vr output.dvi
 
-# Testing the local build mode.
-TEXI2DVI_pass --batch input.texi
-# There should only be the DVI and the TEXI file.
-assert_files input.aux input.cp input.dvi input.fn input.ky input.log input.pg 
input.texi input.tp input.vr
-rm input.aux input.cp input.dvi input.fn input.ky input.log input.pg input.tp 
input.vr
-
-TEXI2DVI_pass --batch input.texi -o output.dvi
-# There should only be the DVI and the TEXI file.
-assert_files input.aux input.cp input.dvi input.fn input.ky input.log input.pg 
input.texi input.tp input.vr output.dvi
-rm input.aux input.cp input.dvi input.fn input.ky input.log input.pg input.tp 
input.vr output.dvi
 
 # Testing the clean build mode.
 for mode in --clean --build=clean
 do
-  TEXI2DVI_pass $mode --batch input.texi
   # There should only be the DVI and the TEXI file.
-  assert_files input.dvi input.texi
-  rm input.dvi
+  one_run $mode --batch -- input.dvi
 
-  TEXI2DVI_pass $mode --batch input.texi -o output.dvi
   # There should only be the DVI and the TEXI file.
-  assert_files input.texi output.dvi
-  rm output.dvi
+  one_run $mode --batch -o output.dvi -- output.dvi
 done
 
 
 # Testing the tidy build mode.
-TEXI2DVI_pass --build=tidy --batch input.texi -o output.dvi
-# There should only be the DVI and the TEXI file.
-assert_files input.texi output.dvi output.t2d
-TEXI2DVI_pass --build=tidy --batch input.texi -o output.dvi --mostly-clean
-assert_files input.texi output.dvi
-rm output.dvi
+one_run --build=tidy --batch -o output.dvi \
+   -- \
+   output.dvi output.t2d
+
+
+# mostly-clean should remove auxiliary files, but not the expected
+# output.
+touch output.dvi
+one_run --build=tidy --batch -o output.dvi --mostly-clean \
+   -- \
+   output.dvi
 
-cp input.texi input2.texi
 
-TEXI2DVI_pass --clean --batch input.texi input2.texi
 # There should only be the DVI and the TEXI file.
-assert_files input2.dvi input2.texi input.dvi input.texi
-rm input.dvi input2.dvi
+create_input_texi </dev/null
+cp input.texi input2.texi
+one_run --clean --batch input.texi input2.texi \
+   -- \
+   input2.dvi input2.texi input.dvi
P ChangeLog
P util/Makefile.am
P util/defs.in
U util/dvipdf.test
P util/texi2dvi
P util/texi2dvi.test


reply via email to

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