automake-patches
[Top][All Lists]
Advanced

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

Re: on using `makeinfo --no-split' to solve filename conflicts


From: Alexandre Duret-Lutz
Subject: Re: on using `makeinfo --no-split' to solve filename conflicts
Date: Wed, 19 Feb 2003 10:47:13 +0100
User-agent: Gnus/5.090008 (Oort Gnus v0.08) Emacs/21.2 (i386-pc-linux-gnu)

>>> "Zaretskii" == Zaretskii Eli <address@hidden> writes:

 Zaretskii> automatic renaming such as *.info-XX->*.iXX happens automatically,

Here is my proposal to fix the install/uninstall/clean rules.
Let me know if anything looks incorrect.

2003-02-19  Alexandre Duret-Lutz  <address@hidden>

        * lib/am/texinfos.am (install-info-am, uninstall-info-am): Install
        DJGPP-style *.iNN info files.
        (maintainer-clean-aminfo): Rewrite using the same pattern
        as in uninstall-info-am.
        * lib/am/texibuild.am (%SOURCE_SUFFIX%%DEST_SUFFIX%): Erase
        DJGPP-style *.iNN info files before running $(MAKEINFO).
        * tests/txinfo19.test: New file.
        * tests/Makefile.am (TESTS): Add txinfo19.test.

Index: NEWS
===================================================================
RCS file: /cvs/automake/automake/NEWS,v
retrieving revision 1.198.2.25
diff -u -r1.198.2.25 NEWS
--- NEWS        12 Feb 2003 16:15:00 -0000      1.198.2.25
+++ NEWS        19 Feb 2003 09:42:30 -0000
@@ -10,6 +10,7 @@
   - `make distcheck' will now work in `_inst/' and `_build' instead
     of `=inst/' and `=build/'
   - use `_dirstamp' when the file-system doesn't support `.dirstamp'
+  - install/uninstall `*.i[0-9][0-9]'-style info files
   - more changes that affect only the Automake package (not its output)
 * Fix some incompatibilities with upcoming perl-5.10.
 * Properly quote AC_PACKAGE_TARNAME and AC_PACKAGE_VERSION when defining
Index: lib/am/texibuild.am
===================================================================
RCS file: /cvs/automake/automake/lib/am/texibuild.am,v
retrieving revision 1.10.2.2
diff -u -r1.10.2.2 texibuild.am
--- lib/am/texibuild.am 30 Nov 2002 13:11:57 -0000      1.10.2.2
+++ lib/am/texibuild.am 19 Feb 2003 09:42:30 -0000
@@ -1,5 +1,5 @@
 ## automake - create Makefile.in from Makefile.am
-## Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002
+## Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
 ## Free Software Foundation, Inc.
 
 ## This program is free software; you can redistribute it and/or modify
@@ -24,7 +24,8 @@
 ## makeinfo.  Otherwise, if the texinfo file shrinks (or if you start
 ## using --no-split), you'll be left with some dead info files lying
 ## around -- dead files which will end up in the distribution.
-       @rm -f $@ address@hidden address@hidden
+## *.iNN files are used on DJGPP.  See the comments in install-info-am
+       rm -f $@ address@hidden address@hidden ${@:.info=}.i[0-9] 
${@:.info=}.i[0-9][0-9]
 ## It is wrong to have `info' files dependent on %DIRSTAMP%, because
 ## `info' files are distributed and %DIRSTAMP% isn't: a distributed file
 ## should never be dependent upon a non-distributed built file.
Index: lib/am/texinfos.am
===================================================================
RCS file: /cvs/automake/automake/lib/am/texinfos.am,v
retrieving revision 1.98.2.2
diff -u -r1.98.2.2 texinfos.am
--- lib/am/texinfos.am  5 Dec 2002 15:26:25 -0000       1.98.2.2
+++ lib/am/texinfos.am  19 Feb 2003 09:42:30 -0000
@@ -1,6 +1,6 @@
 ## automake - create Makefile.in from Makefile.am
 
-## Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002
+## Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
 ## Free Software Foundation, Inc.
 
 ## This program is free software; you can redistribute it and/or modify
@@ -121,7 +121,18 @@
        @list='$(INFO_DEPS)'; \
        for file in $$list; do \
          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 \
+## 8+3 filesystems cannot deal with foo.info-N filenames: they all
+## conflict.  DJGPP comes with a tool, DJTAR, that will rename these
+## files to foo.iNN while extracting the archive.  DJGPP's makeinfo
+## is patched to grok these filenames.  However we have to account
+## for the renaming when installing the info files.
+##
+## If $file == foo.info, then $file_i == foo.i.  The reason we use two
+## shell commands instead of one ('s|\.info$$|.i|') is so that a suffix-less
+## `foo' becomes `foo.i' too.
+         file_i=`echo "$$file" | sed 's|\.info$$||;s|$$|.i|'`; \
+         for ifile in $$d/$$file $$d/$$file-[0-9] $$d/$$file-[0-9][0-9] \
+                       $$d/$$file_i[0-9] $$d/$$file_i[0-9][0-9] ; do \
            if test -f $$ifile; then \
 ## Strip directory
              relfile=`echo "$$ifile" | sed 's|^.*/||'`; \
@@ -193,9 +204,11 @@
        @list='$(INFO_DEPS)'; \
        for file in $$list; do \
          relfile=`echo "$$file" | sed 's|^.*/||'`; \
+## DJGPP-style info files.  See comment in install-info-am.
+         relfile_i=`echo "$$relfile" | sed 's|\.info$$||;s|$$|.i|'`; \
          (if cd $(DESTDIR)$(infodir); then \
-            echo " rm -f $$relfile $$relfile-[0-9] $$relfile-[0-9][0-9])"; \
-            rm -f $$relfile $$relfile-[0-9] $$relfile-[0-9][0-9]; \
+            echo " rm -f $$relfile $$relfile-[0-9] $$relfile-[0-9][0-9] 
$$relfile_i[0-9] $$relfile_i[0-9][0-9])"; \
+            rm -f $$relfile $$relfile-[0-9] $$relfile-[0-9][0-9] 
$$relfile_i[0-9] $$relfile_i[0-9][0-9]; \
           else :; fi); \
        done
 else ! %?LOCAL-TEXIS%
@@ -234,12 +247,11 @@
 .PHONY: maintainer-clean-aminfo
 maintainer-clean-am: maintainer-clean-aminfo
 maintainer-clean-aminfo:
-## Eww.  But how else can we find all the output files from makeinfo?
-       list='$(INFO_DEPS)'; for i in $$list; do \
-         rm -f $$i; \
-         if test "`echo $$i-[0-9]*`" != "$$i-[0-9]*"; then \
-           rm -f $$i-[0-9]*; \
-         fi; \
+       @list='$(INFO_DEPS)'; for i in $$list; do \
+## .iNN files are DJGPP-style info files.
+         i_i=`echo "$$i" | sed 's|\.info$$||;s|$$|.i|'`; \
+         echo " rm -f $$i $$i-[0-9] $$i-[0-9][0-9] $$i_i[0-9] 
$$i_i[0-9][0-9]"; \
+         rm -f $$i $$i-[0-9] $$i-[0-9][0-9] $$i_i[0-9] $$i_i[0-9][0-9]; \
        done
 
 ?CYGNUS?.PHONY: clean-info
Index: tests/Makefile.am
===================================================================
RCS file: /cvs/automake/automake/tests/Makefile.am,v
retrieving revision 1.443.2.19
diff -u -r1.443.2.19 Makefile.am
--- tests/Makefile.am   11 Feb 2003 18:21:12 -0000      1.443.2.19
+++ tests/Makefile.am   19 Feb 2003 09:42:30 -0000
@@ -419,6 +419,7 @@
 txinfo16.test \
 txinfo17.test \
 txinfo18.test \
+txinfo19.test \
 transform.test \
 unused.test \
 vars.test \
Index: tests/Makefile.in
===================================================================
RCS file: /cvs/automake/automake/tests/Makefile.in,v
retrieving revision 1.576.2.30
diff -u -r1.576.2.30 Makefile.in
--- tests/Makefile.in   12 Feb 2003 17:59:03 -0000      1.576.2.30
+++ tests/Makefile.in   19 Feb 2003 09:42:30 -0000
@@ -513,6 +513,7 @@
 txinfo16.test \
 txinfo17.test \
 txinfo18.test \
+txinfo19.test \
 transform.test \
 unused.test \
 vars.test \
Index: tests/txinfo19.test
===================================================================
RCS file: tests/txinfo19.test
diff -N tests/txinfo19.test
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ tests/txinfo19.test 19 Feb 2003 09:42:30 -0000
@@ -0,0 +1,76 @@
+#! /bin/sh
+# Copyright (C) 2003  Free Software Foundation, Inc.
+#
+# This file is part of GNU Automake.
+#
+# GNU Automake 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.
+#
+# GNU Automake 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 Automake; see the file COPYING.  If not, write to
+# the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+# Boston, MA 02111-1307, USA.
+
+# Test support for DJGPP's .iNN info files.
+
+required='makeinfo tex'
+. ./defs || exit 1
+
+set -e
+
+echo AC_OUTPUT >> configure.in
+
+cat > Makefile.am << 'END'
+info_TEXINFOS = main.texi
+END
+
+cat > main.texi << 'END'
+\input texinfo
address@hidden main.info
address@hidden main
address@hidden Top
+Hello walls.
address@hidden
+END
+
+$ACLOCAL
+$AUTOMAKE --add-missing
+$AUTOCONF
+
+./configure --infodir=`pwd`/_inst
+$MAKE
+
+# Make sure .iNN files are unstalled.
+: > main.i1
+: > main.i21
+$MAKE install
+test -f _inst/main.i1
+test -f _inst/main.i21
+
+# They should be uninstalled too.
+$MAKE uninstall
+test ! -f _inst/main.i1
+test ! -f _inst/main.i21
+
+# Make sure rebuild rules erase old .iNN files when they run makeinfo.
+$sleep
+touch main.texi
+test -f main.i1
+test -f main.i21
+$MAKE
+test ! -f main.i1
+test ! -f main.i21
+
+# Finally, we also want them erased by maintainer-clean.
+: > main.i7
+: > main.i39
+$MAKE maintainer-clean
+test ! -f main.i7
+test ! -f main.i39

-- 
Alexandre Duret-Lutz





reply via email to

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