From cf3de94c6bea73f0c15f1e251c2619306837e288 Mon Sep 17 00:00:00 2001 From: "nrthomas@gmail.com" Date: Wed, 27 Jun 2007 03:46:27 -0700 Subject: [PATCH] Bug 378226, Push support for Source step, r=rhelmer --- tools/release/Bootstrap/Step/Source.pm | 51 +++++++++++++++++++++++--- 1 file changed, 46 insertions(+), 5 deletions(-) diff --git a/tools/release/Bootstrap/Step/Source.pm b/tools/release/Bootstrap/Step/Source.pm index b02713f82171..63cd50eada73 100644 --- a/tools/release/Bootstrap/Step/Source.pm +++ b/tools/release/Bootstrap/Step/Source.pm @@ -43,7 +43,51 @@ sub Execute { sub Verify { my $this = shift; - # TODO verify source archive + + my $config = new Bootstrap::Config(); + my $logDir = $config->Get(var => 'logDir'); + + my $logFile = catfile($logDir, 'source.log'); + + $this->CheckLog( + log => $logFile, + checkFor => '^checkout finish', + ); + + $this->CheckLog( + log => $logFile, + notAllowed => '^tar', + ); +} + +sub Push { + my $this = shift; + + my $config = new Bootstrap::Config(); + my $product = $config->Get(var => 'product'); + my $version = $config->Get(var => 'version'); + my $rc = $config->Get(var => 'rc'); + my $logDir = $config->Get(var => 'logDir'); + my $stageHome = $config->Get(var => 'stageHome'); + + my $stageDir = catfile($stageHome, $product . '-' . $version); + my $candidateDir = catfile('/home', 'ftp', 'pub', $product, 'nightly', + $version . '-candidates', 'rc' . $rc ) . '/'; + + if (not -d $candidateDir) { + MkdirWithPath(dir => $candidateDir) + or die("Could not mkdir $candidateDir: $!"); + $this->Log(msg => "Created directory $candidateDir"); + } + + $this->Shell( + cmd => 'rsync', + cmdArgs => ['-av', catfile('batch-source', 'rc' . $rc, + $product . '-' . $version . '-source.tar.bz2'), + $candidateDir], + logFile => catfile($logDir, 'source.log'), + dir => catfile($stageDir), + ); } sub Announce { @@ -52,13 +96,10 @@ sub Announce { my $config = new Bootstrap::Config(); my $product = $config->Get(var => 'product'); my $version = $config->Get(var => 'version'); - my $logDir = $config->Get(var => 'logDir'); - - my $logFile = catfile($logDir, 'source.log'); $this->SendAnnouncement( subject => "$product $version source step finished", - message => "$product $version source archive is ready to be copied to the candidates dir.", + message => "$product $version source archive was copied to the candidates dir.", ); }