Hello automakers.

I see that the cleanup code in `tests/defs.in' (which for obvious
reasons must ensure that the all the subdirectories of the test
directory $testSubDir are writable, before trying to remove it) avoids
the use of `chmod -R'.  This behaviour was introduced in commit
d9bd0090cf471a088bc0119cd989c06a63d2408e, with the following
rationale:

 testsuite: do not change the mode of installed Libtool files.
 * tests/defs.in: Do not use `chmod -R' on the test directory, as
    that may change or try to change the mode of installed files:
    the test directory may contain symlinks to ltmain.sh files from
    a Libtool installation, and Solaris `chmod -R' touches symlink
    targets.  Instead, use the cleanup strategy used in distdir.am.

However, the target `clean-local-check' in `tests/Makefile.am' still
uses `chmod -R', which seems inconsistent (at best).

The attached patch should fix this.

Please note that I deliberately didn't add a NEWS entry about this
fix, as it is already present (even if the previous fix was in fact
incomplete):

  Bugs fixed in 1.11a:
  ...
  * Long standing bugs:
    ...
    - The testsuite does not try to change the mode of `ltmain.sh'
      files from a Libtool installation (symlinked to test directories)
      any more.
   ...

Regards,
   Stefano
From 1077034a9780b44b6ad992cf1d0ea61579038aa2 Mon Sep 17 00:00:00 2001
From: Stefano Lattarini <stefano.lattar...@gmail.com>
Date: Tue, 6 Oct 2009 17:01:23 +0200
Subject: [PATCH] Testsuite: do not use `chmod -R' when cleaning up.

* tests/Makefile.am (clean-local-check): Do not use `chmod -R' on
the test directories, as that may change or try to change the mode
of installed files: the test directory may contain symlinks to
ltmain.sh files from a Libtool installation, and Solaris `chmod -R'
touches symlink targets.  Instead, use the cleanup strategy used
in distdir.am (which is also employed in tests/defs.in).
---
 ChangeLog         |   10 ++++++++++
 tests/Makefile.am |    6 +++++-
 tests/Makefile.in |    6 +++++-
 3 files changed, 20 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index c76e559..9aabfdd 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2009-10-06  Stefano Lattarini  <stefano.lattar...@gmail.com>
+
+	Testsuite: do not use `chmod -R' when cleaning up.
+	* tests/Makefile.am (clean-local-check): Do not use `chmod -R' on
+	the test directories, as that may change or try to change the mode
+	of installed files: the test directory may contain symlinks to
+	ltmain.sh files from a Libtool installation, and Solaris `chmod -R'
+	touches symlink targets.  Instead, use the cleanup strategy used
+	in distdir.am (which is also employed in tests/defs.in).
+
 2009-09-25  Ralf Wildenhues  <ralf.wildenh...@gmx.de>
 
 	Use silent-rules for building the Automake package.
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 7f6910b..c1bf53a 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -745,5 +745,9 @@ check_SCRIPTS = defs defs-p aclocal-$(APIVERSION) automake-$(APIVERSION)
 clean-local: clean-local-check
 .PHONY: clean-local-check
 clean-local-check:
-	-chmod -R u+rwx *.dir
+	-for d in *.dir; do \
+	   if test -d "$$d"; then \
+	     find "$$d" -type d '!' -perm -200 -exec chmod u+w {} ';'; \
+	   else :; fi; \
+	done
 	-rm -rf defs-p *.dir
diff --git a/tests/Makefile.in b/tests/Makefile.in
index de86e68..e49fe47 100644
--- a/tests/Makefile.in
+++ b/tests/Makefile.in
@@ -1345,7 +1345,11 @@ defs-p: defs Makefile.am
 clean-local: clean-local-check
 .PHONY: clean-local-check
 clean-local-check:
-	-chmod -R u+rwx *.dir
+	-for d in *.dir; do \
+	   if test -d "$$d"; then \
+	     find "$$d" -type d '!' -perm -200 -exec chmod u+w {} ';'; \
+	   else :; fi; \
+	done
 	-rm -rf defs-p *.dir
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
-- 
1.6.3.3

Reply via email to