Bug 387970: Tag the changes to the TinderConfig files.

This commit is contained in:
preed@mozilla.com 2007-09-18 16:38:06 -07:00
Родитель facba260b9
Коммит d5acb9e1ae
1 изменённых файлов: 65 добавлений и 11 удалений

Просмотреть файл

@ -6,7 +6,8 @@ package Bootstrap::Step::TinderConfig;
use Bootstrap::Step;
use Bootstrap::Config;
use Bootstrap::Util qw(CvsCatfile);
use Bootstrap::Util qw(CvsCatfile CvsTag);
use MozBuild::TinderLogParse;
use MozBuild::Util qw(MkdirWithPath);
@ -19,6 +20,7 @@ sub Execute {
my $configBumpDir = $config->Get(var => 'configBumpDir');
my $productTag = $config->Get(var => 'productTag');
my $version = $config->Get(var => 'version');
my $rc = int($config->Get(var => 'rc'));
my $mozillaCvsroot = $config->Get(var => 'mozillaCvsroot');
my $product = $config->Get(var => 'product');
my $logDir = $config->Get(sysvar => 'logDir');
@ -27,38 +29,82 @@ sub Execute {
my $releaseTag = $productTag . '_RELEASE';
MkdirWithPath(dir => $configBumpDir)
or die("Cannot mkdir $configBumpDir: $!");
my $productConfigBumpDir = catfile($configBumpDir,
"$product-$version-rc$rc");
if (-e $productConfigBumpDir) {
die "ASSERT: Step::TinderConfig::Execute(): $productConfigBumpDir " .
'already exists?';
}
MkdirWithPath(dir => $productConfigBumpDir)
or die("Cannot mkdir $productConfigBumpDir: $!");
foreach my $branch ($branchTag . '_release', $branchTag . '_l10n_release') {
$this->Shell(
cmd => 'cvs',
cmdArgs => ['-d', $mozillaCvsroot,
'co', '-d', 'tinderbox-configs',
'co', '-d', $branch,
'-r', $branch,
CvsCatfile('mozilla', 'tools', 'tinderbox-configs',
$product, $osname)],
logFile => catfile($logDir,
'build_config-checkout-' . $branch . '.log'),
dir => $configBumpDir,
dir => $productConfigBumpDir,
);
foreach my $configFile ('tinder-config.pl', 'mozconfig') {
my @bumpConfigFiles = qw(tinder-config.pl mozconfig);
foreach my $configFile (@bumpConfigFiles) {
$config->Bump( configFile =>
catfile($configBumpDir, 'tinderbox-configs', $configFile));
catfile($productConfigBumpDir, $branch, $configFile));
$this->Shell(
cmd => 'cvs',
cmdArgs => ['-d', $mozillaCvsroot,
'ci', '-m',
'"Automated configuration bump, release for '
. $product . ' ' . $version . '"',
CvsCatfile('tinderbox-configs', $configFile)],
. $product . ' ' . $version . "rc$rc" . '"',
$configFile],
logFile => catfile($logDir,
'build_config-checkin-' . $configFile . '-' .
$branch . '.log'),
dir => catfile($configBumpDir),
dir => catfile($productConfigBumpDir, $branch)
);
}
my @tagNames = ($productTag . '_RELEASE',
$productTag . '_RC' . $rc);
foreach my $configTagName (@tagNames) {
# XXX - Don't like doing this this way (specifically, the logic
# change depending on the name of the branch in this loop...)
#
# Also, the force argument to CvsTag() is interesting; we only
# want to cvs tag -F a whatever_RELEASE tag if we're not tagging
# the first RC; so, the logic is (rc > 1 && we're doing a _RELEASE
# tag; also, we have to surround it in int(); otherwise, if it's
# false, we get the empty string, which is undef which is bad.
$configTagName .= '_l10n' if ($branch =~ /l10n/);
my $rv = CvsTag(tagName => $configTagName,
force => int($rc > 1 &&
$configTagName =~ /_RELEASE/),
files => \@bumpConfigFiles,
cvsDir => catfile($productConfigBumpDir,
$branch),
logFile => catfile($logDir, 'build_config-tag-' .
$branch . '.log'),
output => 1
);
if ($rv->{'timedOut'} || ($rv->{'exitValue'} != 0)) {
$this->Log(msg => "CvsTag() in TinderConfig() failed; " .
"tag: $configTagName, rv: $rv->{'exitValue'}, " .
"timeout: $rv->{'timedOut'}, output: $rv->{'output'}");
die("Bootstrap::Step::TinderConfig tag failed: "
. $rv->{'exitValue'});
}
}
}
}
@ -70,16 +116,24 @@ sub Verify {
my $logDir = $config->Get(sysvar => 'logDir');
foreach my $branch ($branchTag . '_release', $branchTag . '_l10n_release') {
$this->CheckLog(
log => catfile($logDir,
'build_config-checkout-' . $branch . '.log'),
notAllowed => 'fail',
);
$this->CheckLog(
log => catfile($logDir,
'build_config-checkout-' . $branch . '.log'),
notAllowed => 'aborted',
);
$this->CheckLog(
log => catfile($logDir, 'build_config-tag-' . $branch . '.log'),
checkFor => '^T',
);
foreach my $configFile ('mozconfig', 'tinder-config.pl') {
$this->CheckLog(
log => catfile($logDir,