common/tools/raptor/RaptorError.pm
changeset 324 f1baeb3f075f
parent 244 9544c55a7fd0
child 327 61f2add750f0
--- a/common/tools/raptor/RaptorError.pm	Tue Jul 21 13:32:34 2009 +0100
+++ b/common/tools/raptor/RaptorError.pm	Wed Jul 22 10:58:34 2009 +0100
@@ -27,6 +27,7 @@
 
 $buildlog_status->{name} = 'buildlog_status';
 $buildlog_status->{next_status} = {error=>$buildlog_error_status};
+$buildlog_status->{on_start} = 'RaptorError::on_start_buildlog';
 
 $buildlog_error_status->{name} = 'buildlog_error_status';
 $buildlog_error_status->{next_status} = {};
@@ -66,10 +67,21 @@
 	}
 }
 
+sub on_start_buildlog
+{
+	RaptorCommon::init();
+	
+	$filename = "$::basedir/errors.txt";
+	if (!-f$filename)
+	{
+		print "Writing error file $filename\n";
+		open(FILE, ">$filename");
+		close(FILE);
+	}
+}
+
 sub on_start_buildlog_error
 {
-	$filename = "$::basedir/errors.txt";
-	print "Writing error file $filename\n" if (!-f$filename);
 	open(FILE, ">>$filename");
 }