From d24a21844d9cd44eb8b59c8a8232648e9917bd23 Mon Sep 17 00:00:00 2001 From: "preed%mozilla.com" Date: Tue, 18 Sep 2007 23:38:06 +0000 Subject: [PATCH] Bug 387970: Tag the changes to the TinderConfig files. git-svn-id: svn://10.0.0.236/trunk@236264 18797224-902f-48f8-a5cc-f745e15eee43 --- .../release/Bootstrap/Step/TinderConfig.pm | 76 ++++++++++++++++--- 1 file changed, 65 insertions(+), 11 deletions(-) diff --git a/mozilla/tools/release/Bootstrap/Step/TinderConfig.pm b/mozilla/tools/release/Bootstrap/Step/TinderConfig.pm index 578ea0e857f..57c0c900bb8 100644 --- a/mozilla/tools/release/Bootstrap/Step/TinderConfig.pm +++ b/mozilla/tools/release/Bootstrap/Step/TinderConfig.pm @@ -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,