automake-patches
[Top][All Lists]
Advanced

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

[PATCH 2/3] texinfo: remove hack about info files in CLEANFILES variable


From: Stefano Lattarini
Subject: [PATCH 2/3] texinfo: remove hack about info files in CLEANFILES variables
Date: Mon, 31 Dec 2012 11:02:49 +0100

Automake used to implement an undocumented hack causing '.info' files
that appeared to be cleaned (by e.g. being listed in the CLEANFILES
variable) to also be built in the builddir rather than in the srcdir;
this was for backward compatibility with packages such as Texinfo,
which did things like:

    info_TEXINFOS = texinfo.txi info-stnd.texi info.texi
    DISTCLEANFILES = texinfo texinfo-* info*.info*
    # Do not create info files for distribution.
    dist-info:

in order not to distribute .info files.

Now that we have the 'info-in-builddir' option that explicitly causes
generated '.info' files to be placed in the builddir, this hack is no
longer necessary, and we can remove it.

* automake.in (handle_texinfo_helper): Remove the hack.  Adjust
comments accordingly.
* NEWS: Update.
* t/txinfo23.sh: Delete as obsolete.
* t/txinfo25.sh: Likewise.
* t/txinfo24.sh: Likewise.
* t/txinfo28.sh: Delete as mostly obsolete, its only still relevant
parts moved ...
* t/mdate5.sh: ... into this test.
* t/txinfo33.sh: Remove references to deleted tests.
* t/list-of-tests.mk: Adjust.

Signed-off-by: Stefano Lattarini <address@hidden>
---
 NEWS               |  19 +++++++++
 automake.in        |  30 +--------------
 t/list-of-tests.mk |   4 --
 t/mdate5.sh        |  51 ++++++++++++++----------
 t/txinfo23.sh      |  66 -------------------------------
 t/txinfo24.sh      |  83 ---------------------------------------
 t/txinfo25.sh      | 111 -----------------------------------------------------
 t/txinfo28.sh      |  89 ------------------------------------------
 t/txinfo33.sh      |   1 -
 9 files changed, 51 insertions(+), 403 deletions(-)
 delete mode 100755 t/txinfo23.sh
 delete mode 100755 t/txinfo24.sh
 delete mode 100755 t/txinfo25.sh
 delete mode 100755 t/txinfo28.sh

diff --git a/NEWS b/NEWS
index ac723af..71e96ae 100644
--- a/NEWS
+++ b/NEWS
@@ -1,5 +1,24 @@
 New in 1.14:
 
+* Texinfo support:
+
+  - Automake used to implement an undocumented hack causing '.info' files
+    that appeared to be cleaned (by e.g. being listed in the CLEANFILES
+    variable) to also be built in the builddir rather than in the srcdir;
+    this was for backward compatibility with packages such as Texinfo,
+    which did things like:
+
+        info_TEXINFOS = texinfo.txi info-stnd.texi info.texi
+        DISTCLEANFILES = texinfo texinfo-* info*.info*
+        # Do not create info files for distribution.
+        dist-info:
+
+    in order not to distribute .info files.
+
+    Now that we have the 'info-in-builddir' option that explicitly causes
+    generated '.info' files to be placed in the builddir, this hack is no
+    longer necessary, and we can remove it.
+
 * Aclocal search path:
 
   - Third-party m4 files located in the system-wide aclocal directory,
diff --git a/automake.in b/automake.in
index b0d9f44..727732b 100644
--- a/automake.in
+++ b/automake.in
@@ -3120,15 +3120,6 @@ sub handle_texinfo_helper ($)
   my $done = 0;
   my (@mostly_cleans, @texi_cleans, @maint_cleans) = ('', '', '');
 
-  # Build a regex matching user-cleaned files.
-  my $d = var 'DISTCLEANFILES';
-  my $c = var 'CLEANFILES';
-  my @f = ();
-  push @f, $d->value_as_list_recursive (inner_expand => 1) if $d;
-  push @f, $c->value_as_list_recursive (inner_expand => 1) if $c;
-  @f = map { s|[^A-Za-z_0-9*\[\]\-]|\\$&|g; s|\*|[^/]*|g; $_; } @f;
-  my $user_cleaned_files = '^(?:' . join ('|', @f) . ')$';
-
   foreach my $texi
       ($info_texinfos->value_as_list_recursive (inner_expand => 1))
     {
@@ -3252,26 +3243,7 @@ sub handle_texinfo_helper ($)
       # support non-distributed .info files at some point, we
       # have a single variable ($INSRC) that controls whether
       # the current .info file must be built in the source tree
-      # or in the build tree.  Actually this variable is switched
-      # off in two cases:
-      #  (1) For '.info' files that appear to be cleaned; this is for
-      #      backward compatibility with package such as Texinfo,
-      #      which do things like
-      #        info_TEXINFOS = texinfo.txi info-stnd.texi info.texi
-      #        DISTCLEANFILES = texinfo texinfo-* info*.info*
-      #        # Do not create info files for distribution.
-      #        dist-info:
-      #      in order not to distribute .info files.
-      #  (2) When the undocumented option 'info-in-builddir' is given.
-      #      This is done to allow the developers of GCC, GDB, GNU
-      #      binutils and the GNU bfd library to force the '.info' files
-      #      to be generated in the builddir rather than the srcdir, as
-      #      was once done when the (now removed) 'cygnus' option was
-      #      given.  See automake bug#11034 for more discussion.
-      my $insrc = 1;
-      $insrc = 0 if $out_file =~ $user_cleaned_files;
-      $insrc = 0 if option 'info-in-builddir';
-
+      my $insrc = ! option 'info-in-builddir';
       $outdir = '$(srcdir)/' . $outdir if $insrc;
 
       # If user specified file_TEXINFOS, then use that as explicit
diff --git a/t/list-of-tests.mk b/t/list-of-tests.mk
index b5ce4c3..6455c7e 100644
--- a/t/list-of-tests.mk
+++ b/t/list-of-tests.mk
@@ -1173,12 +1173,8 @@ t/txinfo17.sh \
 t/txinfo20.sh \
 t/txinfo21.sh \
 t/txinfo22.sh \
-t/txinfo23.sh \
-t/txinfo24.sh \
-t/txinfo25.sh \
 t/txinfo26.sh \
 t/txinfo27.sh \
-t/txinfo28.sh \
 t/txinfo29.sh \
 t/txinfo31.sh \
 t/txinfo32.sh \
diff --git a/t/mdate5.sh b/t/mdate5.sh
index 6603667..5d35417 100755
--- a/t/mdate5.sh
+++ b/t/mdate5.sh
@@ -21,25 +21,36 @@ am_create_testdir=empty
 
 get_shell_script mdate-sh
 
-set x $(./mdate-sh mdate-sh)
-shift
-echo "$*" # For debugging.
-
-# Check that mdate output looks like a date:
-test $# = 3
-case $1$3 in *[!0-9]*) exit 1;; esac
-test $1 -lt 32
-# Hopefully automake will be obsolete in 80 years ;-)
-case $3 in 20[0-9][0-9]) :;; *) exit 1;; esac
-case $2 in
-  January|February|March|April|May|June|July|August) ;;
-  September|October|November|December) ;;
-  *) exit 1
-esac
-
-# Stricter checks on the year required a POSIX date(1) command.
-if year=$(date +%Y) && test $year -gt 2010; then
-  test $year = $3 || exit 1
-fi
+year=$(date +%Y) && test $year -gt 2010 || year=NONE
+
+do_checks ()
+{
+  set x $(./mdate-sh mdate-sh)
+  shift
+  echo "$*" # For debugging.
+
+  # Check that mdate output looks like a date.
+  test $# = 3 || exit 1
+  case $1$3 in *[!0-9]*) exit 1;; esac
+  test $1 -lt 32 || exit 1
+  # Hopefully automake will be obsolete in 80 years ;-)
+  case $3 in 20[0-9][0-9]) :;; *) exit 1;; esac
+  case $2 in
+    January|February|March|April|May|June|July|August) ;;
+    September|October|November|December) ;;
+    *) exit 1
+  esac
+
+  # Stricter checks on the year require a POSIX date(1) command.
+  test $year = NONE || test $year = $3 || exit 1
+}
+
+TIME_STYLE=; unset TIME_STYLE
+do_checks
+
+# This setting, when honored by GNU ls, used to cause an infinite
+# loop in mdate-sh.
+TIME_STYLE="+%Y-%m-%d %H:%M:%S"; export TIME_STYLE
+do_checks
 
 :
diff --git a/t/txinfo23.sh b/t/txinfo23.sh
deleted file mode 100755
index 6b90f18..0000000
--- a/t/txinfo23.sh
+++ /dev/null
@@ -1,66 +0,0 @@
-#! /bin/sh
-# Copyright (C) 2002-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 <http://www.gnu.org/licenses/>.
-
-# Check that info files are built in builddir when needed.
-# Test with subdir Texinfo.
-# (Similar to txinfo13.sh, plus DISTCLEANFILES).
-# (See also txinfo24.sh and txinfo25.sh).
-
-required='makeinfo tex texi2dvi'
-. test-init.sh
-
-cat >> configure.ac << 'END'
-AC_OUTPUT
-END
-
-cat > Makefile.am << 'END'
-DISTCLEANFILES = subdir/*.info*
-info_TEXINFOS = subdir/main.texi
-subdir_main_TEXINFOS = subdir/inc.texi
-
-installcheck-local:
-       test -f "$(infodir)/main.info"
-END
-
-mkdir subdir
-
-cat > subdir/main.texi << 'END'
-\input texinfo
address@hidden main.info
address@hidden main
address@hidden Top
-Hello walls.
address@hidden version.texi
address@hidden inc.texi
address@hidden
-END
-
-cat > subdir/inc.texi << 'END'
-I'm included.
-END
-
-$ACLOCAL
-$AUTOMAKE --add-missing
-$AUTOCONF
-
-mkdir build
-cd build
-../configure
-$MAKE distcheck
-test -f subdir/main.info
-test ! -e ../subdir/main.info
-
-:
diff --git a/t/txinfo24.sh b/t/txinfo24.sh
deleted file mode 100755
index 5a89c6b..0000000
--- a/t/txinfo24.sh
+++ /dev/null
@@ -1,83 +0,0 @@
-#! /bin/sh
-# Copyright (C) 2002-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 <http://www.gnu.org/licenses/>.
-
-# Check that info files are built in builddir when needed.
-# (Similar to txinfo16.sh, plus CLEANFILES).
-# (See also txinfo23.sh and txinfo25.sh).
-
-required='makeinfo tex texi2dvi'
-. test-init.sh
-
-cat >> configure.ac << 'END'
-AC_OUTPUT
-END
-
-cat > Makefile.am << 'END'
-CLEANFILES = main.info
-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 version.texi
address@hidden
-END
-
-$ACLOCAL
-$AUTOMAKE --add-missing
-$AUTOCONF
-
-mkdir build
-cd build
-../configure
-$MAKE
-test ! -e ../main.info
-test -f main.info
-
-cd ..
-rm -rf build
-./configure
-$MAKE
-test -f main.info
-
-# Make sure stamp-vti is older that version.texi.
-# (A common situation in a real tree).
-test -f stamp-vti
-test -f version.texi
-$sleep
-touch stamp-vti
-
-$MAKE distclean
-test -f stamp-vti
-test -f version.texi
-
-mkdir build
-cd build
-../configure
-$MAKE
-# main.info should be rebuilt in the current directory.
-test -f main.info
-test ! -e ../main.info
-$MAKE dvi
-test -f main.dvi
-
-$MAKE distcheck
-
-:
diff --git a/t/txinfo25.sh b/t/txinfo25.sh
deleted file mode 100755
index 45ea428..0000000
--- a/t/txinfo25.sh
+++ /dev/null
@@ -1,111 +0,0 @@
-#! /bin/sh
-# Copyright (C) 2003-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 <http://www.gnu.org/licenses/>.
-
-# Check that info files are built in builddir and in srcdir can safely
-# co-exist.  This setup is obtained by having two info files, only one
-# of which being cleaned.
-# (Similar to txinfo16.sh, plus CLEANFILES).
-# (See also txinfo23.sh and txinfo24.sh).
-
-required='makeinfo tex texi2dvi'
-. test-init.sh
-
-cat >> configure.ac << 'END'
-AC_OUTPUT
-END
-
-cat > Makefile.am << 'END'
-CLEANFILES = [a-m]*.info
-info_TEXINFOS = main.texi other.texi
-END
-
-cat > main.texi << 'END'
-\input texinfo
address@hidden main.info
address@hidden main
address@hidden Top
-Hello walls.
address@hidden version.texi
address@hidden
-END
-
-cat > other.texi << 'END'
-\input texinfo
address@hidden other.info
address@hidden other
address@hidden Top
-Hello walls.
address@hidden version2.texi
address@hidden
-END
-
-$ACLOCAL
-$AUTOMAKE --add-missing
-$AUTOCONF
-
-mkdir build
-cd build
-../configure
-$MAKE
-test -f main.info
-test ! -e ../main.info
-test ! -e other.info
-test -f ../other.info
-
-cd ..
-rm -rf build
-./configure
-$MAKE
-test -f main.info
-test -f other.info
-
-# Make sure stamp-vti is older that version.texi.
-# (A common situation in a real tree).
-# This is needed to test the "subtle" issue described below.
-test -f stamp-vti
-test -f version.texi
-test -f stamp-1
-test -f version2.texi
-$sleep
-touch stamp-vti
-touch stamp-1
-
-$MAKE distclean
-test -f stamp-vti
-test -f stamp-1
-test -f version.texi
-test -f version2.texi
-
-mkdir build
-cd build
-../configure
-$MAKE
-# other.info should not be rebuilt in the current directory, since
-# it's up-to-date in $(srcdir).
-# This can be caused by a subtle issue related to VPATH handling
-# of version.texi (see also the comment in texi-vers.am): because
-# stamp-vti is newer than version.texi, the 'version.texi: stamp-vti'
-# rule is always triggered.  Still that's not a reason for 'make'
-# to think 'version.texi' has been created...
-test -f main.info
-test ! -e other.info
-$MAKE dvi
-test -f main.dvi
-test -f other.dvi
-
-$MAKE distcheck
-
-:
diff --git a/t/txinfo28.sh b/t/txinfo28.sh
deleted file mode 100755
index 069a515..0000000
--- a/t/txinfo28.sh
+++ /dev/null
@@ -1,89 +0,0 @@
-#! /bin/sh
-# Copyright (C) 2002-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 <http://www.gnu.org/licenses/>.
-
-# Check that info files are built in builddir when needed.
-# Similar to txinfo24.sh, but obfuscating filenames with variable
-# references.
-# Report from Ralf Corsepius.
-
-required='makeinfo tex texi2dvi'
-. test-init.sh
-
-# This setting, when honored by GNU ls, used to cause an infinite loop
-# in mdate-sh.
-TIME_STYLE="+%Y-%m-%d %H:%M:%S"
-export TIME_STYLE
-
-echo AC_OUTPUT >> configure.ac
-
-cat > Makefile.am << 'END'
-MA = ma
-IN = in
-PROJ = $(MA)$(IN)
-include fragment.mk
-info_TEXINFOS = ma$(IN).texi
-END
-
-echo 'CLEANFILES = $(PROJ).info' > fragment.mk
-
-cat > main.texi << 'END'
-\input texinfo
address@hidden main.info
address@hidden main
address@hidden Top
-Hello walls.
address@hidden version.texi
address@hidden
-END
-
-$ACLOCAL
-$AUTOMAKE --add-missing
-$AUTOCONF
-
-mkdir build
-cd build
-../configure
-$MAKE
-test -f main.info
-
-cd ..
-rm -rf build
-./configure
-$MAKE
-test -f main.info
-
-# Make sure stamp-vti is older that version.texi.
-# (A common situation in a real tree).
-test -f stamp-vti
-test -f version.texi
-$sleep
-touch stamp-vti
-
-$MAKE distclean
-test -f stamp-vti
-test -f version.texi
-
-mkdir build
-cd build
-../configure
-$MAKE
-# main.info should be rebuilt in the current directory.
-test -f main.info
-test ! -e ../main.info
-$MAKE dvi
-test -f main.dvi
-
-$MAKE distcheck
diff --git a/t/txinfo33.sh b/t/txinfo33.sh
index 47f4038..147b187 100755
--- a/t/txinfo33.sh
+++ b/t/txinfo33.sh
@@ -15,7 +15,6 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 # DVIS, PDFS, PSS, HTMLS should not be cleaned upon 'mostlyclean'.
-# Similar to txinfo25.sh.
 
 required='makeinfo tex texi2dvi dvips'
 . test-init.sh
-- 
1.8.1.rc3.27.g3b73c7d




reply via email to

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