From 9f18285069aa9738f988739f7688d794c98b08c5 Mon Sep 17 00:00:00 2001 From: "rhelmer@mozilla.com" Date: Wed, 3 Oct 2007 12:45:43 -0700 Subject: [PATCH] move tarball creation into bootstrap b=394034 r=joduinn --- tools/release/Bootstrap/Step/Source.pm | 51 +++++++++++++++++++++++--- tools/release/bootstrap.cfg.example | 1 + 2 files changed, 46 insertions(+), 6 deletions(-) diff --git a/tools/release/Bootstrap/Step/Source.pm b/tools/release/Bootstrap/Step/Source.pm index 2df7e150016..45c7b660f03 100644 --- a/tools/release/Bootstrap/Step/Source.pm +++ b/tools/release/Bootstrap/Step/Source.pm @@ -6,6 +6,7 @@ package Bootstrap::Step::Source; use Bootstrap::Step; use Bootstrap::Config; use File::Copy qw(move); +use File::Find qw(find); use MozBuild::Util qw(MkdirWithPath); use Bootstrap::Util qw(SyncNightlyDirToStaging); @ISA = ("Bootstrap::Step"); @@ -15,11 +16,13 @@ sub Execute { my $config = new Bootstrap::Config(); my $product = $config->Get(var => 'product'); + my $appName = $config->Get(var => 'appName'); my $productTag = $config->Get(var => 'productTag'); my $version = $config->Get(var => 'version'); my $rc = $config->Get(var => 'rc'); my $logDir = $config->Get(sysvar => 'logDir'); my $stageHome = $config->Get(var => 'stageHome'); + my $mozillaCvsroot = $config->Get(var => 'mozillaCvsroot'); # create staging area my $stageDir = catfile($stageHome, $product . '-' . $version, @@ -30,16 +33,39 @@ sub Execute { or die("Cannot create $stageDir: $!"); } - my $srcScript = $product . '-src-tarball-nobuild'; $this->Shell( - cmd => catfile($stageHome, 'bin', $srcScript), - cmdArgs => ['-r', $productTag . '_RELEASE', '-m', $version], + cmd => 'cvs', + cmdArgs => ['-d', $mozillaCvsroot, + 'co', '-r', $productTag . '_RELEASE', + 'mozilla/client.mk', catfile('mozilla', $appName, 'config')], dir => $stageDir, - logFile => catfile($logDir, 'source.log'), + logFile => catfile($logDir, 'source_checkout.log'), + ); + + $this->Shell( + cmd => 'make', + cmdArgs => ['-f', 'client.mk', 'checkout', + 'MOZ_CO_PROJECT=' . $appName], + dir => catfile($stageDir, 'mozilla'), + logFile => catfile($logDir, 'source_make.log'), + ); + + # change all CVS/Root files to anonymous CVSROOT + File::Find::find(\&CvsChrootCallback, catfile($stageDir, 'mozilla')); + + # remove leftover mozconfig files + unlink(glob(catfile($stageDir, 'mozilla', '.mozconfig*'))); + + my $tarFile = $product . '-' . $version . '-' . 'source' . '.tar.bz2'; + + $this->Shell( + cmd => 'tar', + cmdArgs => ['-cjf', $tarFile, 'mozilla'], + dir => catfile($stageDir), + logFile => catfile($logDir, 'source_tar.log'), ); - move("$stageDir/../*.bz2", $stageDir); - chmod(0644, glob("$stageDir/*.bz2")); + chmod(0644, glob("$stageDir/$tarFile")); } sub Verify { @@ -106,4 +132,17 @@ sub Announce { ); } +# Change the CVS/Root file to be the anonymous CVS Root +sub CvsChrootCallback { + my $config = new Bootstrap::Config(); + my $anonCvsroot = $config->Get(var => 'anonCvsroot'); + + my $dirent = $File::Find::name; + if ((-f $dirent) and ($dirent =~ /.*CVS\/Root$/)) { + open(FILE, "> $dirent"); + print FILE "$anonCvsroot\n"; + close(FILE); + } +} + 1; diff --git a/tools/release/bootstrap.cfg.example b/tools/release/bootstrap.cfg.example index c5110194e12..3b87620e6ec 100644 --- a/tools/release/bootstrap.cfg.example +++ b/tools/release/bootstrap.cfg.example @@ -24,6 +24,7 @@ logDir = /builds/logs mozillaCvsroot = /builds/cvsmirror/cvsroot l10nCvsroot = /builds/cvsmirror/l10n mofoCvsroot = /builds/cvsmirror/mofo +anonCvsroot = :pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot # private staging area stageHome = /data/cltbld updateDir = /builds/updates