emacs-bug-tracker
[Top][All Lists]
Advanced

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

bug#34201: closed (Make @setfilename optional in Texinfo files)


From: GNU bug Tracking System
Subject: bug#34201: closed (Make @setfilename optional in Texinfo files)
Date: Mon, 15 Feb 2021 02:25:02 +0000

Your message dated Sun, 14 Feb 2021 19:24:02 -0700
with message-id <202102150224.11F2O2e1003541@freefriends.org>
and subject line 
has caused the debbugs.gnu.org bug report #34201,
regarding Make @setfilename optional in Texinfo files
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs@gnu.org.)


-- 
34201: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=34201
GNU Bug Tracking System
Contact help-debbugs@gnu.org with problems
--- Begin Message --- Subject: Make @setfilename optional in Texinfo files Date: Fri, 25 Jan 2019 21:22:33 +0000 User-agent: Mutt/1.5.23 (2014-03-12)
@setfilename should not be required to occur inside Texinfo files, as it 
makes it harder to get them working.

Earlier on this:
https://lists.gnu.org/archive/html/automake/2015-09/msg00000.html

Here is a patch.  I added a test which is passing now, but it wasn't 
passing when I first added the test, so am not sure if it is written 
correctly.  I based it on the existing test 
t/txinfo-setfilename-repeated.sh.

It says GPL version 2 in the licence because that's what was in the 
existing tests, although they should probably all be version 3.

ChangeLog entry:

Do not require @setfilename in Texinfo files.

* bin/automake.in (scan_texinfo_file): Derive name of info file from 
name of input file if no @setfilename line occurs in the file.
* t/texinfo-no-setfilename.sh: New test.

diff --git a/bin/automake.in b/bin/automake.in
index b4ae8f4..01e6a58 100644
--- a/bin/automake.in
+++ b/bin/automake.in
@@ -3083,8 +3083,10 @@ sub scan_texinfo_file
 
   if (! $outfile)
     {
-      err_am "'$filename' missing \@setfilename";
-      return;
+      # Replace a .texi extension with .info
+      $outfile = basename($filename);
+      $outfile =~ s/\.[^.]+$//;
+      $outfile .= '.info';
     }
 
   return ($outfile, $vfile);
diff --git a/t/list-of-tests.mk b/t/list-of-tests.mk
index 84dd29a..32fca84 100644
--- a/t/list-of-tests.mk
+++ b/t/list-of-tests.mk
@@ -1214,6 +1214,7 @@ t/txinfo-no-clutter.sh \
 t/txinfo-no-extra-dist.sh \
 t/txinfo-no-installinfo.sh \
 t/txinfo-no-repeated-targets.sh \
+t/txinfo-no-setfilename.sh \
 t/txinfo-other-suffixes.sh \
 t/txinfo-override-infodeps.sh \
 t/txinfo-override-texinfo-tex.sh \
diff --git a/t/txinfo-no-setfilename.sh b/t/txinfo-no-setfilename.sh
new file mode 100644
index 0000000..3ef1730
--- /dev/null
+++ b/t/txinfo-no-setfilename.sh
@@ -0,0 +1,35 @@
+#! /bin/sh
+# Copyright (C) 2019 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 <https://www.gnu.org/licenses/>.
+
+# Check Texinfo files work without a @setfilename line
+
+. test-init.sh
+
+cat > Makefile.am << 'END'
+info_TEXINFOS = file.texi
+END
+
+cat > file.texi << 'END'
+contents
+END
+
+$ACLOCAL
+$AUTOMAKE --add-missing
+
+
+grep 'file.info:' Makefile.in
+
+:



--- End Message ---
--- Begin Message --- Subject: Date: Sun, 14 Feb 2021 19:24:02 -0700

--- End Message ---

reply via email to

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