[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] Testsuite: do not use `chmod -R' when cleaning up.
From: |
Ralf Wildenhues |
Subject: |
Re: [PATCH] Testsuite: do not use `chmod -R' when cleaning up. |
Date: |
Tue, 6 Oct 2009 21:48:48 +0200 |
User-agent: |
Mutt/1.5.20 (2009-08-09) |
Hi Stefano,
* Stefano Lattarini wrote on Tue, Oct 06, 2009 at 05:08:11PM CEST:
> 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).
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?
Thanks,
Ralf