bug 409395: factor out Bootstrap's 'useTarGz' logic to

a helper function
This commit is contained in:
bhearsum%mozilla.com 2007-12-28 14:36:18 +00:00
Родитель 7bf4445d81
Коммит 882964d789
4 изменённых файлов: 19 добавлений и 20 удалений

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

@ -165,6 +165,17 @@ sub GetFtpCandidateDir {
return $candidateDir; return $candidateDir;
} }
sub GetLinuxExtension {
my $this = shift;
# We are assuming tar.bz2 to help minimize bootstrap.cfg variables in
# the future. tar.gz support can probably be removed once we stop
# building/releasing products that use it.
my $useTarGz = $this->Exists(var => 'useTarGz') ?
$this->Get(var => 'useTarGz') : 0;
return ($useTarGz) ? 'gz' : 'bz2';
}
## ##
# Exists checks to see if a config variable exists. # Exists checks to see if a config variable exists.
# Returns boolean (1 or 0) # Returns boolean (1 or 0)

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

@ -72,11 +72,9 @@ sub Verify {
my $mozillaCvsroot = $config->Get(var => 'mozillaCvsroot'); my $mozillaCvsroot = $config->Get(var => 'mozillaCvsroot');
my $verifyDir = $config->Get(var => 'verifyDir'); my $verifyDir = $config->Get(var => 'verifyDir');
my $stagingServer = $config->Get(var => 'stagingServer'); my $stagingServer = $config->Get(var => 'stagingServer');
my $useTarGz = $config->Exists(var => 'useTarGz') ? my $linuxExtension = $config->GetLinuxExtension();
$config->Get(var => 'useTarGz') : 0;
my $rcTag = $productTag.'_RC'.$rc; my $rcTag = $productTag.'_RC'.$rc;
my $linuxExtension = ($useTarGz) ? '.gz' : '.bz2';
# l10n metadiff test # l10n metadiff test
my $verifyDirVersion = catfile($verifyDir, $product . '-' . $version); my $verifyDirVersion = catfile($verifyDir, $product . '-' . $version);
@ -103,7 +101,7 @@ sub Verify {
'-e', 'ssh', '-e', 'ssh',
'--include=*.dmg', '--include=*.dmg',
'--include=*.exe', '--include=*.exe',
'--include=*.tar'.$linuxExtension, '--include=*.tar.'.$linuxExtension,
'--exclude=*', '--exclude=*',
$stagingServer . ':/home/ftp/pub/' . $product $stagingServer . ':/home/ftp/pub/' . $product
. '/nightly/' . $version . '-candidates/rc' . $rc . '/*', . '/nightly/' . $version . '-candidates/rc' . $rc . '/*',
@ -122,7 +120,7 @@ sub Verify {
'-e', 'ssh', '-e', 'ssh',
'--include=*.dmg', '--include=*.dmg',
'--include=*.exe', '--include=*.exe',
'--include=*.tar'.$linuxExtension, '--include=*.tar.'.$linuxExtension,
'--exclude=*', '--exclude=*',
$stagingServer . ':/home/ftp/pub/' . $product $stagingServer . ':/home/ftp/pub/' . $product
. '/nightly/' . $oldVersion . '-candidates/rc' . '/nightly/' . $oldVersion . '-candidates/rc'

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

@ -435,9 +435,7 @@ sub Verify {
my $stageHome = $config->Get(var => 'stageHome'); my $stageHome = $config->Get(var => 'stageHome');
my $productTag = $config->Get(var => 'productTag'); my $productTag = $config->Get(var => 'productTag');
my $mozillaCvsroot = $config->Get(var => 'mozillaCvsroot'); my $mozillaCvsroot = $config->Get(var => 'mozillaCvsroot');
my $useTarGz = $config->Exists(var => 'useTarGz') ? my $linuxExtension = $config->GetLinuxExtension();
$config->Get(var => 'useTarGz') : 0;
my $linuxExtension = ($useTarGz) ? 'gz' : 'bz2';
## Prepare the staging directory for the release. ## Prepare the staging directory for the release.
# Create the staging directory. # Create the staging directory.
@ -624,9 +622,7 @@ sub IsValidLocaleDeliverable {
my $config = new Bootstrap::Config(); my $config = new Bootstrap::Config();
my $useTarGz = $config->Exists(var => 'useTarGz') ? my $linuxExtension = $config->GetLinuxExtension();
$config->Get(var => 'useTarGz') : 0;
my $linuxExtension = ($useTarGz) ? 'gz' : 'bz2';
my $dirent = $File::Find::name; my $dirent = $File::Find::name;

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

@ -232,13 +232,7 @@ sub BumpVerifyConfig {
my $externalStagingServer = $config->Get(var => 'externalStagingServer'); my $externalStagingServer = $config->Get(var => 'externalStagingServer');
my $verifyConfig = $config->Get(sysvar => 'verifyConfig'); my $verifyConfig = $config->Get(sysvar => 'verifyConfig');
my $logDir = $config->Get(sysvar => 'logDir'); my $logDir = $config->Get(sysvar => 'logDir');
# We are assuming tar.bz2 to help minimize bootstrap.cfg variables in my $linuxExtension = $config->GetLinuxExtension();
# the future. tar.gz support can probably be removed once we stop
# building/releasing products that use it.
my $useTarGz = $config->Exists(var => 'useTarGz') ?
$config->Get(var => 'useTarGz') : 0;
my $linuxExtension = ($useTarGz) ? '.gz' : '.bz2';
my $verifyDirVersion = catfile($verifyDir, $product . '-' . $version); my $verifyDirVersion = catfile($verifyDir, $product . '-' . $version);
my $configFile = catfile($verifyDirVersion, 'updates', $verifyConfig); my $configFile = catfile($verifyDirVersion, 'updates', $verifyConfig);
@ -260,8 +254,8 @@ sub BumpVerifyConfig {
$buildTarget = 'Linux_x86-gcc3'; $buildTarget = 'Linux_x86-gcc3';
$platform = 'linux'; $platform = 'linux';
$ftpOsname = 'linux-i686'; $ftpOsname = 'linux-i686';
$releaseFile = $product.'-'.$oldVersion.'.tar'.$linuxExtension; $releaseFile = $product.'-'.$oldVersion.'.tar.'.$linuxExtension;
$nightlyFile = $product.'-'.$version.'.%locale%.linux-i686.tar'. $nightlyFile = $product.'-'.$version.'.%locale%.linux-i686.tar.'.
$linuxExtension; $linuxExtension;
} elsif ($osname eq 'macosx') { } elsif ($osname eq 'macosx') {
$buildTarget = 'Darwin_Universal-gcc3'; $buildTarget = 'Darwin_Universal-gcc3';