diff --git a/tools/tinderbox/build-seamonkey-util.pl b/tools/tinderbox/build-seamonkey-util.pl index 1a2f71ea509..a83e52d1a94 100644 --- a/tools/tinderbox/build-seamonkey-util.pl +++ b/tools/tinderbox/build-seamonkey-util.pl @@ -24,7 +24,7 @@ use Config; # for $Config{sig_name} and $Config{sig_num} use File::Find (); use File::Copy; -$::UtilsVersion = '$Revision: 1.338 $ '; +$::UtilsVersion = '$Revision: 1.339 $ '; package TinderUtils; @@ -144,6 +144,7 @@ Options: --config-cvsup-dir DIR Provide a directory of configuration files (mozconfig, etc.) to run a "cvs update" in before a build begins. + --interval Limit this build to building once every N seconds --version Print the version number (same as cvs revision). --help More details: @@ -179,6 +180,7 @@ sub ParseArgs { -t BuildTree --mozconfig MozConfigFileName --config-cvsup-dir TboxBuildConfigDir + --interval BuildInterval ); if (defined $args_with_options{$arg}) { my $arg_arg = shift @ARGV; diff --git a/tools/tinderbox/build-seamonkey.pl b/tools/tinderbox/build-seamonkey.pl index 25d242d79ae..0478600f3c4 100755 --- a/tools/tinderbox/build-seamonkey.pl +++ b/tools/tinderbox/build-seamonkey.pl @@ -12,11 +12,28 @@ use strict; # They are not initialized here. The default values are after "__END__". $TreeSpecific::name = $TreeSpecific::build_target = $TreeSpecific::checkout_target = $TreeSpecific::clobber_target = $::Version = undef; -$::Version = '$Revision: 1.103 $ '; +$::Version = '$Revision: 1.104 $ '; { TinderUtils::Setup(); tree_specific_overides(); + + # This code assumes that the build process will alter the mtime of the + # "build directory" (i.e. WINNT_5.2_Dep, Darwin_8.1.0_Clbr, etc.) by + # dumping a log file or some such in the directory. If that's not the + # case, then this "feature" won't work. + if (defined($Settings::BuildInterval) && $Settings::BuildInterval > 0) { + print STDERR "Build interval of $Settings::BuildInterval seconds requested\n"; + my $lastBuilt = (stat($Settings::DirName))[9]; ## Magic 9 is st_mtime + my $now = time(); + + if (($now - $Settings::BuildInterval) < $lastBuilt) { + print STDERR 'Last built at ' . scalar(localtime($lastBuilt)) . + ', ' . ($now - $lastBuilt) . " seconds ago; not building.\n"; + TinderUtils::stop_tinderbox(reason => 'Build interval not expired'); + } + } + TinderUtils::Build(); }