From: Stefano Lattarini Date: Sat, 2 Jun 2012 13:36:55 +0000 (+0200) Subject: [ng] clean: do not ignore errors while removing files X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6c5d0d3a8b805f8e4fa9808ed75722e654bfae87;p=thirdparty%2Fautomake.git [ng] clean: do not ignore errors while removing files Possible culprits have been identified with the command "git grep '-rm\b'". * NG-NEWS: Update. * lib/am/tags.am, lib/am/distdir.am, lib/am/dejagnu.am, lib/am/clean.am: Do not prefix recipes invoking "rm" with the "-" recipe modifier: we now want the cleaning recipes to fail if rm encounters an error. Signed-off-by: Stefano Lattarini --- diff --git a/NG-NEWS b/NG-NEWS index 0e42863d1..8e77df7bb 100644 --- a/NG-NEWS +++ b/NG-NEWS @@ -383,6 +383,9 @@ Miscellaneous has been renamed to AM_DEFAULT_INCLUDES, to avoid impinging on the user's namespace. Do not override this variable in your Makefiles! +* The Automake-generated clean targets do not exit successfully anymore if + an error occurs while removing a file or directory. + ----- Copyright (C) 2012 Free Software Foundation, Inc. diff --git a/lib/am/clean.am b/lib/am/clean.am index 67284e80a..8c739a21c 100644 --- a/lib/am/clean.am +++ b/lib/am/clean.am @@ -14,8 +14,8 @@ ## You should have received a copy of the GNU General Public License ## along with this program. If not, see . -.am.clean-cmd.f = $(if $(strip $1),-rm -f $(strip $1)) -.am.clean-cmd.d = $(if $(strip $1),-rm -rf $(strip $1)) +.am.clean-cmd.f = $(if $(strip $1),rm -f $(strip $1)) +.am.clean-cmd.d = $(if $(strip $1),rm -rf $(strip $1)) am__mostlyclean_files += $(MOSTLYCLEANFILES) am__clean_files += $(CLEANFILES) @@ -66,9 +66,9 @@ maintainer-clean-generic: ## used to do this, and it's not unreasonable to expect user-defined ## rules might do that as well). distclean: - -rm -f %MAKEFILE% $(am__config_distclean_files) + rm -f %MAKEFILE% $(am__config_distclean_files) maintainer-clean: - -rm -f %MAKEFILE% $(am__config_distclean_files) + rm -f %MAKEFILE% $(am__config_distclean_files) .PHONY: clean mostlyclean distclean maintainer-clean \ clean-generic mostlyclean-generic distclean-generic maintainer-clean-generic diff --git a/lib/am/dejagnu.am b/lib/am/dejagnu.am index c659f87d9..cb8894973 100644 --- a/lib/am/dejagnu.am +++ b/lib/am/dejagnu.am @@ -73,7 +73,7 @@ site.exp: Makefile $(EXTRA_DEJAGNU_SITE_CONFIG) @if test -f site.exp; then \ sed -e '1,/^## End of auto-generated content.*##/d' site.exp >> site.tmp; \ fi - @-rm -f site.bak + @rm -f site.bak @test ! -f site.exp || mv site.exp site.bak @mv site.tmp site.exp diff --git a/lib/am/distdir.am b/lib/am/distdir.am index 51cd80a0a..79d24ffb9 100644 --- a/lib/am/distdir.am +++ b/lib/am/distdir.am @@ -363,7 +363,7 @@ dist-shar: distdir ?ZIP?DIST_ARCHIVES += $(distdir).zip .PHONY: dist-zip dist-zip: distdir - -rm -f $(distdir).zip + rm -f $(distdir).zip zip -rq $(distdir).zip $(distdir) $(am__post_remove_distdir) diff --git a/lib/am/tags.am b/lib/am/tags.am index ffbc1351e..2abd56303 100644 --- a/lib/am/tags.am +++ b/lib/am/tags.am @@ -144,7 +144,7 @@ cscope: cscope.files || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS) clean-cscope: - -rm -f cscope.files + rm -f cscope.files cscope.files: clean-cscope %CSCOPEDIRS% cscopelist