From: Stefano Lattarini Date: Tue, 1 Jan 2013 21:34:15 +0000 (+0100) Subject: texi: warn against '.txi' and '.texinfo' input suffixes X-Git-Tag: v1.13.1b~25 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e1ed31451f1df01799544a4c6482ae68a1b07019;p=thirdparty%2Fautomake.git texi: warn against '.txi' and '.texinfo' input suffixes The warning being in the 'obsolete' category. This is mostly to ease transition to Automake-NG (see commit v1.12.1-416-gd5459b9), and to discourage use of seldom-tested setups. * automake.in (handle_texinfo_helper): Warn against Texinfo input files with '.txi' or '.texinfo' suffixes. * NEWS: Update. * t/txinfo-other-suffixes.sh: Adjust and enhance. * t/txinfo-no-repeated-targets.sh: No longer use '.txi' and '.texinfo' extensions. Signed-off-by: Stefano Lattarini --- diff --git a/NEWS b/NEWS index 0e5455b9b..c9ad88ad0 100644 --- a/NEWS +++ b/NEWS @@ -55,6 +55,11 @@ New in 1.13.2: '@setfilename' macro in Texinfo input files) is discouraged, and its use will raise warnings in the 'obsolete' category. + - Use of Texinfo input files with '.txi' or '.texinfo' extensions + is discouraged, and its use will raise warnings in the 'obsolete' + category. You are advised to simply use the '.texi' extension + instead. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ New in 1.13.1: diff --git a/automake.in b/automake.in index 386bbf2e5..7a863cf19 100644 --- a/automake.in +++ b/automake.in @@ -3146,11 +3146,17 @@ sub handle_texinfo_helper ($) ($info_texinfos->value_as_list_recursive (inner_expand => 1)) { my $infobase = $texi; - # TODO: In Automake 1.14 (or even 1.13.2), start warning against - # TODO: suffixes != ".texi", to ease transition to Automake-NG. - $infobase =~ s/\.(txi|texinfo|texi)$//; - - if ($infobase eq $texi) + if ($infobase =~ s/\.texi$//) + { + 1; # Nothing more to do. + } + elsif ($infobase =~ s/\.(txi|texinfo)$//) + { + msg_var 'obsolete', $info_texinfos, + "suffix '.$1' for Texinfo files is discouraged;" . + " use '.texi' instead"; + } + else { # FIXME: report line number. err_am "texinfo file '$texi' has unrecognized extension"; diff --git a/t/txinfo-no-repeated-targets.sh b/t/txinfo-no-repeated-targets.sh index c9b977a34..99894f597 100755 --- a/t/txinfo-no-repeated-targets.sh +++ b/t/txinfo-no-repeated-targets.sh @@ -19,12 +19,12 @@ . test-init.sh cat > Makefile.am << 'END' -info_TEXINFOS = maude.texi liver.txi heart.texinfo +info_TEXINFOS = maude.texi liver.texi heart.texi END echo '@setfilename maude.info' > maude.texi -echo '@setfilename liver.info' > liver.txi -echo '@setfilename heart.info' > heart.texinfo +echo '@setfilename liver.info' > liver.texi +echo '@setfilename heart.info' > heart.texi : > texinfo.tex $ACLOCAL diff --git a/t/txinfo-other-suffixes.sh b/t/txinfo-other-suffixes.sh index 11f3a041f..cbb3afa88 100755 --- a/t/txinfo-other-suffixes.sh +++ b/t/txinfo-other-suffixes.sh @@ -14,7 +14,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -# Test to make sure '.txi' extension works. +# Test to make sure '.txi' and '.texinfo' extensions are deprecated, +# but still work. . test-init.sh @@ -27,7 +28,12 @@ echo '@setfilename bar.info' > bar.texinfo : > texinfo.tex $ACLOCAL -$AUTOMAKE +AUTOMAKE_fails +grep "^Makefile\.am:.*suffix '.txi'.*Texinfo file.*discouraged" stderr +grep "^Makefile\.am:.*suffix '.texinfo'.*Texinfo file.*discouraged" stderr +grep "^Makefile\.am:.* use '.texi' instead" stderr + +$AUTOMAKE -Wno-obsolete grep '^\.txi\.info: *$' Makefile.in grep '^\.texinfo\.info: *$' Makefile.in