automake-ng
[Top][All Lists]
Advanced

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

[Automake-NG] [PATCH 05/14] [ng] clean: do not ignore errors while remov


From: Stefano Lattarini
Subject: [Automake-NG] [PATCH 05/14] [ng] clean: do not ignore errors while removing files
Date: Thu, 21 Jun 2012 12:32:36 +0200

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 invoke "rm" when the "-" recipe modifier: we now want the cleaning
recipes to fail if rm encounters an error.

Signed-off-by: Stefano Lattarini <address@hidden>
---
 NG-NEWS           |    3 +++
 lib/am/clean.am   |    8 ++++----
 lib/am/dejagnu.am |    2 +-
 lib/am/distdir.am |    2 +-
 lib/am/tags.am    |    2 +-
 5 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/NG-NEWS b/NG-NEWS
index 0e42863..8e77df7 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 e1c2a0b..6ee5218 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 <http://www.gnu.org/licenses/>.
 
-.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 c659f87..cb88949 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 51cd80a..79d24ff 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 ffbc135..2abd563 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
 
-- 
1.7.9.5




reply via email to

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