From 1794e6b4c990537b51a2002b25dff1f0ebaa9e35 Mon Sep 17 00:00:00 2001 From: scc Date: Wed, 20 May 1998 23:09:53 +0000 Subject: [PATCH] Added StopForErrors() and DontStopForErrors(). The former is the default, though logging must be on to allow errors to be noticed. git-svn-id: svn://10.0.0.236/trunk@2066 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/build/mac/Moz.pm | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/mozilla/build/mac/Moz.pm b/mozilla/build/mac/Moz.pm index 467fb151609..d85cc6511a4 100644 --- a/mozilla/build/mac/Moz.pm +++ b/mozilla/build/mac/Moz.pm @@ -22,7 +22,7 @@ require Exporter; @ISA = qw(Exporter); @EXPORT = qw(); -@EXPORT_OK = qw(BuildProject,OpenErrorLog,CloseErrorLog,UseCodeWarriorLib,Configure); +@EXPORT_OK = qw(BuildProject,OpenErrorLog,CloseErrorLog,UseCodeWarriorLib,Configure,StopForErrors,DontStopForErrors); use Cwd; @@ -76,6 +76,7 @@ sub Configure($) $logging = 0; $recent_errors_file = ""; +$stop_on_1st_error = 1; sub CloseErrorLog() { @@ -103,6 +104,16 @@ sub OpenErrorLog($) } } +sub StopForErrors() + { + $stop_on_1st_error = 1; + } + +sub DontStopForErrors() + { + $stop_on_1st_error = 0; + } + sub log_message($) { if ( $logging ) @@ -124,18 +135,30 @@ sub log_message_with_time($) sub log_recent_errors() { + my $found_errors = 0; + if ( $logging ) { open(RECENT_ERRORS, "<$recent_errors_file"); while( ) { + if ( $_ =~ m/^Error/ ) + { + $found_errors = 1; + } print ERROR_LOG $_; } close(RECENT_ERRORS); unlink("$recent_errors_file"); } + + if ( $stop_on_1st_error && $found_errors ) + { + print ERROR_LOG "### Build failed.\n"; + die "### Build failed with errors, stopped"; + } } sub BuildProject($;$)