At Tuesday 06 October 2009, Ralf Wildenhues <ralf.wildenh...@gmx.de> 
wrote:
> Hi Stefano,
>
> [CUT]
> Thanks for the patch and the explanations.  One question/nit:
> > --- 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
>
> Any reason against using
>   -find *.dir -type d '!' -perm -200 -exec chmod u+w {} ';' 2>/dev/null
>
> or, if you care about error messages other than "find: `*.dir': No
> such file or directory", then maybe something like
>   -set x *.dir; shift; \
>    if test "$$#,$$1" != "1,*.dir"; then \
>      find "$$@" -type d '!' -perm -200 -exec chmod u+w {} ';'; \
>    else :; fi
>
> to avoid lots of forking in the "normal" case?
No reason at all.  I just thought that avoiding forks was not important
here.  I have amended and resent my patch.  I have also changed your
fix sligthly, to make it even clearer (IMHO).

Regards,
    Stefano
From 73fb9764019046d3d2dbd40dc711c8c8a0293b27 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 |   10 ++++++++--
 tests/Makefile.in |   10 ++++++++--
 3 files changed, 26 insertions(+), 4 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index c76e559..6803f0e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2009-10-07  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..6f8b977 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -745,5 +745,11 @@ 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
-	-rm -rf defs-p *.dir
+	-set x *.dir; shift; \
+	 if test "$$#,$$1" = "1,*.dir"; then \
+	   : there is no test directory to clean; \
+	 else \
+	   find "$$@" -type d '!' -perm -200 -exec chmod u+w {} ';'; \
+	   rm -rf "$$@"; \
+	 fi;
+	-rm -f defs-p
diff --git a/tests/Makefile.in b/tests/Makefile.in
index de86e68..479bcfd 100644
--- a/tests/Makefile.in
+++ b/tests/Makefile.in
@@ -1345,8 +1345,14 @@ defs-p: defs Makefile.am
 clean-local: clean-local-check
 .PHONY: clean-local-check
 clean-local-check:
-	-chmod -R u+rwx *.dir
-	-rm -rf defs-p *.dir
+	-set x *.dir; shift; \
+	 if test "$$#,$$1" = "1,*.dir"; then \
+	   : there is no test directory to clean; \
+	 else \
+	   find "$$@" -type d '!' -perm -200 -exec chmod u+w {} ';'; \
+	   rm -rf "$$@"; \
+	 fi;
+	-rm -f defs-p
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
-- 
1.6.3.3

Reply via email to