move tarball creation into bootstrap b=394034 r=joduinn

This commit is contained in:
rhelmer@mozilla.com 2007-10-03 12:45:43 -07:00
Родитель 047764d565
Коммит 9f18285069
2 изменённых файлов: 46 добавлений и 6 удалений

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

@ -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;

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

@ -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