From 36175be02d8d0cca0269048106053bde95e98b72 Mon Sep 17 00:00:00 2001 From: "mcafee%netscape.com" Date: Fri, 22 Oct 1999 20:31:56 +0000 Subject: [PATCH] Fixing some mis-use error cases, adding comments. Added --testonly flag. code=slamm, r=mcafee --- tools/tinderbox/build-seamonkey.pl | 93 +++++++++++++++++++----------- 1 file changed, 58 insertions(+), 35 deletions(-) diff --git a/tools/tinderbox/build-seamonkey.pl b/tools/tinderbox/build-seamonkey.pl index 2484d415bd70..f53c750ebbe2 100755 --- a/tools/tinderbox/build-seamonkey.pl +++ b/tools/tinderbox/build-seamonkey.pl @@ -6,14 +6,30 @@ use Sys::Hostname; use POSIX "sys_wait_h"; use Cwd; -$Version = '$Revision: 1.12 $ '; +$Version = '$Revision: 1.13 $ '; sub PrintUsage { - die "usage: $0 --depend --clobber --once --manual\n" - ." --classic --compress --example-config --noreport --notest\n" - ." --timestamp -tag TREETAG -t TREENAME\n" - ." --configfile CONFIGFILENAME --version --testonly\n"; + die <$logfile" || print "can't open $?\n"; + open LOG, ">$logfile" or print "can't open $?\n"; print LOG "current dir is -- " . $ENV{HOST} . ":$CurrentDir\n"; print LOG "Build Administrator is $BuildAdministrator\n"; &PrintEnv; @@ -402,12 +422,12 @@ sub BuildIt { $BuildStatus = 0; mkdir $TopLevel, 0777; - chdir $TopLevel || die "chdir($TopLevel): $!\n"; - - if (!$TestOnly) { + chdir $TopLevel or die "chdir($TopLevel): $!\n"; + + unless ($TestOnly) { print "$CVS $CVSCO mozilla/client.mk\n"; print LOG "$CVS $CVSCO mozilla/client.mk\n"; - open PULL, "$CVS $CVSCO mozilla/client.mk 2>&1 |" || die "open: $!\n"; + open PULL, "$CVS $CVSCO mozilla/client.mk 2>&1 |" or die "open: $!\n"; while () { print $_; print LOG $_; @@ -415,10 +435,10 @@ sub BuildIt { close PULL; } - chdir $Topsrcdir || die "chdir $Topsrcdir: $!\n"; + chdir $Topsrcdir or die "chdir $Topsrcdir: $!\n"; # Let us delete the binaries before rebuilding - if (!$TestOnly) { + unless ($TestOnly) { @felist = split /,/, $FE; foreach $fe (@felist) { @@ -431,18 +451,18 @@ sub BuildIt { $ENV{MOZ_CO_DATE} = "$BuildStart" if $UseTimeStamp; - # If we are building depend, don't clobber. - if ($BuildDepend) { - print LOG "$Make -f client.mk\n"; - open MAKEDEPEND, "$Make -f client.mk 2>&1 |"; - while () { - print $_; - print LOG $_; - } - close MAKEDEPEND; - } else { - # Building clobber - if (!$TestOnly) { + # If we are building depend, don't clobber. + unless ($TestOnly) { + if ($BuildDepend) { + print LOG "$Make -f client.mk\n"; + open MAKEDEPEND, "$Make -f client.mk 2>&1 |"; + while () { + print $_; + print LOG $_; + } + close MAKEDEPEND; + } else { + # Building clobber print LOG "$Make -f client.mk checkout clean build 2>&1 |\n"; open MAKECLOBBER, "$Make -f client.mk checkout clean build 2>&1 |"; while () { @@ -458,7 +478,7 @@ sub BuildIt { if ($RunTest) { print LOG "export binary exists, build successful. Testing...\n"; $BuildStatus = &RunSmokeTest($fe); - if ($BuildStatus == 0 && defined($BloatStats) && $BloatStats) { + if ($BuildStatus == 0 and $BloatStats) { $BuildStatusStr = 'success'; print LOG "export binary exists, build successful. Gathering bloat stats...\n"; $BuildStatus = &RunBloatTest($fe); @@ -504,8 +524,8 @@ sub BuildIt { # 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. # - open LOG, "$logfile" || die "Couldn't open logfile: $!\n"; - open OUTLOG, ">${logfile}.last" || die "Couldn't open logfile: $!\n"; + open LOG, "$logfile" or die "Couldn't open logfile: $!\n"; + open OUTLOG, ">${logfile}.last" or die "Couldn't open logfile: $!\n"; while () { for ($q = 0; ; $q++) { @@ -578,7 +598,7 @@ sub DeleteBinary { $BinName = "$BuildDir/$TopLevel/${Topsrcdir}$BinaryName{$fe}"; print LOG "unlinking $BinName\n"; - unlink $BinName || print LOG "unlinking $BinName failed\n"; + unlink $BinName or print LOG "unlinking $BinName failed\n"; } sub PrintEnv { @@ -806,3 +826,6 @@ $ConfigGuess = './build/autoconf/config.guess'; $Logfile = '${BuildDir}.log'; $Compiler = 'gcc'; $ShellOverride = ''; # Only used if the default shell is too stupid + +# Need to end with a true value, (since we're using "require"). +1;