]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
texi: no longer support split info files
authorStefano Lattarini <stefano.lattarini@gmail.com>
Fri, 4 Jan 2013 17:12:29 +0000 (18:12 +0100)
committerStefano Lattarini <stefano.lattarini@gmail.com>
Mon, 7 Jan 2013 19:26:41 +0000 (20:26 +0100)
See automake bug#13351 and bug#12320.

Automake-generated recipes have for a long time supported "split"
info files:

  http://www.gnu.org/software/texinfo/manual/texinfo/texinfo.html#Tag-and-Split-Files

When I asked the rationale for this feature:

  http://lists.gnu.org/archive/html/texinfo-devel/2012-08/msg00015.html

Karl Berry confirmed that the reason for its existence was indeed
"efficiency, especially memory size":

  http://lists.gnu.org/archive/html/texinfo-devel/2012-08/msg00024.html

He also added that "The Elisp manual is one of the largest ones around.
Looks like it would be maybe 3.5mb as one file."  Not in any way big by
modern standards.

OTOH, it appears that the use of split info files (at least in the way
they have been handled by Automake-generated rules for a long time) can
cause real problems in some (admittedly quite corner-case) situations:

  http://thread.gmane.org/gmane.comp.parsers.bison.bugs/3963
  http://debbugs.gnu.org/cgi/bugreport.cgi?bug=12320

So we now follow suit with Automake-NG (see commit v1.12.2-901-gdd603e2,
<http://lists.gnu.org/archive/html/automake-ng/2012-08/msg00147.html>)
and have Automake-generated makefiles pass the '--no-split' option
unconditionally to makeinfo invocations.

This allow some nice simplifications in our Texinfo recipes, and offer
an automatic fix for bug#12320.

Another *very* good aspect of such a change is that it should be 100%
transparent to the Automake users.

* lib/am/texinfos.am: Simplify moderately.
* lib/am/texibuild.am: Simplify greatly the recipe for the creation
of info files.
* t/txinfo-makeinfo-error-no-clobber.sh: Adjust.
* t/txinfo-no-split.sh: New test.
* t/list-of-tests.mk: Add it.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
lib/am/texibuild.am
lib/am/texinfos.am
t/list-of-tests.mk
t/txinfo-makeinfo-error-no-clobber.sh
t/txinfo-no-split.sh [new file with mode: 0755]

index 2e2a6e10f95b75d11e8d3107bc320e93fbc56bd3..9f568fba4370528eee752331dae76416f5b98709 100644 (file)
 ## should never be dependent upon a non-distributed built file.
 ## Therefore we ensure that %DIRSTAMP% exists in the rule.
 ?!INSRC??DIRSTAMP?     @test -f %DIRSTAMP% || $(MAKE) $(AM_MAKEFLAGS) %DIRSTAMP%
-## Back up the info files before running makeinfo. This is the cheapest
-## way to ensure that
-## 1) If the texinfo file shrinks (or if you start using --no-split),
-##    you'll not be left with some dead info files lying around -- dead
-##    files which would end up in the distribution.
-## 2) If the texinfo file has some minor mistakes which cause makeinfo
-##    to fail, the info files are not removed.  (They are needed by the
-##    developer while he writes documentation.)
-       %AM_V_MAKEINFO%restore=: && backupdir=.am$$$$ && \
-?INSRC?        am__cwd=`pwd` && $(am__cd) $(srcdir) && \
-       rm -rf $$backupdir && mkdir $$backupdir && \
-## If makeinfo is not installed we must not backup the files so
-## 'missing' can do its job and touch $@ if it exists.
-       if ($(MAKEINFO) --version) >/dev/null 2>&1; then \
-         for f in $@ $@-[0-9] $@-[0-9][0-9]; do \
-           if test -f $$f; then mv $$f $$backupdir; restore=mv; else :; fi; \
-         done; \
-       else :; fi && \
-?INSRC?        cd "$$am__cwd"; \
-       if $(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) %MAKEINFOFLAGS% \
-?!INSRC?        -o $@ `test -f '%SOURCE_INFO%' || echo '$(srcdir)/'`%SOURCE_INFO%; \
-?INSRC??!GENERIC_INFO?  -o $@ $(srcdir)/%SOURCE_INFO%; \
-?INSRC??GENERIC_INFO?   -o $@ $<; \
-       then \
-         rc=0; \
-?INSRC?          $(am__cd) $(srcdir); \
-       else \
-         rc=$$?; \
-## Beware that backup info files might come from a subdirectory.
-?INSRC?          $(am__cd) $(srcdir) && \
-         $$restore $$backupdir/* `echo "./$@" | sed 's|[^/]*$$||'`; \
-       fi; \
-       rm -rf $$backupdir; exit $$rc
+## If the texinfo file has some minor mistakes which cause makeinfo
+## to fail, the info files are not removed.
+       $(AM_V_MAKEINFO)$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) \
+                       %MAKEINFOFLAGS% --no-split -o $@-t \
+?!INSRC?               `test -f '%SOURCE_INFO%' || echo '$(srcdir)/'`%SOURCE_INFO%
+?INSRC??!GENERIC_INFO? $(srcdir)/%SOURCE_INFO%
+?INSRC??GENERIC_INFO?  $<
+       $(AM_V_at)mv -f $@-t $@
 
 INFO_DEPS += %DEST_INFO_PREFIX%%DEST_SUFFIX%
 
index 9b9292084b70c5793a541009baa666b325c07990..a57bb03b16bb6cf3fcd0b63bc3f696f6366150b7 100644 (file)
@@ -191,12 +191,11 @@ install-info-am: $(INFO_DEPS)
          case $$file in \
            $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
          esac; \
-         if test -f $$file; then d=.; else d=$(srcdir); fi; \
-         for ifile in $$d/$$file $$d/$$file-[0-9] $$d/$$file-[0-9][0-9]; do \
-           if test -f $$ifile; then \
-             echo "$$ifile"; \
-           else : ; fi; \
-         done; \
+         if test -f $$file; then \
+           echo ./$$file; \
+         else \
+           echo $(srcdir)/$$file; \
+         fi; \
        done | $(am__base_list) | \
        while read files; do \
          echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(infodir)'"; \
@@ -311,8 +310,8 @@ uninstall-info-am:
        for file in $$list; do \
          relfile=`echo "$$file" | sed 's|^.*/||'`; \
          (if test -d "$(DESTDIR)$(infodir)" && cd "$(DESTDIR)$(infodir)"; then \
-            echo " cd '$(DESTDIR)$(infodir)' && rm -f $$relfile $$relfile-[0-9] $$relfile-[0-9][0-9]"; \
-            rm -f $$relfile $$relfile-[0-9] $$relfile-[0-9][0-9]; \
+            echo " cd '$(DESTDIR)$(infodir)' && rm -f $$relfile"; \
+            rm -f $$relfile; \
           else :; fi); \
        done
 
@@ -345,15 +344,14 @@ dist-info: $(INFO_DEPS)
          case $$base in \
            $(srcdir)/*) base=`echo "$$base" | sed "s|^$$srcdirstrip/||"`;; \
          esac; \
-         if test -f $$base; then d=.; else d=$(srcdir); fi; \
-         for file in $$d/$$base $$d/$$base-[0-9] $$d/$$base-[0-9][0-9]; do \
-           if test -f $$file; then \
-## Strip leading '$$d/'.
-             relfile=`expr "$$file" : "$$d/\(.*\)"`; \
-             test -f "$(distdir)/$$relfile" || \
-               cp -p $$file "$(distdir)/$$relfile"; \
-           else :; fi; \
-         done; \
+         if test -f $$base; then \
+           file=./$$base; \
+         else \
+           file=$(srcdir)/$$base; \
+         fi; \
+         if test -f $$file && test ! -f "$(distdir)/$$base"; then \
+           cp -p $$file "$(distdir)/$$base"; \
+         fi; \
        done
 endif %?LOCAL-TEXIS%
 
@@ -383,10 +381,7 @@ clean-aminfo:
 
 .PHONY maintainer-clean-am: maintainer-clean-aminfo
 maintainer-clean-aminfo:
-       @list='$(INFO_DEPS)'; for i in $$list; do \
-         echo " rm -f $$i $$i-[0-9] $$i-[0-9][0-9]"; \
-         rm -f $$i $$i-[0-9] $$i-[0-9][0-9]; \
-       done
+       -test -z "$(INFO_DEPS)" || rm -f $(INFO_DEPS)
 ## Use '-rf', not just '-f'; see comments in 'mostlyclean-aminfo'
 ## above for details.
 ?MAINTCLEAN?   -test -z "%MAINTCLEAN%" \
index e8efe45424c3002ec05b250619ee4f91a5969764..a6b379cce017b87120d7b4dcd6c37ff7966a1052 100644 (file)
@@ -1170,6 +1170,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-split.sh \
 t/txinfo-other-suffixes.sh \
 t/txinfo-override-infodeps.sh \
 t/txinfo-override-texinfo-tex.sh \
index f4b7d01b1af879bf7529f4c0a9fea3c4cd963390..c567e89f094ad7b4f3caf2d2efe432d2c0fff900 100755 (executable)
@@ -45,10 +45,6 @@ $AUTOCONF
 ./configure
 $MAKE
 
-# Feign more info files.
-: > main.info-1
-: > sub/main.info-1
-
 # Break main.texi.
 $sleep
 cp main.texi main.old
@@ -64,15 +60,12 @@ END
 # makeinfo will bail out, but we should conserve the old info files.
 $MAKE && exit 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.info
-test ! -e main.info-1
 test -f sub/main.info
-test -f sub/main.info-1
 
 :
diff --git a/t/txinfo-no-split.sh b/t/txinfo-no-split.sh
new file mode 100755 (executable)
index 0000000..aecf7e7
--- /dev/null
@@ -0,0 +1,94 @@
+#! /bin/sh
+# Copyright (C) 2013 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 <http://www.gnu.org/licenses/>.
+
+# Info split files should not be produced (automake bug#13351).
+
+required=makeinfo
+. test-init.sh
+
+echo AC_OUTPUT >> configure.ac
+
+cat > Makefile.am <<'END'
+MAKEINFO = makeinfo --split-size 10
+info_TEXINFOS = foo.texi
+
+test-split: # A sanity check.
+       $(MAKEINFO) -o split.info foo.texi
+
+check-local:
+       test -f $(srcdir)/foo.info
+       test ! -f $(srcdir)/foo.info-1
+       test "`find $(srcdir) . | grep '\.info'`" = "$(srcdir)/foo.info"
+END
+
+cat > foo.texi << 'END'
+\input texinfo
+@setfilename foo.info
+@settitle foo
+@dircategory Dummy utilities
+@direntry
+* Foo: (foo).  Does nothing at all.
+@end direntry
+
+@node Top
+@top Foo
+
+@menu
+* Intro::    Introduction
+* Planets::  List of Planets
+@end menu
+
+@node Intro
+@chapter Introduction
+Will list planets.
+
+@node Planets
+@chapter List of planets
+Hello Mercury.
+Hello Venus
+Hello Earth
+Hello Mars.
+Hello Jupiter.
+Hello Saturn.
+Hello Uran.
+Hello Neptune.
+Hello Pluto.
+@bye
+END
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE -a
+
+./configure
+
+$MAKE test-split
+ls -l # For debugging.
+test -f split.info
+test -f split.info-1
+test -f split.info-2
+rm -f split*
+
+$MAKE
+
+ls -l # For debugging.
+test -f foo.info
+test ! -f foo.info-1
+test "$(find . | $FGREP '.info' | sed 's|^\./||')" = foo.info
+
+$MAKE distcheck
+
+: