summaryrefslogtreecommitdiff
path: root/macros/texinfo
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2023-10-19 03:01:07 +0000
committerNorbert Preining <norbert@preining.info>2023-10-19 03:01:07 +0000
commit05e4c0a34b97237b4cd2f3fb0d5cd03e73b8e55e (patch)
treefc7502cefdd6bcd7e39361b7b5cfe5b650eeba11 /macros/texinfo
parentf4a002c5b54c3f9678105cef89c2cd0b4f41577a (diff)
CTAN sync 202310190301
Diffstat (limited to 'macros/texinfo')
-rw-r--r--macros/texinfo/latest/texi2dvi90
-rw-r--r--macros/texinfo/latest/texi2pdf4
2 files changed, 24 insertions, 70 deletions
diff --git a/macros/texinfo/latest/texi2dvi b/macros/texinfo/latest/texi2dvi
index f7fff97611..e65b4cfec7 100644
--- a/macros/texinfo/latest/texi2dvi
+++ b/macros/texinfo/latest/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:
@@ -195,9 +197,9 @@ EOF
version ()
{
cat <<EOF
-texi2dvi (GNU Texinfo 7.0.1)
+texi2dvi (GNU Texinfo 7.1)
-Copyright (C) 2022 Free Software Foundation, Inc.
+Copyright (C) 2023 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
@@ -1200,10 +1202,9 @@ to tex itself simply not working."
# (running missing) and then we end up with things like '"-I"',
# and "-I" (including the quotes) is not an option name. This
# happens with gettext 0.14.5, at least.
- $SED "$comment_iftex" "$command_line_filename" \
- | eval $makeinfo --footnote-style=end -I "$in_dir" $run_mi_includes \
- -o /dev/null --macro-expand=- \
- | $SED "$uncomment_iftex" >"$in_src"
+ eval $makeinfo -c TEXINFO_OUTPUT_FORMAT=plaintexinfo --iftex --no-ifinfo \
+ --footnote-style=end -I "$in_dir" $run_mi_includes \
+ "$command_line_filename" >"$in_src"
# Continue only if everything succeeded.
if test $? -ne 0 \
|| test ! -r "$in_src"; then
@@ -1214,59 +1215,6 @@ to tex itself simply not working."
fi
}
-# Unfortunately, makeinfo --iftex --no-ifinfo doesn't work well enough
-# in versions before 5.0, as makeinfo can't parse the TeX commands
-# inside @tex blocks, so work around with sed.
-#
-# This sed script preprocesses Texinfo sources in order to keep the
-# iftex sections only. We want to remove non-TeX sections, and comment
-# (with `@c _texi2dvi') TeX sections so that makeinfo does not try to
-# parse them. Nevertheless, while commenting TeX sections, don't
-# comment @macro/@end macro so that makeinfo does propagate them.
-# Similarly, preserve the @top node to avoid makeinfo complaining about
-# it being missed. Comment it out after preprocessing, so that it does
-# not appear in the generated document.
-#
-# We assume that `@c _texi2dvi' or `@c (_texi2dvi)' starting a line is
-# not present in the document. Additionally, conditionally defined
-# macros inside the @top node may end up with the wrong value, although
-# this is unlikely in practice.
-#
-comment_iftex=\
-'/^@tex/,/^@end tex/{
- s/^/@c _texi2dvi/
-}
-/^@iftex/,/^@end iftex/{
- s/^/@c _texi2dvi/
- /^@c _texi2dvi@macro/,/^@c _texi2dvi@end macro/{
- s/^@c _texi2dvi//
- }
-}
-/^@ifnottex/,/^@end ifnottex/{
- s/^/@c (_texi2dvi)/
- /^@c (_texi2dvi)@node Top/,/^@c (_texi2dvi)@end ifnottex/ {
- /^@c (_texi2dvi)@end ifnottex/b
- s/^@c (_texi2dvi)//
- }
-}
-/^@ifinfo/,/^@end ifinfo/{
- /^@node/p
- /^@menu/,/^@end menu/p
- t
- s/^/@c (_texi2dvi)/
-}
-s/^@ifnotinfo/@c _texi2dvi@ifnotinfo/
-s/^@end ifnotinfo/@c _texi2dvi@end ifnotinfo/'
-
-# Uncomment @iftex blocks by removing any leading `@c texi2dvi' (repeated
-# copies can sneak in via macro invocations). Likewise, comment out
-# the @top node inside a @ifnottex block.
-uncomment_iftex=\
-'s/^@c _texi2dvi\(@c _texi2dvi\)*//
-/^@c (_texi2dvi)@ifnottex/,/^@c (_texi2dvi)@end ifnottex/{
- s/^/@c (_texi2dvi)/
-}'
-
# insert_commands - Insert $textra commands at the beginning of the file.
# Recommended to be used for @finalout, @smallbook, etc.
@@ -1748,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;;
@@ -1797,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
@@ -1902,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
@@ -1914,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
diff --git a/macros/texinfo/latest/texi2pdf b/macros/texinfo/latest/texi2pdf
index 373d201319..2d2824613c 100644
--- a/macros/texinfo/latest/texi2pdf
+++ b/macros/texinfo/latest/texi2pdf
@@ -21,9 +21,9 @@ test -n "${ZSH_VERSION+set}" && alias -g '${1+"$@"}'='"$@"'
# obliged to.
if test "x$1" = x--version; then
cat <<EOF
-texi2pdf (GNU Texinfo 7.0.1)
+texi2pdf (GNU Texinfo 7.1)
-Copyright (C) 2022 Free Software Foundation, Inc.
+Copyright (C) 2023 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.