From a0c7b6a3c28aec6673b7c2f489dd3dfc676605ad Mon Sep 17 00:00:00 2001 From: Stefano Lattarini Date: Fri, 15 Jun 2012 22:52:36 +0200 Subject: [PATCH] [ng] texi: drop support for suffix-less info files Such support is seldom used, and will get in the way of future, useful refactorings. We can still re-introduce it at a later time, after the dust is settled, if there are users' requests in this direction. * automake.in (scan_texinfo_file): Error out if a input '.texi' file specifies an output (in the '@setfilename' directive) that doesn't have a '.info' extension. (output_texinfo_build_rules): Simplify, by assuming generated info files ought to have the '.info' extension. * lib/am/texibuild.am: Likewise. * NG-NEWS: Update * t/txinfo3.sh: Remove as obsolete. * t/txinfo-unrecognized-extension-2.sh: New test. * t/primary-prefix-valid-couples.sh: Adjust to avoid spurious failures. * t/txinfo17.sh: Likewise. * t/txinfo20.sh: Likewise. * t/vtexi2.sh: Likewise. * t/mdate2.sh: Likewise. Signed-off-by: Stefano Lattarini --- NG-NEWS | 2 + automake.in | 2 +- lib/am/texibuild.am | 10 ++-- t/mdate2.sh | 2 +- t/primary-prefix-valid-couples.sh | 2 +- t/txinfo-unrecognized-extension-2.sh | 38 +++++++++++++++ t/txinfo17.sh | 4 +- t/txinfo20.sh | 22 +++++---- t/txinfo3.sh | 72 ---------------------------- t/vtexi2.sh | 2 +- 10 files changed, 63 insertions(+), 93 deletions(-) create mode 100755 t/txinfo-unrecognized-extension-2.sh delete mode 100755 t/txinfo3.sh diff --git a/NG-NEWS b/NG-NEWS index 16d007488..91ccbdea7 100644 --- a/NG-NEWS +++ b/NG-NEWS @@ -222,6 +222,8 @@ Distribution Obsolete Features Removed ========================= +* Extension-less info files are not supported anymore. + * Support for the long-deprecated name 'configure.in' for the Autoconf input file (instead of the modern 'configure.ac') has been deprecated. diff --git a/automake.in b/automake.in index 45f70ebcc..dbff5a8eb 100644 --- a/automake.in +++ b/automake.in @@ -2796,7 +2796,7 @@ sub scan_texinfo_file ($) next if $outfile; $outfile = $1; - if ($outfile =~ /\.([^.]+)$/ && $1 ne 'info') + if ($outfile !~ /\.info$/) { error ("$filename:$.", "output '$outfile' has unrecognized extension"); diff --git a/lib/am/texibuild.am b/lib/am/texibuild.am index 349ef7ad5..dad84f367 100644 --- a/lib/am/texibuild.am +++ b/lib/am/texibuild.am @@ -14,7 +14,7 @@ ## You should have received a copy of the GNU General Public License ## along with this program. If not, see . -%%DEST_SUFFIX%: %%SOURCE_SUFFIX% +%.info: %%SOURCE_SUFFIX% $(if $(am__info_insrc),,@$(am__ensure_target_dir_exists)) ## Back up the info files before running makeinfo. This is the cheapest ## way to ensure that @@ -48,7 +48,7 @@ fi; \ rm -rf $$backupdir; exit $$rc -INFO_DEPS += %DEST_INFO_PREFIX%%DEST_SUFFIX% +INFO_DEPS += %DEST_INFO_PREFIX%.info %.dvi: %%SOURCE_SUFFIX% %AM_V_TEXI2DVI%$(am__ensure_target_dir_exists) && \ @@ -100,14 +100,14 @@ INFO_DEPS += %DEST_INFO_PREFIX%%DEST_SUFFIX% exit 1; \ fi -%DEST_INFO_PREFIX%%DEST_SUFFIX%: %SOURCE_REAL% %DEPS% -?INSRC?%DEST_INFO_PREFIX%%DEST_SUFFIX%: am__info_insrc=yes +%DEST_INFO_PREFIX%.info: %SOURCE_REAL% %DEPS% +?INSRC?%DEST_INFO_PREFIX%.info: am__info_insrc=yes %DEST_PREFIX%.dvi: %SOURCE_REAL% %DEPS% %DEST_PREFIX%.pdf: %SOURCE_REAL% %DEPS% %DEST_PREFIX%.html: %SOURCE_REAL% %DEPS% -%DEST_INFO_PREFIX%%DEST_SUFFIX% \ +%DEST_INFO_PREFIX%.info \ %DEST_PREFIX%.dvi \ %DEST_PREFIX%.pdf \ %DEST_PREFIX%.html \ diff --git a/t/mdate2.sh b/t/mdate2.sh index 093de5ea9..ef08121d3 100755 --- a/t/mdate2.sh +++ b/t/mdate2.sh @@ -29,7 +29,7 @@ END # Required when using Texinfo. : > texinfo.tex : > mdate-sh -echo '@setfilename textutils' > textutils.texi +echo '@setfilename textutils.info' > textutils.texi # Use "././" to confuse Automake into thinking this is a subdir build. $ACLOCAL diff --git a/t/primary-prefix-valid-couples.sh b/t/primary-prefix-valid-couples.sh index 989ca4bad..df21c6ba1 100755 --- a/t/primary-prefix-valid-couples.sh +++ b/t/primary-prefix-valid-couples.sh @@ -38,7 +38,7 @@ AC_DEFUN([AC_PROG_LIBTOOL], END # Other required files. -echo '@setfilename foo' > foo.texi +echo '@setfilename foo.info' > foo.texi : > texinfo.tex : > py-compile : > elisp-comp diff --git a/t/txinfo-unrecognized-extension-2.sh b/t/txinfo-unrecognized-extension-2.sh new file mode 100755 index 000000000..aef97a9fe --- /dev/null +++ b/t/txinfo-unrecognized-extension-2.sh @@ -0,0 +1,38 @@ +#! /bin/sh +# Copyright (C) 2012 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 +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# Test that automake complains properly when texinfo input files +# specify output info files with an invalid extension. + +. ./defs || Exit 1 + +cat > Makefile.am << 'END' +info_TEXINFOS = foo.texi bar.texi baz.texi +END + +echo '@setfilename foo.inf' > foo.texi +echo '@setfilename bar' > bar.texi +echo '@setfilename baz.texi' > baz.texi +: > texinfo.tex + +$ACLOCAL +AUTOMAKE_fails + +grep "foo\.texi:.* 'foo.inf'.*unrecognized extension" stderr +grep "bar\.texi:.* 'bar'.*unrecognized extension" stderr +grep "baz\.texi:.* 'baz.texi'.*unrecognized extension" stderr + +: diff --git a/t/txinfo17.sh b/t/txinfo17.sh index a1fc0ec99..f7438531b 100755 --- a/t/txinfo17.sh +++ b/t/txinfo17.sh @@ -24,7 +24,7 @@ info_TEXINFOS = texinfo.texi END cat > texinfo.texi << 'END' -@setfilename texinfo +@setfilename texinfo.info ... @verbatim @setfilename foobar.info @@ -36,6 +36,6 @@ $ACLOCAL $AUTOMAKE --add-missing grep 'foobar' Makefile.in && Exit 1 -grep 'texinfo:' Makefile.in +grep 'texinfo\.info:' Makefile.in : diff --git a/t/txinfo20.sh b/t/txinfo20.sh index 5c07880c1..98c044ee4 100755 --- a/t/txinfo20.sh +++ b/t/txinfo20.sh @@ -29,7 +29,7 @@ mkdir sub cat > main.texi << 'END' \input texinfo -@setfilename main +@setfilename main.info @settitle main @node Top Hello walls. @@ -46,15 +46,15 @@ $AUTOCONF $MAKE # Feign more info files. -: > main-1 -: > sub/main-1 +: > main.info-1 +: > sub/main.info-1 # Break main.texi. $sleep cp main.texi main.old cat > main.texi << 'END' \input texinfo -@setfilename main +@setfilename main.info @settitle main @node Top @unknown_macro{Hello walls.} @@ -63,14 +63,16 @@ END # makeinfo will bail out, but we should conserve the old info files. $MAKE && Exit 1 -test -f main -test -f main-1 +test -f main.info +test -f main.info-1 # Restore main.texi, and break sub/main.texi. cp main.texi sub/main.texi mv main.old main.texi $MAKE && Exit 1 -test -f main -test ! -f main-1 -test -f sub/main -test -f sub/main-1 +test -f main.info +test ! -f main.info-1 +test -f sub/main.info +test -f sub/main.info-1 + +: diff --git a/t/txinfo3.sh b/t/txinfo3.sh deleted file mode 100755 index 7363c39bd..000000000 --- a/t/txinfo3.sh +++ /dev/null @@ -1,72 +0,0 @@ -#! /bin/sh -# Copyright (C) 1997-2012 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 -# the Free Software Foundation; either version 2, or (at your option) -# any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - -# Test to make sure .info-less @setfilename works. - -required='makeinfo tex texi2dvi' -. ./defs || Exit 1 - -cat >> configure.ac << 'END' -AC_OUTPUT -END - -cat > Makefile.am << 'END' -info_TEXINFOS = textutils.texi doc/automake-ng.texi -.PHONY: echo-info-deps -echo-info-deps: - echo ' ' $(INFO_DEPS) ' ' -END - -cat > textutils.texi < doc/automake-ng.texi < zardoz.texi << 'END' -@setfilename zardoz +@setfilename zardoz.info @include version.texi END -- 2.47.2