зеркало из https://github.com/mozilla/pjs.git
Bug 359064: Adds --interval support to build-seamonkey.pl, so certain builds can only be run once every N seconds. r=rhelmer
This commit is contained in:
Родитель
960126a57d
Коммит
d6f924a640
|
@ -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;
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче