This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] be more robust when `make stage' fails


This patch avoids that the build goes on if `make stage' fails. Thee `test -f && command || :' idiom is not ok if the command can fail, because in that case you won't notice when that happens.

This hid the other bug I'm sending a patch for, on CodeSourcery's testing system (reported by Dan and Joseph on IRC).

Paolo
Index: Makefile.tpl
===================================================================
--- Makefile.tpl	(revision 108633)
+++ Makefile.tpl	(working copy)
@@ -1212,7 +1212,7 @@ stage = :
 
 @if gcc-bootstrap
 unstage = [ -f stage_current ] || $(MAKE) `cat stage_last`-start
-stage = [ -f stage_current ] && $(MAKE) `cat stage_current`-end || :
+stage = if [ -f stage_current ]; then $(MAKE) `cat stage_current`-end; else exit 1; fi
 @endif gcc-bootstrap
 
 .PHONY: unstage stage

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]