[Bf-committers] New project, let's move on!

Kent Mein bf-committers@blender.org
Tue, 31 Dec 2002 06:07:07 -0600


In reply to Hans Lambermont (hans@lambermont.dyndns.org):

I've updated tinderbox-blender.pl to use Mail::Send instead of system calls.
Here is the diff, should I commit it?
Also what else do we need to update in it to get things going Hans?

Kent
--
mein@cs.umn.edu

Index: tinderbox-blender.pl
===================================================================
RCS file: /cvs01/blender/intern/tools/tinderbox/tinderbox-blender.pl,v
retrieving revision 1.2
diff -u -r1.2 tinderbox-blender.pl
--- tinderbox-blender.pl	13 Oct 2002 16:07:41 -0000	1.2
+++ tinderbox-blender.pl	31 Dec 2002 12:06:01 -0000
@@ -35,6 +35,7 @@
 require 5.000;
 
 use Cwd;
+use Mail::Send;
 
 # config section variables
 use vars qw( $SEMA $VERSION $UNAME );
@@ -84,14 +85,12 @@
 	if ($UNAME eq 'Darwin') {
 		$BinaryName{'blenderplayer'} = 'blenderplayer';
 		$BinaryName{'Dblenderplayer'} = 'debug/blenderplayer';
-		$mail = '/usr/bin/mail';
 	} elsif ($UNAME eq 'CYGWIN_NT-5.0') {
 		$BinaryName{'blendercreator'} = 'blendercreator.exe';
 		$BinaryName{'Dblendercreator'} = 'debug/blendercreator.exe';
 		$BinaryName{'blenderpublisher'} = 'blenderpublisher.exe';
 		$BinaryName{'Dblenderpublisher'} = 'debug/blenderpublisher.exe';
 		$BinaryName{'blenderplugin'} = 'npB3DPlg.dll';
-		$mail = '/usr/local/bin/blat.exe';
 	} else {
 		$BinaryName{'blendercreator'} = 'blendercreator';
 		$BinaryName{'Dblendercreator'} = 'debug/blendercreator';
@@ -99,7 +98,6 @@
 		$BinaryName{'Dblenderpublisher'} = 'debug/blenderpublisher';
 		$BinaryName{'blenderplugin'} = 'npBlender3DPlugin.so';
 		$BinaryName{'blenderpluginXPCOM'} = 'Blender3DPlugin.so';
-		$mail = '/usr/bin/mail';
 	}
 
     # Set these to what makes sense for your system
@@ -111,7 +109,7 @@
     $Tinderbox_server = 'tinderbox\@cvs.intra.blender.nl';
 
     # These shouldn't really need to be changed
-    $BuildSleep = 15; # Minimum wait period from start of build to start
+    $BuildSleep = 300; # Minimum wait period from start of build to start
                       # of next build in minutes (default 10)
     $BuildTree = '';
     $BuildTag = '';
@@ -145,7 +143,7 @@
 sub SetupEnv {
     umask(0);
     $ENV{"CVSROOT"} = ':pserver:tinderbox@cvs.intra.blender.nl:/home/cvs';
-    $ENV{"SRCHOME"} = "$ENV{'HOME'}/develop/source";
+    $ENV{"SRCHOME"} = "$ENV{'HOME'}/blender";
     $ENV{"MAKEFLAGS"} = "-w -I $ENV{'SRCHOME'} --no-print-directory";
 } #EndSub-SetupEnv
 
@@ -437,9 +435,13 @@
 # This was replaced by a perl 'port' of the above, writen by 
 # preed@netscape.com; good things: no need for system() call, and now it's
 # all in perl, so we don't have to do OS checking like before.
+        $msg = new Mail::Send;
+
+        $msg->subject("Tinderbox Report"); 
+        $msg->to($Tinderbox_server);
+        $fh = $msg->open;
 
 	open(LOG, "$logfile") || die "Couldn't open logfile: $!\n";
-	open(OUTLOG, ">${logfile}.last") || die "Couldn't open logfile: $!\n";
 	    
 	while (<LOG>) {
 	    $q = 0;
@@ -452,22 +454,15 @@
 		
 		$Output =~ s/^\.$//g;
 		$Output =~ s/\n//g;
-		print OUTLOG "$Output\n";
+		print $fh "$Output\n";
 		$q++;
 	    } #EndFor
 		
 	} #EndWhile
 	    
 	close(LOG);
-	close(OUTLOG);
+        $fh->close;
 
-	if ($UNAME eq 'CYGWIN_NT-5.0') {
-		system( "$mail ${logfile}.last -server cvs -f tinderbox\@win2k -t $Tinderbox_server" )
-			if ($ReportStatus );
-	} else {
-		system( "$mail $Tinderbox_server < ${logfile}.last" )
-			if ($ReportStatus );
-	}
 	unlink("$logfile");
 	
 	# if this is a test run, set early_exit to 0. 
@@ -492,26 +487,22 @@
 
     @felist = split(/,/, $FE);
 
-	if ($UNAME eq 'CYGWIN_NT-5.0') {
-		open( STARTBUILDLOG, ">startbuildlog" ) || print "can't open $?\n";
-	} else {
-		open( STARTBUILDLOG, "|$mail $Tinderbox_server" );
-	}
+    $msg = new Mail::Send;
+    $msg->subject("Tinderbox Report: Startbuildlog");
+    $msg->to($Tinderbox_server);
+    $fh = $msg->open;
     foreach $fe ( @felist ) {
-		print STARTBUILDLOG "\n";
-		print STARTBUILDLOG "tinderbox: tree: $BuildTree\n";
-		print STARTBUILDLOG "tinderbox: builddate: $StartTime\n";
-		print STARTBUILDLOG "tinderbox: status: building\n";
-		print STARTBUILDLOG "tinderbox: build: $BuildName $fe\n";
-		print STARTBUILDLOG "tinderbox: errorparser: unix\n";
-		print STARTBUILDLOG "tinderbox: buildfamily: unix\n";
-		print STARTBUILDLOG "tinderbox: END\n";
-		print STARTBUILDLOG "\n";
+		print $fh "\n";
+		print $fh "tinderbox: tree: $BuildTree\n";
+		print $fh "tinderbox: builddate: $StartTime\n";
+		print $fh "tinderbox: status: building\n";
+		print $fh "tinderbox: build: $BuildName $fe\n";
+		print $fh "tinderbox: errorparser: unix\n";
+		print $fh "tinderbox: buildfamily: unix\n";
+		print $fh "tinderbox: END\n";
+		print $fh "\n";
     }
-    close( STARTBUILDLOG );
-	if ($UNAME eq 'CYGWIN_NT-5.0') {
-		system ( "$mail startbuildlog -server cvs -f tinderbox\@win2k -t $Tinderbox_server" );
-	}
+    $fh->close;
 	print LOG "StartBuildLog mailed to $Tinderbox_server\n";
 } #EndSub-StartBuild