texinfo-commits
[Top][All Lists]
Advanced

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

[no subject]


From: Gavin D. Smith
Date: Fri, 24 Mar 2023 14:58:55 -0400 (EDT)

branch: master
commit 967c03a00105605fd4d6b4589b695e9ab8bd00b8
Author: Gavin Smith <gavinsmith0123@gmail.com>
AuthorDate: Fri Mar 24 18:56:28 2023 +0000

    Make setting TEXI2DVI_BUILD_DIRECTORY equivalent to --build-dir option
    
    * util/texi2dvi: Make setting build dir to a directory change
    build mode from 'local' to 'tidy' regardless of whether it is
    given with --build-dir or setting the TEXI2DVI_BUILD_DIRECTORY
    envvar.
    (build_dir): Make default value empty rather than '.'.
    (usage): Update.
    
    Suggestion from Bogdan Drozdowski.
---
 ChangeLog     | 13 +++++++++++++
 util/texi2dvi | 26 +++++++++++++++++---------
 2 files changed, 30 insertions(+), 9 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 92bc4d6325..3a8ddece60 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+2023-03-23  Gavin Smith <gavinsmith0123@gmail.com>
+
+       Make setting TEXI2DVI_BUILD_DIRECTORY equivalent to --build-dir option
+
+       * util/texi2dvi: Make setting build dir to a directory change
+       build mode from 'local' to 'tidy' regardless of whether it is
+       given with --build-dir or setting the TEXI2DVI_BUILD_DIRECTORY
+       envvar.
+       (build_dir): Make default value empty rather than '.'.
+       (usage): Update.
+
+       Suggestion from Bogdan Drozdowski.
+
 2023-03-21  Patrice Dumas  <pertusus@free.fr>
 
        Index commands do not end paragraphs in texi2any
diff --git a/util/texi2dvi b/util/texi2dvi
index 28c53ebe44..dd124e3429 100755
--- a/util/texi2dvi
+++ b/util/texi2dvi
@@ -1,7 +1,7 @@
 #! /bin/sh
 # texi2dvi --- produce DVI (or PDF) files from Texinfo (or (La)TeX) sources.
 #
-# Copyright 1992-2022 Free Software Foundation, Inc.
+# Copyright 1992-2023 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
@@ -36,7 +36,7 @@ set -e
 program=`echo $0 | $SED -e 's!.*/!!'`
 
 build_mode=${TEXI2DVI_BUILD_MODE:-local}
-build_dir=${TEXI2DVI_BUILD_DIRECTORY:-.}
+build_dir=${TEXI2DVI_BUILD_DIRECTORY:-}
 
 orig_pwd=`pwd`
 
@@ -151,12 +151,10 @@ Build modes:
       --tidy           same as --build=tidy
   -c, --clean          same as --build=clean
       --build-dir=DIR  specify where the tidy compilation is performed;
-                         implies --tidy;
-                         defaults to TEXI2DVI_BUILD_DIRECTORY [$build_dir]
+                         implies --tidy
 
 The MODE specifies where the TeX compilation takes place, and, as a
-consequence, how auxiliary files are treated.  The build mode can also
-be set using the environment variable TEXI2DVI_BUILD_MODE.
+consequence, how auxiliary files are treated.
 
 Valid values of MODE are:
   \`local'      compile in the current directory, leaving all the auxiliary
@@ -166,6 +164,10 @@ Valid values of MODE are:
   \`clean'      same as \`tidy', but remove the auxiliary directory afterwards.
                Every compilation therefore requires the full cycle.
 
+The build mode can also be set using the environment variable
+TEXI2DVI_BUILD_MODE.  The tidy build directory can also be set using
+the environment variable TEXI2DVI_BUILD_DIRECTORY.
+
 The values of these environment variables are used to run the
 corresponding commands, if they are set:
 
@@ -1694,7 +1696,7 @@ while test x"$1" != x"$arg_sep"; do
     -~ ) verbose "Option -~ is obsolete: texi2dvi ignores it.";;
     -b | --batch) ;; # Obsolete
          --build)      shift; build_mode=$1;;
-         --build-dir)  shift; build_dir=$1; build_mode=tidy;;
+         --build-dir)  shift; build_dir=$1;;
     -c | --clean) build_mode=clean;;
     -D | --debug) debug=true;;
     -e | -E | --expand) expand=true;;
@@ -1743,6 +1745,11 @@ done
 # Pop the token
 shift
 
+# If build_dir given, switch from --local to --tidy
+if test x"$build_dir" != x"" && test x"$build_mode" = x"local" ; then
+  build_mode=tidy
+fi
+
 # $tidy:  compile in a t2d directory.
 # $clean: remove all the aux files.
 case $build_mode in
@@ -1848,7 +1855,8 @@ do
   # in compiling this document.
   case $build_dir in
       '' | . ) t2ddir=$out_noext.t2d ;;
-      *) # Avoid collisions between multiple occurrences of the same
+      *) ensure_dir "$build_dir"
+         # Avoid collisions between multiple occurrences of the same
          # file, so depend on the output path.  Remove leading `./',
          # at least to avoid creating a file starting with `.!', i.e.,
          # an invisible file. The sed expression is fragile if the cwd
@@ -1860,7 +1868,7 @@ do
   # Remove it at exit if clean mode.
   trap "cleanup" 0 1 2 15
 
-  ensure_dir "$build_dir" "$t2ddir"
+  ensure_dir "$t2ddir"
 
   # Sometimes there are incompatibilities between auxiliary files for
   # DVI and PDF.  The contents can also change whether we work on PDF



reply via email to

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