2007-03-22 10:30:00 -07:00
|
|
|
#
|
|
|
|
# Repack step. Unpacks, modifies, repacks a Firefox en-US build.
|
|
|
|
# Primary use is for l10n (localization) builds.
|
|
|
|
#
|
|
|
|
package Bootstrap::Step::Repack;
|
|
|
|
use Bootstrap::Step;
|
|
|
|
use Bootstrap::Config;
|
2007-10-01 20:00:18 -07:00
|
|
|
use Bootstrap::Util qw(CvsCatfile SyncNightlyDirToStaging);
|
2007-03-22 10:30:00 -07:00
|
|
|
use MozBuild::Util qw(MkdirWithPath);
|
|
|
|
@ISA = ("Bootstrap::Step");
|
|
|
|
|
|
|
|
sub Execute {
|
|
|
|
my $this = shift;
|
|
|
|
|
|
|
|
my $config = new Bootstrap::Config();
|
2007-03-25 16:54:25 -07:00
|
|
|
my $l10n_buildDir = $config->Get(sysvar => 'l10n_buildDir');
|
2007-03-22 10:30:00 -07:00
|
|
|
my $productTag = $config->Get(var => 'productTag');
|
|
|
|
my $rc = $config->Get(var => 'rc');
|
2007-08-10 16:30:01 -07:00
|
|
|
my $logDir = $config->Get(sysvar => 'logDir');
|
2007-03-25 16:56:37 -07:00
|
|
|
my $l10n_buildPlatform = $config->Get(sysvar => 'l10n_buildPlatform');
|
2007-10-01 09:55:46 -07:00
|
|
|
my $osname = $config->SystemInfo(var => 'osname');
|
2007-03-22 10:30:00 -07:00
|
|
|
my $rcTag = $productTag . '_RC' . $rc;
|
|
|
|
|
|
|
|
my $buildLog = catfile($logDir, 'repack_' . $rcTag . '-build-l10n.log');
|
2007-03-25 16:56:37 -07:00
|
|
|
my $lastBuilt = catfile($l10n_buildDir, $l10n_buildPlatform, 'last-built');
|
2007-03-22 10:30:00 -07:00
|
|
|
unlink($lastBuilt)
|
|
|
|
or $this->Log(msg => "Cannot unlink last-built file $lastBuilt: $!");
|
|
|
|
$this->Log(msg => "Unlinked $lastBuilt");
|
|
|
|
|
2007-10-01 09:55:46 -07:00
|
|
|
# For Cygwin only, ensure that the system mount point is textmode
|
|
|
|
# This forces CVS to use DOS-style carriage-return EOL characters.
|
|
|
|
if ($osname eq 'win32') {
|
|
|
|
$this->Shell(
|
|
|
|
cmd => 'mount',
|
|
|
|
cmdArgs => ['-t', '-sc', '/cygdrive'],
|
|
|
|
dir => $buildDir,
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
$this->Shell(
|
|
|
|
cmd => './build-seamonkey.pl',
|
|
|
|
cmdArgs => ['--once', '--mozconfig', 'mozconfig', '--depend',
|
|
|
|
'--config-cvsup-dir',
|
2007-03-27 15:28:38 -07:00
|
|
|
catfile($l10n_buildDir, 'tinderbox-configs')],
|
|
|
|
dir => $l10n_buildDir,
|
2007-03-22 10:30:00 -07:00
|
|
|
logFile => $buildLog,
|
|
|
|
timeout => 36000
|
|
|
|
);
|
2007-10-01 09:55:46 -07:00
|
|
|
|
|
|
|
# For Cygwin only, set the system mount point back to binmode
|
|
|
|
# This forces CVS to use Unix-style linefeed EOL characters.
|
|
|
|
if ($osname eq 'win32') {
|
|
|
|
$this->Shell(
|
|
|
|
cmd => 'mount',
|
|
|
|
cmdArgs => ['-b', '-sc', '/cygdrive'],
|
|
|
|
dir => $buildDir,
|
|
|
|
);
|
|
|
|
}
|
2007-03-22 10:30:00 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
sub Verify {
|
|
|
|
my $this = shift;
|
|
|
|
|
|
|
|
my $config = new Bootstrap::Config();
|
|
|
|
my $productTag = $config->Get(var => 'productTag');
|
|
|
|
my $product = $config->Get(var => 'product');
|
|
|
|
my $rc = $config->Get(var => 'rc');
|
|
|
|
my $oldRc = $config->Get(var => 'oldRc');
|
2007-08-10 16:30:01 -07:00
|
|
|
my $logDir = $config->Get(sysvar => 'logDir');
|
2007-03-22 10:30:00 -07:00
|
|
|
my $version = $config->Get(var => 'version');
|
|
|
|
my $oldVersion = $config->Get(var => 'oldVersion');
|
|
|
|
my $mozillaCvsroot = $config->Get(var => 'mozillaCvsroot');
|
|
|
|
my $verifyDir = $config->Get(var => 'verifyDir');
|
2007-08-20 17:32:16 -07:00
|
|
|
my $stagingServer = $config->Get(var => 'stagingServer');
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
my $rcTag = $productTag.'_RC'.$rc;
|
|
|
|
|
|
|
|
# l10n metadiff test
|
|
|
|
|
|
|
|
my $verifyDirVersion = catfile($verifyDir, $product . '-' . $version);
|
|
|
|
|
|
|
|
MkdirWithPath(dir => $verifyDirVersion)
|
|
|
|
or die("Cannot mkdir $verifyDirVersion: $!");
|
|
|
|
|
|
|
|
# check out l10n verification scripts
|
|
|
|
foreach my $dir ('common', 'l10n') {
|
|
|
|
$this->Shell(
|
|
|
|
cmd => 'cvs',
|
|
|
|
cmdArgs => ['-d', $mozillaCvsroot,
|
|
|
|
'co', '-d', $dir,
|
2007-04-30 13:55:21 -07:00
|
|
|
CvsCatfile('mozilla', 'testing', 'release', $dir)],
|
2007-03-22 10:30:00 -07:00
|
|
|
dir => $verifyDirVersion,
|
|
|
|
logFile => catfile($logDir,
|
|
|
|
'repack_checkout-l10n_verification.log'),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
# Download current release
|
|
|
|
$this->Shell(
|
|
|
|
cmd => 'rsync',
|
2007-06-14 02:06:12 -07:00
|
|
|
cmdArgs => ['-Lav',
|
2007-03-22 10:30:00 -07:00
|
|
|
'-e', 'ssh',
|
|
|
|
'--include=*.dmg',
|
|
|
|
'--include=*.exe',
|
|
|
|
'--include=*.tar.gz',
|
|
|
|
'--exclude=*',
|
2007-08-20 17:32:16 -07:00
|
|
|
$stagingServer . ':/home/ftp/pub/' . $product
|
2007-03-22 10:30:00 -07:00
|
|
|
. '/nightly/' . $version . '-candidates/rc' . $rc . '/*',
|
|
|
|
$product . '-' . $version . '-rc' . $rc . '/',
|
|
|
|
],
|
|
|
|
dir => catfile($verifyDirVersion, 'l10n'),
|
|
|
|
logFile =>
|
|
|
|
catfile($logDir, 'repack_verify-download_' . $version . '.log'),
|
|
|
|
timeout => 3600
|
|
|
|
);
|
|
|
|
|
|
|
|
# Download previous release
|
|
|
|
$this->Shell(
|
|
|
|
cmd => 'rsync',
|
2007-06-14 02:06:12 -07:00
|
|
|
cmdArgs => ['-Lav',
|
2007-03-22 10:30:00 -07:00
|
|
|
'-e', 'ssh',
|
|
|
|
'--include=*.dmg',
|
|
|
|
'--include=*.exe',
|
|
|
|
'--include=*.tar.gz',
|
|
|
|
'--exclude=*',
|
2007-08-20 17:32:16 -07:00
|
|
|
$stagingServer . ':/home/ftp/pub/' . $product
|
2007-03-22 10:30:00 -07:00
|
|
|
. '/nightly/' . $oldVersion . '-candidates/rc'
|
|
|
|
. $oldRc . '/*',
|
|
|
|
$product . '-' . $oldVersion . '-rc' . $oldRc . '/',
|
|
|
|
],
|
|
|
|
dir => catfile($verifyDirVersion, 'l10n'),
|
|
|
|
logFile =>
|
|
|
|
catfile($logDir, 'repack_verify-download_' . $oldVersion . '.log'),
|
|
|
|
timeout => 3600
|
|
|
|
);
|
|
|
|
|
|
|
|
my $newProduct = $product . '-' . $version . '-' . 'rc' . $rc;
|
|
|
|
my $oldProduct = $product . '-' . $oldVersion . '-' . 'rc' . $oldRc;
|
|
|
|
|
|
|
|
foreach my $product ($newProduct, $oldProduct) {
|
|
|
|
MkdirWithPath(dir => catfile($verifyDirVersion, 'l10n', $product))
|
|
|
|
or die("Cannot mkdir $verifyDirVersion/$product: $!");
|
|
|
|
|
|
|
|
$this->Shell(
|
|
|
|
cmd => './verify_l10n.sh',
|
|
|
|
cmdArgs => [$product],
|
|
|
|
dir => catfile($verifyDirVersion, 'l10n'),
|
|
|
|
logFile => catfile($logDir,
|
|
|
|
'repack_' . $product . '-l10n_verification.log'),
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
foreach my $rule ('^FAIL', '^Binary') {
|
|
|
|
eval {
|
|
|
|
$this->CheckLog(
|
|
|
|
log => $logDir .
|
|
|
|
'/repack_' . $product . '-l10n_verification.log',
|
|
|
|
notAllowed => $rule,
|
|
|
|
);
|
|
|
|
};
|
|
|
|
if ($@) {
|
|
|
|
$this->Log('msg' =>
|
|
|
|
"WARN: $rule found in l10n metadiff output!");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
$this->CheckLog(
|
|
|
|
log => $logDir . '/repack_' . $product . '-l10n_verification.log',
|
|
|
|
notAllowed => '^Only',
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
# generate metadiff
|
|
|
|
$this->Shell(
|
|
|
|
cmd => 'diff',
|
|
|
|
cmdArgs => ['-r',
|
|
|
|
catfile($newProduct, 'diffs'),
|
|
|
|
catfile($oldProduct, 'diffs'),
|
|
|
|
],
|
|
|
|
ignoreExitValue => 1,
|
|
|
|
dir => catfile($verifyDirVersion, 'l10n'),
|
|
|
|
logFile => catfile($logDir, 'repack_metadiff-l10n_verification.log'),
|
|
|
|
);
|
|
|
|
}
|
2007-07-12 10:47:39 -07:00
|
|
|
|
|
|
|
sub Push {
|
|
|
|
my $this = shift;
|
|
|
|
|
|
|
|
my $config = new Bootstrap::Config();
|
|
|
|
my $productTag = $config->Get(var => 'productTag');
|
|
|
|
my $rc = $config->Get(var => 'rc');
|
2007-08-10 16:30:01 -07:00
|
|
|
my $logDir = $config->Get(sysvar => 'logDir');
|
2007-08-20 17:32:16 -07:00
|
|
|
my $stagingUser = $config->Get(var => 'stagingUser');
|
|
|
|
my $stagingServer = $config->Get(var => 'stagingServer');
|
2007-07-12 10:47:39 -07:00
|
|
|
|
|
|
|
my $rcTag = $productTag . '_RC' . $rc;
|
|
|
|
my $buildLog = catfile($logDir, 'repack_' . $rcTag . '-build-l10n.log');
|
|
|
|
my $pushLog = catfile($logDir, 'repack_' . $rcTag . '-push-l10n.log');
|
|
|
|
|
|
|
|
my $logParser = new MozBuild::TinderLogParse(
|
|
|
|
logFile => $buildLog,
|
|
|
|
);
|
|
|
|
my $pushDir = $logParser->GetPushDir();
|
|
|
|
if (! defined($pushDir)) {
|
|
|
|
die("No pushDir found in $buildLog");
|
|
|
|
}
|
|
|
|
$pushDir =~ s!^http://ftp.mozilla.org/pub/mozilla.org!/home/ftp/pub!;
|
|
|
|
|
|
|
|
my $candidateDir = $config->GetFtpCandidateDir(bitsUnsigned => 1);
|
|
|
|
|
|
|
|
my $osFileMatch = $config->SystemInfo(var => 'osname');
|
|
|
|
if ($osFileMatch eq 'win32') {
|
|
|
|
$osFileMatch = 'win';
|
|
|
|
} elsif ($osFileMatch eq 'macosx') {
|
|
|
|
$osFileMatch = 'mac';
|
|
|
|
}
|
|
|
|
|
|
|
|
$this->Shell(
|
|
|
|
cmd => 'ssh',
|
2007-08-20 17:32:16 -07:00
|
|
|
cmdArgs => ['-2', '-l', $stagingUser, $stagingServer,
|
2007-07-12 10:47:39 -07:00
|
|
|
'mkdir -p ' . $candidateDir],
|
|
|
|
logFile => $pushLog,
|
|
|
|
);
|
|
|
|
|
|
|
|
$this->Shell(
|
|
|
|
cmd => 'ssh',
|
2007-08-20 17:32:16 -07:00
|
|
|
cmdArgs => ['-2', '-l', $stagingUser, $stagingServer,
|
2007-07-12 10:47:39 -07:00
|
|
|
'rsync', '-av',
|
|
|
|
'--include=*' . $osFileMatch . '*',
|
|
|
|
'--include=*.xpi',
|
|
|
|
'--exclude=*',
|
|
|
|
$pushDir, $candidateDir],
|
|
|
|
logFile => $pushLog,
|
|
|
|
);
|
2007-10-01 20:00:18 -07:00
|
|
|
|
|
|
|
SyncNightlyDirToStaging();
|
2007-07-12 10:47:39 -07:00
|
|
|
}
|
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
sub Announce {
|
|
|
|
my $this = shift;
|
|
|
|
|
|
|
|
my $config = new Bootstrap::Config();
|
|
|
|
my $product = $config->Get(var => 'product');
|
|
|
|
my $productTag = $config->Get(var => 'productTag');
|
2007-04-24 14:25:05 -07:00
|
|
|
my $version = $config->Get(var => 'version');
|
2007-03-22 10:30:00 -07:00
|
|
|
my $rc = $config->Get(var => 'rc');
|
2007-08-10 16:30:01 -07:00
|
|
|
my $logDir = $config->Get(sysvar => 'logDir');
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
my $rcTag = $productTag . '_RC' . $rc;
|
|
|
|
my $buildLog = catfile($logDir, 'repack_' . $rcTag . '-build-l10n.log');
|
|
|
|
|
2007-04-24 14:25:05 -07:00
|
|
|
my $logParser = new MozBuild::TinderLogParse(
|
|
|
|
logFile => $buildLog,
|
|
|
|
);
|
|
|
|
my $buildID = $logParser->GetBuildID();
|
|
|
|
my $pushDir = $logParser->GetPushDir();
|
|
|
|
|
|
|
|
if (! defined($pushDir)) {
|
|
|
|
die("No pushDir found in $buildLog");
|
|
|
|
}
|
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
$this->SendAnnouncement(
|
|
|
|
subject => "$product $version l10n repack step finished",
|
2007-07-12 10:47:39 -07:00
|
|
|
message => "$product $version l10n builds were copied to the candidates directory.\nPush Dir was $pushDir",
|
2007-03-22 10:30:00 -07:00
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
1;
|