Compare commits
1 Commits
UPDATE_PAC
...
src
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
258dc9fead |
1144
mozilla/client.mk
1144
mozilla/client.mk
File diff suppressed because it is too large
Load Diff
@@ -1,803 +0,0 @@
|
||||
#!/usr/bin/perl
|
||||
#
|
||||
# ***** BEGIN LICENSE BLOCK *****
|
||||
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
#
|
||||
# The contents of this file are subject to the Mozilla Public License Version
|
||||
# 1.1 (the "License"); you may not use this file except in compliance with
|
||||
# the License. You may obtain a copy of the License at
|
||||
# http://www.mozilla.org/MPL/
|
||||
#
|
||||
# Software distributed under the License is distributed on an "AS IS" basis,
|
||||
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
# for the specific language governing rights and limitations under the
|
||||
# License.
|
||||
#
|
||||
# The Original Code is Patcher 2, a patch generator for the AUS2 system.
|
||||
#
|
||||
# The Initial Developer of the Original Code is
|
||||
# Mozilla Corporation
|
||||
#
|
||||
# Portions created by the Initial Developer are Copyright (C) 2006
|
||||
# the Initial Developer. All Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
# Chase Phillips (chase@mozilla.org)
|
||||
# J. Paul Reed (preed@mozilla.com)
|
||||
#
|
||||
# Alternatively, the contents of this file may be used under the terms of
|
||||
# either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
# in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
# of those above. If you wish to allow use of your version of this file only
|
||||
# under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
# use your version of this file under the terms of the MPL, indicate your
|
||||
# decision by deleting the provisions above and replace them with the notice
|
||||
# and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
# the provisions above, a recipient may use your version of this file under
|
||||
# the terms of any one of the MPL, the GPL or the LGPL.
|
||||
#
|
||||
# ***** END LICENSE BLOCK *****
|
||||
#
|
||||
|
||||
package MozAUSConfig;
|
||||
|
||||
use Cwd;
|
||||
use Config::General;
|
||||
use Data::Dumper;
|
||||
|
||||
require Exporter;
|
||||
|
||||
@ISA = qw(Exporter);
|
||||
@EXPORT = qw(new DEFAULT_MAR_NAME);
|
||||
|
||||
use MozAUSLib qw(SubstitutePath);
|
||||
|
||||
use strict;
|
||||
|
||||
##
|
||||
## CONSTANTS
|
||||
##
|
||||
|
||||
use vars qw( @RUN_MODES
|
||||
$DEFAULT_APP $DEFAULT_MODE $DEFAULT_CONFIG_FILE
|
||||
$DEFAULT_DOWNLOAD_DIR $DEFAULT_DELIVERABLE_DIR
|
||||
$DEFAULT_MAR_NAME
|
||||
);
|
||||
|
||||
@RUN_MODES = qw( build-tools
|
||||
build-tools-hg
|
||||
download
|
||||
create-patches create-patchinfo );
|
||||
|
||||
$DEFAULT_CONFIG_FILE = 'patcher2.cfg';
|
||||
$DEFAULT_APP = 'MyApp';
|
||||
$DEFAULT_DOWNLOAD_DIR = 'downloads';
|
||||
$DEFAULT_DELIVERABLE_DIR = 'temp';
|
||||
$DEFAULT_MAR_NAME = '%app%-%version%.%locale%.%platform%.complete.mar';
|
||||
|
||||
sub new
|
||||
{
|
||||
my $class = shift;
|
||||
my $this = {};
|
||||
bless($this, $class);
|
||||
return $this->Initialize() ? $this : undef;
|
||||
}
|
||||
|
||||
sub Initialize
|
||||
{
|
||||
my $this = shift;
|
||||
$this->{'mStartingDir'} = getcwd();
|
||||
return ($this->ProcessCommandLineArgs() and
|
||||
$this->ReadConfig() and
|
||||
$this->ExpandConfig() and
|
||||
$this->ReadPastUpdates() and
|
||||
$this->CreateUpdateGraph() and
|
||||
$this->TransferChannels());
|
||||
}
|
||||
|
||||
sub GetStartingDir
|
||||
{
|
||||
my $this = shift;
|
||||
die "ASSERT: mStartingDir must be a full path: $this->{'mStartingDir'}\n"
|
||||
if ($this->{'mStartingDir'} !~ m:^/:);
|
||||
return $this->{'mStartingDir'};
|
||||
}
|
||||
|
||||
sub ProcessCommandLineArgs
|
||||
{
|
||||
my $this = shift;
|
||||
my (%args);
|
||||
|
||||
Getopt::Long::Configure('bundling_override', 'ignore_case_always',
|
||||
'pass_through');
|
||||
Getopt::Long::GetOptions(\%args,
|
||||
'help|h|?', 'man', 'version', 'app=s', 'brand=s', 'config=s', 'verbose',
|
||||
'dry-run', 'tools-dir=s', 'download-dir=s', 'deliverable-dir=s',
|
||||
'tools-revision=s', 'partial-patchlist-file=s', @RUN_MODES)
|
||||
or return 0;
|
||||
|
||||
$this->{'mConfigFilename'} = defined($args{'config'}) ? $args{'config'} :
|
||||
$DEFAULT_CONFIG_FILE;
|
||||
|
||||
$this->{'mApp'} = defined($args{'app'}) ? $args{'app'} : $DEFAULT_APP;
|
||||
$this->{'mBrand'} = defined($args{'brand'}) ? $args{'brand'} : ucfirst($this->{'mApp'});
|
||||
|
||||
$this->{'mVerbose'} = defined($args{'verbose'}) ? $args{'verbose'} : 0;
|
||||
|
||||
$this->{'mDownloadDir'} = defined($args{'mDownloadDir'}) ?
|
||||
$args{'mDownloadDir'} : $DEFAULT_DOWNLOAD_DIR;
|
||||
$this->{'mDeliverableDir'} = defined($args{'mDeliverableDir'}) ?
|
||||
$args{'mDeliverableDir'} : $DEFAULT_DELIVERABLE_DIR;
|
||||
$this->{'mPartialPatchlistFile'} = defined($args{'partial-patchlist-file'}) ? $args{'partial-patchlist-file'} : undef;
|
||||
|
||||
# Is this a dry run, and we'll just print what we *would* do?
|
||||
$this->{'dryRun'} = defined($args{'dryRun'}) ? 1 : 0;
|
||||
|
||||
## Expects to be the dir that $mToolsDir/mozilla/[all the tools] will be in.
|
||||
$this->{'mToolsDir'} = defined($args{'mToolsDir'}) ? $args{'mToolsDir'} : getcwd();
|
||||
|
||||
# A bunch of paths need to be full pathed; they're all part of $this, so all
|
||||
# we really need is the key values; check them all here.
|
||||
foreach my $pathKey (qw(mDownloadDir mDeliverableDir mToolsDir)) {
|
||||
if ($this->{$pathKey} !~ m:^/:) {
|
||||
$this->{$pathKey} = $this->GetStartingDir() . '/' .
|
||||
$this->{$pathKey};
|
||||
}
|
||||
}
|
||||
|
||||
# the tag we would use for pulling the mozilla tree in BuildTools()
|
||||
$this->{'mToolsRevision'} = defined($args{'tools-revision'}) ?
|
||||
$args{'tools-revision'} : 'HEAD';
|
||||
|
||||
$this->{'run'} = [];
|
||||
|
||||
foreach my $mode (@RUN_MODES) {
|
||||
push(@{$this->{'run'}}, $mode) if defined $args{$mode};
|
||||
}
|
||||
|
||||
return 0 if (not scalar(@{$this->{'run'}}));
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
sub ReadConfig
|
||||
{
|
||||
my $this = shift;
|
||||
|
||||
my $configFile = $this->{'mConfigFilename'};
|
||||
if (not -r $configFile) {
|
||||
die "Config file '$configFile' isn't readable";
|
||||
}
|
||||
my $configObj = new Config::General(-ConfigFile => $configFile);
|
||||
|
||||
my %rawConfig = $configObj->getall();
|
||||
|
||||
$this->{'mRawConfig'} = \%rawConfig;
|
||||
return $this->CookConfig();
|
||||
}
|
||||
|
||||
sub CookConfig
|
||||
{
|
||||
my $this = shift;
|
||||
$this->{'mAppConfig'} = $this->{'mRawConfig'}->{'app'}->{$this->GetApp()};
|
||||
return 1;
|
||||
}
|
||||
|
||||
sub GetAppConfig
|
||||
{
|
||||
my $this = shift;
|
||||
return $this->{'mAppConfig'};
|
||||
}
|
||||
|
||||
sub GetAllAppReleases
|
||||
{
|
||||
my $this = shift;
|
||||
return $this->GetAppConfig()->{'release'};
|
||||
}
|
||||
|
||||
sub GetAppRelease
|
||||
{
|
||||
my $this = shift;
|
||||
my $release = shift;
|
||||
return $this->GetAppConfig()->{'release'}->{$release};
|
||||
}
|
||||
|
||||
sub GetPastUpdates
|
||||
{
|
||||
my $this = shift;
|
||||
return $this->GetAppConfig()->{'mPastUpdates'};
|
||||
}
|
||||
|
||||
sub GetCurrentUpdate
|
||||
{
|
||||
my $this = shift;
|
||||
my $updateData = $this->GetAppConfig()->{'update_data'};
|
||||
my @updateKeys = keys(%{$updateData});
|
||||
die "ASSERT: MozAUSConfig::GetCurrentUpdate() must return 1 update\n"
|
||||
if (scalar(@updateKeys) != 1);
|
||||
## Stupid...
|
||||
return $this->GetAppConfig()->{'update_data'}->{$updateKeys[0]};
|
||||
}
|
||||
|
||||
##
|
||||
## Creates a platform entry in each release hash that maps platform
|
||||
## -> buildid/the locales the platform needs updates for; takes into account
|
||||
## the exceptions list, and prunes those.
|
||||
##
|
||||
|
||||
sub ExpandConfig
|
||||
{
|
||||
my $this = shift;
|
||||
|
||||
my $prefix_dir = $this->{'prefix'};
|
||||
my $buildinfo_dir = "$prefix_dir/build";
|
||||
|
||||
# Expand basic release config into information about locales, pruning as needed.
|
||||
|
||||
my $r_config = $this->GetAppConfig()->{'release'};
|
||||
for my $r (keys(%{$this->GetAllAppReleases()})) {
|
||||
my $rl_config = $r_config->{$r};
|
||||
my $locale_list = $rl_config->{'locales'};
|
||||
|
||||
my @locales = split(/\s+/, $locale_list);
|
||||
|
||||
my $rlp_config = $rl_config->{'platforms'};
|
||||
my @platforms = keys(%{$rlp_config});
|
||||
for my $p (@platforms) {
|
||||
my $build_id = $rlp_config->{$p};
|
||||
delete($rlp_config->{$p});
|
||||
if (!exists($rlp_config->{$p}->{'locales'})
|
||||
or !defined($rlp_config->{$p}->{'locales'})) {
|
||||
$rlp_config->{$p}->{'locales'} = [];
|
||||
}
|
||||
$rlp_config->{$p}->{'build_id'} = $build_id;
|
||||
|
||||
my $platform_locales = $rlp_config->{$p}->{'locales'};
|
||||
|
||||
for my $l (@locales) {
|
||||
if (exists($rl_config->{'exceptions'}->{$l})
|
||||
and defined($rl_config->{'exceptions'}->{$l})) {
|
||||
|
||||
my @e = split(/\s*,\s*/, $rl_config->{'exceptions'}->{$l});
|
||||
|
||||
push(@$platform_locales, $l) if grep(/^$p$/, @e);
|
||||
next;
|
||||
}
|
||||
|
||||
push(@$platform_locales, $l);
|
||||
}
|
||||
|
||||
my @sorted_locales = sort(@{$platform_locales});
|
||||
$rlp_config->{$p}->{'locales'} = \@sorted_locales;
|
||||
}
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
#
|
||||
# Parses all the past-update lines, and adds the past update channels to the
|
||||
# update-TO release. Not that useful?
|
||||
#
|
||||
|
||||
sub ReadPastUpdates
|
||||
{
|
||||
my $this = shift;
|
||||
|
||||
my(@update_config, @updates);
|
||||
my $update = $this->{'mAppConfig'}->{'past-update'};
|
||||
# An artifact of Config::General; if multiple |past-update|s are
|
||||
# defined, you get them in an array ref; otherwise, it's just a string.
|
||||
if (ref($update) eq 'ARRAY') {
|
||||
@update_config = @{$update};
|
||||
} else {
|
||||
push(@update_config, $update);
|
||||
}
|
||||
|
||||
for my $u (@update_config) {
|
||||
# Parse apart the update definition into from/to/update channels and
|
||||
# stuff the info into @updates.
|
||||
if ( $u =~ /^\s*(\S+)\s+(\S+)\s+([\w\s\-]+)$/ ) {
|
||||
my $update_node = {};
|
||||
$update_node->{'from'} = $1;
|
||||
$update_node->{'to'} = $2;
|
||||
my @update_channels = split(/\s+/, $3);
|
||||
$update_node->{'channels'} = \@update_channels;
|
||||
|
||||
push(@updates, $update_node);
|
||||
}
|
||||
else {
|
||||
print STDERR "read_past_updates(): Invalid past-update specification: $u\n";
|
||||
}
|
||||
}
|
||||
|
||||
my $appConfig = $this->GetAppConfig();
|
||||
$appConfig->{'mPastUpdates'} = [];
|
||||
|
||||
for my $u (@updates) {
|
||||
my $u_from = $u->{'from'};
|
||||
my $u_to = $u->{'to'};
|
||||
my @u_channels = @{$u->{'channels'}};
|
||||
|
||||
# If the release that this update points to isn't defined, ...
|
||||
if (!exists($this->{'mAppConfig'}->{'release'}->{$u_to}) or
|
||||
!defined($this->{'mAppConfig'}->{'release'}->{$u_to})) {
|
||||
# Skip to the next update.
|
||||
print STDERR "Warning: a past-update mentions release $u_to which doesn't exist.\n";
|
||||
next;
|
||||
}
|
||||
|
||||
my $pastUpdateNode = { 'from' => $u_from,
|
||||
'to' => $u_to,
|
||||
'channels' => \@u_channels };
|
||||
|
||||
push(@{$appConfig->{'mPastUpdates'}}, $pastUpdateNode);
|
||||
|
||||
my $ur_config = $this->{'mAppConfig'}->{'release'}->{$u_to};
|
||||
foreach my $channel (@u_channels) {
|
||||
$this->AddChannelToRelease(release => $ur_config,
|
||||
channel => $channel);
|
||||
}
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
sub CreateUpdateGraph
|
||||
{
|
||||
my $this = shift;
|
||||
my %args = @_;
|
||||
|
||||
my $appConfig = $this->GetAppConfig();
|
||||
|
||||
my $temp_prefix = lc($this->GetApp());
|
||||
|
||||
my @updates;
|
||||
my $update = $appConfig->{'current-update'};
|
||||
if (ref($update) eq 'ARRAY') {
|
||||
@updates = @$update;
|
||||
} else {
|
||||
push(@updates, $update);
|
||||
}
|
||||
|
||||
if (!defined($appConfig->{'update_data'})) {
|
||||
$appConfig->{'update_data'} = {};
|
||||
}
|
||||
|
||||
my $u_config = $appConfig->{'update_data'};
|
||||
|
||||
for my $u (@updates) {
|
||||
my $u_from = $u->{'from'};
|
||||
my $u_to = $u->{'to'};
|
||||
my $u_channel = $u->{'channel'};
|
||||
my $u_testchannel = $u->{'testchannel'};
|
||||
my $u_partial = $u->{'partial'};
|
||||
my $u_complete = $u->{'complete'};
|
||||
my $u_details = $u->{'details'};
|
||||
my $u_license = $u->{'license'};
|
||||
my $u_updateType = $u->{'updateType'};
|
||||
my $u_rcInfo = exists($u->{'rc'}) ? $u->{'rc'} : undef;
|
||||
my $u_force = [];
|
||||
|
||||
if (defined($u->{'force'})) {
|
||||
if (ref($u->{'force'}) eq 'ARRAY') {
|
||||
$u_force = $u->{'force'};
|
||||
} else {
|
||||
push(@{$u_force}, $u->{'force'});
|
||||
}
|
||||
}
|
||||
|
||||
my $u_key = "$u_from-$u_to";
|
||||
|
||||
# If the release that this update points to isn't defined, ...
|
||||
# TODO - check the from release
|
||||
if (not defined($this->GetAppRelease($u_to))) {
|
||||
# Skip to the next update.
|
||||
print STDERR "Update $u_key refers to a non-existant release endpoint: $u_to\n";
|
||||
next;
|
||||
}
|
||||
|
||||
# Add the channel(s) to the update information.
|
||||
my $ur_config = $appConfig->{'release'}->{$u_from};
|
||||
my @channels = split(/\s+/, $u_channel);
|
||||
for my $c (@channels) {
|
||||
$this->AddChannelToRelease(release => $ur_config, channel => $c);
|
||||
}
|
||||
|
||||
if (!defined($u_config->{$u_key})) {
|
||||
$u_config->{$u_key} = {};
|
||||
}
|
||||
|
||||
$u_config->{$u_key}->{'from'} = $u_from;
|
||||
$u_config->{$u_key}->{'to'} = $u_to;
|
||||
$u_config->{$u_key}->{'channel'} = $u_channel;
|
||||
$u_config->{$u_key}->{'testchannel'} = $u_testchannel;
|
||||
$u_config->{$u_key}->{'partial'} = $u_partial;
|
||||
$u_config->{$u_key}->{'complete'} = $u_complete;
|
||||
$u_config->{$u_key}->{'details'} = $u_details;
|
||||
$u_config->{$u_key}->{'license'} = $u_license;
|
||||
$u_config->{$u_key}->{'updateType'} = $u_updateType;
|
||||
$u_config->{$u_key}->{'force'} = $u_force;
|
||||
$u_config->{$u_key}->{'platforms'} = {};
|
||||
|
||||
# Add the keys that specify channel-specific snippet directories
|
||||
foreach my $c (@channels) {
|
||||
my $testKey = $c . '-dir';
|
||||
if (exists($u->{$testKey})) {
|
||||
$u_config->{$u_key}->{$testKey} = $u->{$testKey};
|
||||
}
|
||||
}
|
||||
|
||||
# Creates a hash of channel -> rc number the channel thinks its on
|
||||
$u_config->{$u_key}->{'rc'} = {};
|
||||
if (defined($u_rcInfo)) {
|
||||
foreach my $channel (keys(%{$u_rcInfo})) {
|
||||
# Such a hack... this isn't a channel name at all; it's a config
|
||||
# variable, to control the behavior of sending the complete
|
||||
# "jump" updates to the RC channels...
|
||||
if ($channel eq 'DisableCompleteJump') {
|
||||
$u_config->{$u_key}->{'DisableCompleteJump'} = $u_rcInfo->{$channel};
|
||||
next;
|
||||
}
|
||||
$u_config->{$u_key}->{'rc'}->{$channel} = $u_rcInfo->{$channel};
|
||||
}
|
||||
}
|
||||
|
||||
my $r_config = $this->{'mAppConfig'}->{'release'};
|
||||
my @releases = keys %$r_config;
|
||||
|
||||
# Find the set of locales that intersect for each platform by calculating how many times they appear.
|
||||
|
||||
my $locale_intersection = {};
|
||||
|
||||
for my $side ('from', 'to') {
|
||||
my $subu = $side eq 'from' ? $u_from : $u_to;
|
||||
|
||||
if (!defined($r_config->{$subu})) {
|
||||
die "ERROR: trying to update from/to a build that we have no release info about!";
|
||||
}
|
||||
|
||||
my $rl_config = $r_config->{$subu};
|
||||
my $rlp_config = $rl_config->{'platforms'};
|
||||
my @platforms = keys %$rlp_config;
|
||||
for my $p (@platforms) {
|
||||
my $platform_locales = $rlp_config->{$p}->{'locales'};
|
||||
|
||||
for my $l (@$platform_locales) {
|
||||
if (!defined($locale_intersection->{$p})) {
|
||||
$locale_intersection->{$p} = {};
|
||||
}
|
||||
|
||||
if (!defined($locale_intersection->{$p}->{$l})) {
|
||||
$locale_intersection->{$p}->{$l} = 0;
|
||||
}
|
||||
|
||||
$locale_intersection->{$p}->{$l}++;
|
||||
}
|
||||
}
|
||||
} # for my $side ("from", "to")
|
||||
|
||||
# Store the set of locales that intersect in the $update_locales hash.
|
||||
|
||||
my $update_locales = {};
|
||||
|
||||
for my $platform (keys %$locale_intersection) {
|
||||
for my $locale (keys %{$locale_intersection->{$platform}}) {
|
||||
if ($locale_intersection->{$platform}->{$locale} > 1) {
|
||||
if (!defined($update_locales->{$platform})) {
|
||||
$update_locales->{$platform} = [];
|
||||
}
|
||||
|
||||
push(@{$update_locales->{$platform}}, $locale);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
# Now build an update based on each side of the update graph that
|
||||
# only creates an update between the locale intersection.
|
||||
|
||||
for my $side ('from', 'to') {
|
||||
my $subu = $side eq 'from' ? $u_from : $u_to;
|
||||
|
||||
if (!defined($r_config->{$subu})) {
|
||||
die "ERROR: trying to update from/to a build that we have no release info about!";
|
||||
}
|
||||
|
||||
my $rl_config = $r_config->{$subu};
|
||||
my $rlp_config = $rl_config->{'platforms'};
|
||||
my @platforms = keys %$rlp_config;
|
||||
for my $p (@platforms) {
|
||||
if (!defined($u_config->{$u_key}->{'platforms'}->{$p})) {
|
||||
$u_config->{$u_key}->{'platforms'}->{$p} = {};
|
||||
}
|
||||
|
||||
my $up_config = $u_config->{$u_key}->{'platforms'}->{$p};
|
||||
|
||||
$up_config->{'build_id'} = $rlp_config->{$p}->{'build_id'};
|
||||
|
||||
if (!defined($up_config->{'locales'})) {
|
||||
$up_config->{'locales'} = {};
|
||||
}
|
||||
|
||||
my $ul_config = $up_config->{'locales'};
|
||||
|
||||
my $platform_locales = $update_locales->{$p};
|
||||
for my $l (@$platform_locales) {
|
||||
if (!defined($ul_config->{$l})) {
|
||||
$ul_config->{$l} = {};
|
||||
}
|
||||
|
||||
$ul_config->{$l}->{$side} = $this->GatherCompleteData(
|
||||
release => $subu,
|
||||
completemarurl => $rl_config->{'completemarurl'},
|
||||
platform => $p,
|
||||
locale => $l,
|
||||
build_id => $rlp_config->{$p}->{'build_id'},
|
||||
version => $rl_config->{'version'},
|
||||
prettyVersion => $rl_config->{'prettyVersion'},
|
||||
extensionVersion => $rl_config->{'extension-version'},
|
||||
schemaVersion => $rl_config->{'schema'} );
|
||||
}
|
||||
}
|
||||
} # for my $side ("from", "to")
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
sub GatherCompleteData
|
||||
{
|
||||
my $this = shift;
|
||||
|
||||
my %args = @_;
|
||||
|
||||
my $completemarurl = $args{'completemarurl'};
|
||||
my $platform = $args{'platform'};
|
||||
my $locale = $args{'locale'};
|
||||
my $release = $args{'release'};
|
||||
my $build_id = $args{'build_id'};
|
||||
my $version = $args{'version'};
|
||||
my $prettyVersion = $args{'prettyVersion'};
|
||||
my $extensionVersion = $args{'extensionVersion'};
|
||||
my $schemaVersion = $args{'schemaVersion'};
|
||||
|
||||
my $config = $args{'config'};
|
||||
|
||||
#my $startdir = getcwd();
|
||||
$completemarurl = SubstitutePath(path => $completemarurl,
|
||||
platform => $platform,
|
||||
locale => $locale,
|
||||
version => $version );
|
||||
|
||||
my $filename = SubstitutePath(path => $DEFAULT_MAR_NAME,
|
||||
platform => $platform,
|
||||
locale => $locale,
|
||||
version => $release,
|
||||
app => lc($this->GetApp()));
|
||||
|
||||
my $local_filename = "$release/ftp/$filename";
|
||||
|
||||
my $node = {};
|
||||
$node->{'path'} = $local_filename;
|
||||
|
||||
if ( -e $local_filename ) {
|
||||
#printf("found $local_filename\n");
|
||||
#my $md5 = `md5sum $local_filename`;
|
||||
#chomp($md5);
|
||||
#$md5 =~ s/^([^\s]*)\s+.*$/$1/g;
|
||||
|
||||
#$node->{'md5'} = $md5;
|
||||
#$node->{'size'} = (stat($local_filename))[7];
|
||||
} else {
|
||||
#printf("did not find $local_filename\n");
|
||||
}
|
||||
|
||||
$node->{'url'} = $completemarurl;
|
||||
$node->{'build_id'} = $build_id;
|
||||
# XXX - This is a huge hack and needs to be fixed. It's to support
|
||||
# Y!/Google builds, wherein we specify the version as
|
||||
# Firefox_version-google/yahoo. However, since this is used for appv
|
||||
# and extv, the version needs to NOT have these -google/-yahoo identifiers.
|
||||
my $numericVersion = $version;
|
||||
$numericVersion =~ s/\-.*$//;
|
||||
$node->{'appv'} = $numericVersion;
|
||||
|
||||
# appv is used for directory creation and possibly other things.
|
||||
# patcher will use prettyAppv in the snippets it creates, and appv for any
|
||||
# other weird things it chooses to use it for
|
||||
$node->{'prettyAppv'} = defined($prettyVersion) ?
|
||||
$prettyVersion : $numericVersion;
|
||||
|
||||
# Most of the time, the extv should be the same as the appv; sometimes,
|
||||
# however, this won't be the case. This adds support to allow you to specify
|
||||
# an extv that is different from the appv.
|
||||
$node->{'extv'} = defined($extensionVersion) ?
|
||||
$extensionVersion : $numericVersion;
|
||||
|
||||
if (defined($schemaVersion)) {
|
||||
$node->{'schema'} = $schemaVersion;
|
||||
}
|
||||
|
||||
#chdir($startdir);
|
||||
|
||||
return $node;
|
||||
}
|
||||
|
||||
|
||||
sub AddChannelToRelease
|
||||
{
|
||||
my $this = shift;
|
||||
my %args = @_;
|
||||
my $rconfig = $args{'release'};
|
||||
my $newChannel = $args{'channel'};
|
||||
|
||||
# Validate arguments...
|
||||
die "ASSERT: AddChannelToRelease(): Invalid release config" if (not defined($rconfig));
|
||||
|
||||
die "ASSERT: AddChannelToRelease(): Invalid new channel" if (not defined($newChannel));
|
||||
|
||||
if (!defined($rconfig->{'all_channels'})) {
|
||||
# Create the release's all_channels.
|
||||
$rconfig->{'all_channels'} = [];
|
||||
}
|
||||
|
||||
# return if the release already has this channel in all_channels, ...
|
||||
return if (grep(/^$newChannel$/, @{$rconfig->{'all_channels'}}));
|
||||
|
||||
# Add the new channel to all_channels.
|
||||
push(@{$rconfig->{'all_channels'}}, $newChannel);
|
||||
return 1;
|
||||
}
|
||||
|
||||
##
|
||||
## Copies the channels defined in a from-release to the to-releae in an update,
|
||||
## presumably so users of the from-release will get the update in the
|
||||
## to-release.
|
||||
##
|
||||
|
||||
sub TransferChannels
|
||||
{
|
||||
my $this = shift;
|
||||
|
||||
my $u_config = $this->GetAppConfig()->{'update_data'};
|
||||
my @updates = keys %$u_config;
|
||||
|
||||
for my $u (@updates) {
|
||||
# If the update config doesn't have all_channels defined, define it as a list.
|
||||
if (!defined($u_config->{$u}->{'all_channels'})) {
|
||||
$u_config->{$u}->{'all_channels'} = [];
|
||||
}
|
||||
|
||||
# Select the lhs of the update config.
|
||||
my $u_from = $u_config->{$u}->{'from'};
|
||||
# Correlate the lhs of the update config with its release config.
|
||||
my $rconfig = $this->{'mAppConfig'}->{'release'}->{$u_from};
|
||||
|
||||
# If the lhs side of the update's release configuration has all_channels defined, push
|
||||
# those entries onto the update's all_channels.
|
||||
if (defined($rconfig->{'all_channels'})) {
|
||||
my @all_channels = @{$rconfig->{'all_channels'}};
|
||||
push(@{$u_config->{$u}->{'all_channels'}}, @all_channels);
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
sub RemoveBrokenUpdates
|
||||
{
|
||||
my $this = shift;
|
||||
|
||||
my $temp_prefix = lc($this->GetApp());
|
||||
my $startdir = getcwd();
|
||||
chdir("temp/$temp_prefix") or die "ASSERT: chdir(temp/$temp_prefix) FAILED; cwd: " . getcwd();
|
||||
|
||||
my $u_config = $this->GetAppConfig()->{'update_data'};
|
||||
my @updates = keys %$u_config;
|
||||
|
||||
my $i = 0;
|
||||
for my $u (@updates) {
|
||||
my $partial = $u_config->{$u}->{'partial'};
|
||||
my $partial_path = $partial->{'path'};
|
||||
my $partial_url = $partial->{'url'};
|
||||
|
||||
my @platforms = sort keys %{$u_config->{$u}->{'platforms'}};
|
||||
for my $p (@platforms) {
|
||||
my $ul_config = $u_config->{$u}->{'platforms'}->{$p}->{'locales'};
|
||||
my @locales = sort keys %$ul_config;
|
||||
|
||||
for my $l (@locales) {
|
||||
my $from = $ul_config->{$l}->{'from'};
|
||||
my $to = $ul_config->{$l}->{'to'};
|
||||
|
||||
my $from_path = $from->{'path'};
|
||||
my $to_path = $to->{'path'};
|
||||
|
||||
my $to_name = $u_config->{$u}->{'to'};
|
||||
|
||||
my $gen_partial_path = $partial_path;
|
||||
$gen_partial_path = SubstitutePath(path => $partial_path,
|
||||
platform => $p,
|
||||
version => $to->{'appv'},
|
||||
locale => $l);
|
||||
|
||||
my $gen_partial_url = $partial_url;
|
||||
$gen_partial_url = SubstitutePath(path => $partial_url,
|
||||
platform => $p,
|
||||
version => $to->{'appv'},
|
||||
locale => $l);
|
||||
|
||||
my $partial_pathname = "$u/ftp/$gen_partial_path";
|
||||
|
||||
# Go to next iteration if this partial patch already exists.
|
||||
next if -e $partial_pathname;
|
||||
$i++;
|
||||
|
||||
if ( ! -f $from_path or
|
||||
! -f $to_path ) {
|
||||
# remove this update
|
||||
delete($ul_config->{$l});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#printf("%s", Data::Dumper::Dumper($u_config));
|
||||
|
||||
chdir($startdir);
|
||||
} # remove_broken_updates
|
||||
|
||||
|
||||
|
||||
sub RequestedStep
|
||||
{
|
||||
my $this = shift;
|
||||
my $checkStep = shift;
|
||||
return grep(/^$checkStep$/, @{$this->{'run'}});
|
||||
}
|
||||
|
||||
sub GetDeliverableDir
|
||||
{
|
||||
my $this = shift;
|
||||
die "ASSERT: GetDownloadDir() must return a full path" if
|
||||
($this->{'mDeliverableDir'} !~ m:^/:);
|
||||
return $this->{'mDeliverableDir'};
|
||||
}
|
||||
|
||||
sub GetApp
|
||||
{
|
||||
my $this = shift;
|
||||
return $this->{'mBrand'};
|
||||
}
|
||||
|
||||
sub GetDownloadDir
|
||||
{
|
||||
my $this = shift;
|
||||
die "ASSERT: GetDownloadDir() must return a full path" if
|
||||
($this->{'mDownloadDir'} !~ m:^/:);
|
||||
return $this->{'mDownloadDir'};
|
||||
}
|
||||
|
||||
sub GetToolsDir
|
||||
{
|
||||
my $this = shift;
|
||||
die "ASSERT: GetToolsDir() must return a full path" if
|
||||
($this->{'mToolsDir'} !~ m:^/:);
|
||||
return $this->{'mToolsDir'};
|
||||
}
|
||||
|
||||
sub IsDryRun
|
||||
{
|
||||
my $this = shift;
|
||||
return 1 == $this->{'dryRun'};
|
||||
}
|
||||
|
||||
sub GetToolsRevision
|
||||
{
|
||||
my $this = shift;
|
||||
return $this->{'mToolsRevision'};
|
||||
}
|
||||
|
||||
1;
|
||||
@@ -1,413 +0,0 @@
|
||||
#!/usr/bin/perl
|
||||
#
|
||||
# ***** BEGIN LICENSE BLOCK *****
|
||||
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
#
|
||||
# The contents of this file are subject to the Mozilla Public License Version
|
||||
# 1.1 (the "License"); you may not use this file except in compliance with
|
||||
# the License. You may obtain a copy of the License at
|
||||
# http://www.mozilla.org/MPL/
|
||||
#
|
||||
# Software distributed under the License is distributed on an "AS IS" basis,
|
||||
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
# for the specific language governing rights and limitations under the
|
||||
# License.
|
||||
#
|
||||
# The Original Code is Patcher 2, a patch generator for the AUS2 system.
|
||||
#
|
||||
# The Initial Developer of the Original Code is
|
||||
# Mozilla Corporation
|
||||
#
|
||||
# Portions created by the Initial Developer are Copyright (C) 2006
|
||||
# the Initial Developer. All Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
# Chase Phillips (chase@mozilla.org)
|
||||
# J. Paul Reed (preed@mozilla.com)
|
||||
#
|
||||
# Alternatively, the contents of this file may be used under the terms of
|
||||
# either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
# in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
# of those above. If you wish to allow use of your version of this file only
|
||||
# under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
# use your version of this file under the terms of the MPL, indicate your
|
||||
# decision by deleting the provisions above and replace them with the notice
|
||||
# and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
# the provisions above, a recipient may use your version of this file under
|
||||
# the terms of any one of the MPL, the GPL or the LGPL.
|
||||
#
|
||||
# ***** END LICENSE BLOCK *****
|
||||
#
|
||||
|
||||
package MozAUSLib;
|
||||
|
||||
use Cwd;
|
||||
use File::Path;
|
||||
use File::Copy qw(move copy);
|
||||
use English;
|
||||
|
||||
use File::Spec::Functions;
|
||||
|
||||
use MozBuild::Util qw(RunShellCommand MkdirWithPath HashFile);
|
||||
|
||||
require Exporter;
|
||||
|
||||
@ISA = qw(Exporter);
|
||||
@EXPORT_OK = qw(CreatePartialMarFile CreatePartialMarPatchInfo
|
||||
GetAUS2PlatformStrings GetBouncerPlatformStrings
|
||||
ValidateToolsDirectory
|
||||
EnsureDeliverablesDir
|
||||
SubstitutePath
|
||||
GetSnippetDirFromChannel
|
||||
CachedHashFile
|
||||
);
|
||||
|
||||
use strict;
|
||||
|
||||
##
|
||||
## CONSTANTS
|
||||
##
|
||||
|
||||
use vars qw($MAR_BIN $MBSDIFF_BIN $MAKE_BIN
|
||||
$INCREMENTAL_UPDATE_BIN $UNWRAP_FULL_UPDATE_BIN
|
||||
$FAST_INCREMENTAL_UPDATE_BIN
|
||||
$TMPDIR_PREFIX
|
||||
%BOUNCER_PLATFORMS %FILEPATH_PLATFORMS %AUS2_PLATFORMS
|
||||
$DEFAULT_PARTIAL_MAR_OUTPUT_FILE
|
||||
$DEFAULT_SNIPPET_BASE_DIR $DEFAULT_SNIPPET_TEST_DIR
|
||||
$SNIPPET_CHECKSUM_HASH_CACHE);
|
||||
|
||||
$MAR_BIN = 'dist/host/bin/mar';
|
||||
$MBSDIFF_BIN = 'dist/host/bin/mbsdiff';
|
||||
|
||||
$INCREMENTAL_UPDATE_BIN = 'tools/update-packaging/make_incremental_update.sh';
|
||||
$FAST_INCREMENTAL_UPDATE_BIN = 'tools/update-packaging/make_incremental_updates.py';
|
||||
$UNWRAP_FULL_UPDATE_BIN = 'tools/update-packaging/unwrap_full_update.pl';
|
||||
|
||||
$MAKE_BIN = '/usr/bin/make';
|
||||
$TMPDIR_PREFIX = '/dev/shm/tmp/MozAUSLib';
|
||||
|
||||
%BOUNCER_PLATFORMS = ( 'win32' => 'win',
|
||||
'wince-arm' => 'wince',
|
||||
'linux-i686' => 'linux',
|
||||
'linux-x86_64' => 'linux64',
|
||||
'mac' => 'osx',
|
||||
'mac64' => 'osx64',
|
||||
'unimac' => 'osx',
|
||||
);
|
||||
|
||||
%FILEPATH_PLATFORMS = ( 'win32' => 'win32',
|
||||
'linux-i686' => 'linux-i686',
|
||||
'linux-x86_64' => 'linux-x86_64',
|
||||
'mac' => 'mac',
|
||||
'mac64' => 'mac',
|
||||
);
|
||||
|
||||
%AUS2_PLATFORMS = ( 'macppc' => ['Darwin_ppc-gcc3'],
|
||||
'mac' => ['Darwin_x86-gcc3-u-ppc-i386'],
|
||||
'mac64' => ['Darwin_x86_64-gcc3',
|
||||
'Darwin_x86-gcc3-u-i386-x86_64',
|
||||
'Darwin_x86_64-gcc3-u-i386-x86_64'],
|
||||
'linux-i686' => ['Linux_x86-gcc3'],
|
||||
'linux-x86_64' => ['Linux_x86_64-gcc3'],
|
||||
'win32' => ['WINNT_x86-msvc'],
|
||||
'wince-arm' => ['WINCE_arm-msvc'],
|
||||
);
|
||||
|
||||
$DEFAULT_PARTIAL_MAR_OUTPUT_FILE = 'partial.mar';
|
||||
|
||||
$DEFAULT_SNIPPET_BASE_DIR = 'aus2';
|
||||
$DEFAULT_SNIPPET_TEST_DIR = $DEFAULT_SNIPPET_BASE_DIR . '.test';
|
||||
|
||||
##
|
||||
## Global, used by CachedHashFile()
|
||||
##
|
||||
|
||||
$SNIPPET_CHECKSUM_HASH_CACHE = {};
|
||||
|
||||
sub CachedHashFile {
|
||||
my %args = @_;
|
||||
|
||||
if (! exists($args{'file'}) || !exists($args{'type'})) {
|
||||
die("ASSERT: CachedHashFile: null file and/or type");
|
||||
}
|
||||
|
||||
# Let HashFile do all the heavy error checking lifting...
|
||||
my $file = $args{'file'};
|
||||
my $checksumType = $args{'type'};
|
||||
|
||||
if (! exists($SNIPPET_CHECKSUM_HASH_CACHE->{$file})) {
|
||||
$SNIPPET_CHECKSUM_HASH_CACHE->{$file} = {};
|
||||
}
|
||||
|
||||
if (! exists($SNIPPET_CHECKSUM_HASH_CACHE->{$file}->{$checksumType})) {
|
||||
$SNIPPET_CHECKSUM_HASH_CACHE->{$file}->{$checksumType} =
|
||||
HashFile(file => $file, type => $checksumType);
|
||||
}
|
||||
|
||||
return $SNIPPET_CHECKSUM_HASH_CACHE->{$file}->{$checksumType};
|
||||
|
||||
}
|
||||
|
||||
sub EnsureDeliverablesDir
|
||||
{
|
||||
my %args = @_;
|
||||
|
||||
die "ASSERT: null config spec\n" if (not defined($args{'config'}));
|
||||
my $configSpec = $args{'config'};
|
||||
|
||||
my $fullDeliverableDirPath = catfile($configSpec->GetDeliverableDir(),
|
||||
lc($configSpec->GetApp()));
|
||||
|
||||
MkdirWithPath(dir => $fullDeliverableDirPath, mask => 0751) or
|
||||
die "ASSERT: EnsureDeliverablesDir(): " .
|
||||
"MkdirWithPath($fullDeliverableDirPath) failed\n";
|
||||
return $fullDeliverableDirPath;
|
||||
}
|
||||
|
||||
sub ValidateToolsDirectory
|
||||
{
|
||||
my %args = @_;
|
||||
my $toolsDir= $args{'toolsDir'};
|
||||
|
||||
if ($toolsDir !~ /^\//) {
|
||||
die "ASSERT: ValidateToolsDirectory() requires a full path: $toolsDir\n";
|
||||
}
|
||||
|
||||
my $binPrefix = "$toolsDir/mozilla";
|
||||
return (-d $binPrefix and
|
||||
-x "$binPrefix/$MAR_BIN" and
|
||||
-x "$binPrefix/$MBSDIFF_BIN" and
|
||||
-x "$binPrefix/$FAST_INCREMENTAL_UPDATE_BIN" and
|
||||
-x "$binPrefix/$INCREMENTAL_UPDATE_BIN" and
|
||||
-x "$binPrefix/$UNWRAP_FULL_UPDATE_BIN");
|
||||
}
|
||||
|
||||
sub GetAUS2PlatformStrings
|
||||
{
|
||||
my %retHash = %AUS2_PLATFORMS;
|
||||
return %retHash;
|
||||
}
|
||||
|
||||
sub GetBouncerPlatformStrings
|
||||
{
|
||||
my %retHash = %BOUNCER_PLATFORMS;
|
||||
return %retHash;
|
||||
}
|
||||
|
||||
sub GetFilepathPlatformStrings
|
||||
{
|
||||
my %retHash = %FILEPATH_PLATFORMS;
|
||||
return %retHash;
|
||||
}
|
||||
|
||||
sub CreatePartialMarFile
|
||||
{
|
||||
my %args = @_;
|
||||
|
||||
my $fromCompleteMar = $args{'from'};
|
||||
my $toCompleteMar = $args{'to'};
|
||||
my $outputDir = $args{'outputDir'} || getcwd();
|
||||
my $outputFile = $args{'outputFile'} || $DEFAULT_PARTIAL_MAR_OUTPUT_FILE;
|
||||
my $mozdir = $args{'mozdir'};
|
||||
my $forceList = $args{'force'};
|
||||
|
||||
my $startingWd = getcwd();
|
||||
|
||||
if (not defined($mozdir)) {
|
||||
die "ASSERT: CreatePartialMarFile(): mozdir undefined\n";
|
||||
}
|
||||
|
||||
if (not ValidateToolsDirectory(toolsDir => $mozdir)) {
|
||||
print STDERR "Invalid Mozilla working dir: $mozdir\n";
|
||||
return -1;
|
||||
} else {
|
||||
# We actually want the CVS directory itself...
|
||||
$mozdir .= '/mozilla';
|
||||
}
|
||||
|
||||
my $mar = "$mozdir/$MAR_BIN";
|
||||
my $mbsdiff = "$mozdir/$MBSDIFF_BIN";
|
||||
my $makeIncrementalUpdate = "$mozdir/$INCREMENTAL_UPDATE_BIN";
|
||||
|
||||
# Seed PRNG.
|
||||
srand (time() ^ $PID ^ unpack "%L*", `ps axww|gzip`);
|
||||
my $tmpDir = "$TMPDIR_PREFIX.CreatePartialMarFile/$PID/" .
|
||||
int(rand(1000000));
|
||||
|
||||
my $fromDir = "$tmpDir/from";
|
||||
my $toDir = "$tmpDir/to";
|
||||
my $partialDir = "$tmpDir/partial";
|
||||
|
||||
my @createdDirs = ($tmpDir, $fromDir, $toDir, $partialDir);
|
||||
|
||||
foreach my $dir (@createdDirs) {
|
||||
if (not MkdirWithPath(dir => $dir)) {
|
||||
print STDERR "MkdirWithPath() failed on $dir: $EVAL_ERROR\n";
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
if ( not -r $fromCompleteMar) {
|
||||
print STDERR "CreatePartialMarFile: $fromCompleteMardoesn't exist!";
|
||||
return -1;
|
||||
}
|
||||
|
||||
if ( not -r $toCompleteMar ) {
|
||||
print STDERR "CreatePartialMarFile: $toCompleteMar doesn't exist!";
|
||||
return -1;
|
||||
}
|
||||
|
||||
# XXX - Add check here to verify md5/sha1 checksum of file is as-expected.
|
||||
|
||||
# Extract the source MAR file.
|
||||
$ENV{'MAR'} = $mar;
|
||||
|
||||
my $extractCommand = catfile($mozdir, $UNWRAP_FULL_UPDATE_BIN);
|
||||
my $unwrapArgs = [catfile($startingWd, $fromCompleteMar)];
|
||||
|
||||
printf("Decompressing $fromCompleteMar with $extractCommand " .
|
||||
join(" ", @{$unwrapArgs}) . "...\n");
|
||||
chdir($fromDir) or die "chdir() $fromDir failed: $ERRNO";
|
||||
|
||||
my $rv = RunShellCommand(command => $extractCommand,
|
||||
args => $unwrapArgs,
|
||||
output => 1);
|
||||
|
||||
if ($rv->{'exitValue'} != 0) {
|
||||
die "FAILED: $extractCommand: $rv->{'exitValue'}, output: $rv->{'output'}\n";
|
||||
}
|
||||
|
||||
printf("done\n");
|
||||
|
||||
# Extract the destination MAR file.
|
||||
|
||||
$unwrapArgs = [catfile($startingWd, $toCompleteMar)];
|
||||
printf("Decompressing $toCompleteMar with $extractCommand " .
|
||||
join(" ", @{$unwrapArgs}) . "...\n");
|
||||
chdir($toDir) or die "chdir() $toDir failed: $ERRNO";;
|
||||
|
||||
$rv = RunShellCommand(command => $extractCommand,
|
||||
args => $unwrapArgs,
|
||||
output => 1);
|
||||
|
||||
if ($rv->{'exitValue'} != 0) {
|
||||
die "FAILED: $extractCommand: $rv->{'exitValue'}, output: $rv->{'output'}\n";
|
||||
}
|
||||
|
||||
printf("done\n");
|
||||
|
||||
# Build the partial patch.
|
||||
chdir($mozdir);
|
||||
|
||||
my $outputMar = catfile($mozdir, $DEFAULT_PARTIAL_MAR_OUTPUT_FILE);
|
||||
$ENV{'MBSDIFF'} = $mbsdiff;
|
||||
|
||||
my $incrUpdateArgs = [];
|
||||
|
||||
# Tack any force arguments onto the beginning of the arg list
|
||||
if (defined($forceList) && scalar(@{$forceList}) > 0) {
|
||||
foreach my $file (@{$forceList}) {
|
||||
push(@{$incrUpdateArgs}, ('-f', $file));
|
||||
}
|
||||
}
|
||||
|
||||
push(@{$incrUpdateArgs}, ($outputMar, $fromDir, $toDir));
|
||||
|
||||
printf("Building partial update with: $makeIncrementalUpdate " .
|
||||
join(" ", @{$incrUpdateArgs}) . "\n...");
|
||||
|
||||
$rv = RunShellCommand(command => $makeIncrementalUpdate,
|
||||
args => $incrUpdateArgs,
|
||||
output => 1);
|
||||
|
||||
if ($rv->{'exitValue'} != 0) {
|
||||
die "FAILED: $makeIncrementalUpdate: $rv->{'exitValue'}, " .
|
||||
"output: $rv->{'output'}\n";
|
||||
}
|
||||
|
||||
printf("done\n");
|
||||
|
||||
if (-f $outputMar) {
|
||||
printf("Found $outputMar.\n");
|
||||
} else {
|
||||
print STDERR "Couldn't find partial output mar: $outputMar\n";
|
||||
}
|
||||
|
||||
my $finalDeliverable = catfile($outputDir, $outputFile);
|
||||
printf("Moving $outputMar to $finalDeliverable... \n");
|
||||
move($outputMar, $finalDeliverable) or
|
||||
die "move($outputMar, $finalDeliverable) failed: $ERRNO";
|
||||
printf("done\n");
|
||||
|
||||
printf("Removing temporary directories...\n");
|
||||
foreach my $dir (@createdDirs ) {
|
||||
printf("\tRemoving $dir...\n");
|
||||
eval { rmtree($dir) };
|
||||
if ($EVAL_ERROR) {
|
||||
print STDERR "rmtree on $dir failed; $EVAL_ERROR";
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
printf("done\n");
|
||||
|
||||
chdir($startingWd) or die "Couldn't chdir() back to $startingWd: $ERRNO";
|
||||
return 1;
|
||||
}
|
||||
|
||||
sub SubstitutePath
|
||||
{
|
||||
my %args = @_;
|
||||
|
||||
my $string = $args{'path'} ||
|
||||
die 'ASSERT: SubstitutePath() called with null path';
|
||||
my $platform = $args{'platform'} || 'UNDEFINED';
|
||||
my $locale = $args{'locale'} ||'UNDEFINED';
|
||||
my $version = $args{'version'} || 'UNDEFINED';
|
||||
my $app = $args{'app'} || 'UNDEFINED';
|
||||
my $filepath_platform = 'UNDEFINED';
|
||||
|
||||
my %bouncer_platforms = GetBouncerPlatformStrings();
|
||||
my $bouncer_platform = $bouncer_platforms{$platform};
|
||||
|
||||
if ($platform ne 'UNDEFINED') {
|
||||
my %filepath_platforms = GetFilepathPlatformStrings();
|
||||
$filepath_platform = $filepath_platforms{$platform};
|
||||
}
|
||||
|
||||
$string =~ s/%platform%/$filepath_platform/g;
|
||||
$string =~ s/%locale%/$locale/g;
|
||||
$string =~ s/%bouncer\-platform%/$bouncer_platform/g;
|
||||
$string =~ s/%version%/$version/g;
|
||||
$string =~ s/%app%/$app/g;
|
||||
|
||||
return $string;
|
||||
}
|
||||
|
||||
sub GetSnippetDirFromChannel {
|
||||
my %args = @_;
|
||||
die 'ASSERT: GetSnippetDirFromChannel(): null/invalid update config ' .
|
||||
"object\n" if (!exists($args{'config'}) || ref($args{'config'}) ne 'HASH');
|
||||
die "ASSERT: GetSnippetDirFromChannel(): null channel\n" if (
|
||||
!exists($args{'channel'}));
|
||||
|
||||
my $channel = $args{'channel'};
|
||||
my $currentUpdateConfig = $args{'config'};
|
||||
|
||||
die "ASSERT: GetSnippetDirFromChannel(): invalid update config object\n"
|
||||
if (! exists($currentUpdateConfig->{'to'}) ||
|
||||
!exists($currentUpdateConfig->{'from'}));
|
||||
|
||||
my $snippetDirTestKey = $channel . '-dir';
|
||||
|
||||
if (exists($currentUpdateConfig->{$snippetDirTestKey})) {
|
||||
return $DEFAULT_SNIPPET_BASE_DIR . '.' .
|
||||
$currentUpdateConfig->{$snippetDirTestKey};
|
||||
} elsif ($channel =~ /test(-\w+)?$/) {
|
||||
return $DEFAULT_SNIPPET_TEST_DIR;
|
||||
} else {
|
||||
return $DEFAULT_SNIPPET_BASE_DIR;
|
||||
}
|
||||
}
|
||||
1;
|
||||
@@ -1,22 +0,0 @@
|
||||
patcher is a tool to generate updates for Mozilla based products.
|
||||
|
||||
Run ./patcher2.pl --help for usage info.
|
||||
|
||||
Features:
|
||||
|
||||
* download complete updates
|
||||
* generate partial patches
|
||||
* generate configuration files for AUS (Automatic Update Service)
|
||||
|
||||
Requires:
|
||||
|
||||
* MozBuild package (from mozilla/tools/build/MozBuild)
|
||||
* Config::General
|
||||
* wget
|
||||
|
||||
Patcher is only supported on Linux right now.
|
||||
|
||||
Troubleshooting:
|
||||
|
||||
* "Can't use an undefined value as a HASH reference at MozAUSConfig.pm line 236."
|
||||
Make sure that "--app" is specified on the command line.
|
||||
@@ -1,130 +0,0 @@
|
||||
# ***** BEGIN LICENSE BLOCK *****
|
||||
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
#
|
||||
# The contents of this file are subject to the Mozilla Public License Version
|
||||
# 1.1 (the "License"); you may not use this file except in compliance with
|
||||
# the License. You may obtain a copy of the License at
|
||||
# http://www.mozilla.org/MPL/
|
||||
#
|
||||
# Software distributed under the License is distributed on an "AS IS" basis,
|
||||
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
# for the specific language governing rights and limitations under the
|
||||
# License.
|
||||
#
|
||||
# The Original Code is Patcher 2, a patch generator for the AUS2 system.
|
||||
#
|
||||
# The Initial Developer of the Original Code is
|
||||
# Mozilla Corporation
|
||||
#
|
||||
# Portions created by the Initial Developer are Copyright (C) 2006
|
||||
# the Initial Developer. All Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
# Chase Phillips (chase@mozilla.org)
|
||||
# J. Paul Reed (preed@mozilla.com)
|
||||
#
|
||||
# Alternatively, the contents of this file may be used under the terms of
|
||||
# either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
# in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
# of those above. If you wish to allow use of your version of this file only
|
||||
# under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
# use your version of this file under the terms of the MPL, indicate your
|
||||
# decision by deleting the provisions above and replace them with the notice
|
||||
# and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
# the provisions above, a recipient may use your version of this file under
|
||||
# the terms of any one of the MPL, the GPL or the LGPL.
|
||||
#
|
||||
# ***** END LICENSE BLOCK *****
|
||||
#
|
||||
#
|
||||
###
|
||||
### NOTICE: This is a sample configuration; these are dummy values; you'll
|
||||
### need to customize for your app.
|
||||
###
|
||||
#
|
||||
|
||||
<app MyApp>
|
||||
past-update = 1.0 1.0.1 beta betatest release releasetest
|
||||
|
||||
<current-update>
|
||||
from = 1.0.1
|
||||
to = 1.0.2
|
||||
channel = beta release
|
||||
testchannel = betatest releasetest
|
||||
details = "http://www.example.com/myapp/releases/1.0.2.html"
|
||||
|
||||
<complete>
|
||||
path = "myapp/1.0.2-candidates/myapp-1.0.2.%locale%.%platform%.mar"
|
||||
url = "http://download.example.com/1.0.2/myapp.%locale%.mar"
|
||||
testurl = "http://staging.example.com/1.0.2/myapp.%locale%.mar"
|
||||
</complete>
|
||||
<partial>
|
||||
path = "myapp/1.0.2-candidates/myapp-1.0.2.%locale%.%platform%.partial.mar"
|
||||
url = "http://download.example.com/1.0.2/myapp.%locale%.partial.mar"
|
||||
testurl = "http://staging.example.com/1.0.2/myapp.%locale%.partial.mar"
|
||||
</partial>
|
||||
</current-update>
|
||||
|
||||
<release 1.0>
|
||||
version = 1.0
|
||||
completemarurl = "http://download.example.com/1.0.0/myapp.%locale%.mar"
|
||||
|
||||
<platforms>
|
||||
win32 = 2000111111
|
||||
linux-i686 = 2000111111
|
||||
macppc = 2000111111
|
||||
</platforms>
|
||||
|
||||
locales = ar ca cs da de el en-GB en-US es-AR es-ES eu fi fr ga-IE \
|
||||
pl pt-BR ro ru sk sl sv-SE tr zh-CN zh-TW
|
||||
|
||||
<exceptions>
|
||||
pa-IN = win32, linux-i686
|
||||
gu-IN = win32, linux-i686
|
||||
ja = win32, linux-i686
|
||||
ja-JP-mac = macppc, mac
|
||||
</exceptions>
|
||||
</release>
|
||||
<release 1.0.1>
|
||||
version = 1.0.1
|
||||
completemarurl = "http://download.example.com/1.0.1/myapp.%locale%.mar"
|
||||
|
||||
<platforms>
|
||||
win32 = 2000111112
|
||||
linux-i686 = 2000111112
|
||||
macppc = 2000111112
|
||||
</platforms>
|
||||
|
||||
locales = ar ca cs da de el en-GB en-US es-AR es-ES eu fi fr ga-IE \
|
||||
pl pt-BR ro ru sk sl sv-SE tr zh-CN zh-TW
|
||||
|
||||
<exceptions>
|
||||
pa-IN = win32, linux-i686
|
||||
gu-IN = win32, linux-i686
|
||||
ja = win32, linux-i686
|
||||
ja-JP-mac = macppc
|
||||
</exceptions>
|
||||
</release>
|
||||
<release 1.0.2>
|
||||
version = 1.0.2
|
||||
completemarurl = "http://download.example.com/1.0.2/myapp.%locale%.mar"
|
||||
|
||||
<platforms>
|
||||
win32 = 2000111113
|
||||
linux-i686 = 2000111113
|
||||
macppc = 2000111113
|
||||
mac = 2000111113
|
||||
</platforms>
|
||||
|
||||
locales = ar bg ca cs da de el en-GB en-US es-AR es-ES eu fi fr ga-IE \
|
||||
pl pt-BR ro ru sk sl sv-SE tr zh-CN zh-TW
|
||||
|
||||
<exceptions>
|
||||
pa-IN = win32, linux-i686
|
||||
gu-IN = win32, linux-i686
|
||||
ja = win32, linux-i686
|
||||
ja-JP-mac = mac, macppc
|
||||
</exceptions>
|
||||
</release>
|
||||
</app>
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,383 +0,0 @@
|
||||
#
|
||||
# Config object for release automation
|
||||
#
|
||||
|
||||
package Bootstrap::Config;
|
||||
|
||||
use strict;
|
||||
|
||||
use POSIX "uname";
|
||||
use File::Copy qw(move);
|
||||
|
||||
use Bootstrap::Util qw(GetLocaleManifest CvsCatfile);
|
||||
use Bootstrap::Util qw(GetFtpNightlyDir);
|
||||
|
||||
# shared static config
|
||||
my %config;
|
||||
|
||||
# single shared instance
|
||||
my $singleton = undef;
|
||||
|
||||
sub new {
|
||||
my $proto = shift;
|
||||
my $class = ref($proto) || $proto;
|
||||
|
||||
return $singleton if defined $singleton;
|
||||
|
||||
my $this = {};
|
||||
bless($this, $class);
|
||||
$this->Parse();
|
||||
$singleton = $this;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
sub Parse {
|
||||
my $this = shift;
|
||||
|
||||
open(CONFIG, "< bootstrap.cfg")
|
||||
|| die("Can't open config file bootstrap.cfg");
|
||||
|
||||
while (<CONFIG>) {
|
||||
# no comments or empty lines
|
||||
next if ($_ =~ /^#/ || $_ =~ /^\s*$/);
|
||||
s/^\s+//; # no leading white
|
||||
s/\s+$//; # no trailing white
|
||||
chomp $_; # no newline
|
||||
my ($var, $value) = split(/\s*=\s*/, $_, 2);
|
||||
$this->Set(var => $var, value => $value);
|
||||
}
|
||||
close(CONFIG);
|
||||
}
|
||||
|
||||
##
|
||||
# Get checks to see if a variable exists and returns it.
|
||||
# Returns scalar
|
||||
#
|
||||
# This method supports system-specific overrides, or "sysvar"s.
|
||||
# For example, if a caller is on win32 and does
|
||||
# Get(sysvar => "buildDir") and win32_buildDir exists, the value of
|
||||
# win32_buildDir will be returned. If not, the value of buildDir will
|
||||
# be returned. Otherwise, the die() assertion will be hit.
|
||||
##
|
||||
|
||||
sub Get {
|
||||
my $this = shift;
|
||||
|
||||
my %args = @_;
|
||||
my $var = $args{'var'};
|
||||
# sysvar will attempt to prepend the OS name to the requested var
|
||||
my $sysvar = $args{'sysvar'};
|
||||
|
||||
if ((! defined($args{'var'})) && (! defined($args{'sysvar'}))) {
|
||||
die "ASSERT: Bootstep::Config::Get(): null var requested";
|
||||
} elsif ((defined($args{'var'})) && (defined($args{'sysvar'}))) {
|
||||
die "ASSERT: Bootstep::Config::Get(): both var and sysvar requested";
|
||||
}
|
||||
|
||||
if (defined($args{'sysvar'})) {
|
||||
# look for a system specific var first
|
||||
my $osname = $this->SystemInfo(var => 'osname');
|
||||
my $sysvarOverride = $osname . '_' . $sysvar;
|
||||
|
||||
if ($this->Exists(var => $sysvarOverride)) {
|
||||
return $config{$sysvarOverride};
|
||||
} elsif ($this->Exists(var => $sysvar)) {
|
||||
return $config{$sysvar};
|
||||
} else {
|
||||
die("No such system config variable: $sysvar");
|
||||
}
|
||||
} elsif ($this->Exists(var => $var)) {
|
||||
return $config{$var};
|
||||
} else {
|
||||
die("No such config variable: $var");
|
||||
}
|
||||
}
|
||||
|
||||
sub Set {
|
||||
my $this = shift;
|
||||
|
||||
my %args = @_;
|
||||
|
||||
die "ASSERT: Config::Set(): null var and/or value\n" if
|
||||
(!exists($args{'var'}) || !exists($args{'value'}));
|
||||
|
||||
die "ASSERT: Config::Set(): Cannot set null var\n" if
|
||||
(!defined($args{'var'}) ||
|
||||
(defined($args{'var'}) && $args{'var'} =~ /^\s*$/));
|
||||
|
||||
my $var = $args{'var'};
|
||||
my $value = $args{'value'};
|
||||
my $force = exists($args{'force'}) ? $args{'force'} : 0;
|
||||
|
||||
die "ASSERT: Config::Set(): $var already exists ($value)\n" if
|
||||
(!$force && exists($config{$var}));
|
||||
|
||||
die "ASSERT: Config::Set(): Attempt to set null value for var $var\n" if
|
||||
(!$force && (!defined($value) || $value =~ /^\s*$/));
|
||||
|
||||
return ($config{$var} = $value);
|
||||
}
|
||||
|
||||
sub GetLocaleInfo {
|
||||
my $this = shift;
|
||||
|
||||
if (! $this->Exists(var => 'localeInfo')) {
|
||||
my $localeFileTag = $this->Get(var => 'productTag') . '_RELEASE';
|
||||
$config{'localeInfo'} = GetLocaleManifest(
|
||||
app => $this->Get(var => 'appName'),
|
||||
cvsroot => $this->Get(var => 'mozillaCvsroot'),
|
||||
tag => $localeFileTag);
|
||||
}
|
||||
|
||||
return $this->Get(var => 'localeInfo');
|
||||
}
|
||||
|
||||
##
|
||||
# GetFtpCandidateDir - construct the FTP path for pushing builds & updates to
|
||||
# returns scalar
|
||||
#
|
||||
# mandatory argument:
|
||||
# bitsUnsigned - boolean - 1 for unsigned, 0 for signed
|
||||
# adds "unsigned/" prefix for windows and version >= 2.0
|
||||
##
|
||||
|
||||
sub GetFtpCandidateDir {
|
||||
my $this = shift;
|
||||
my %args = @_;
|
||||
|
||||
if (! defined($args{'bitsUnsigned'})) {
|
||||
die "ASSERT: Bootstep::Config::GetFtpCandidateDir(): bitsUnsigned is a required argument";
|
||||
}
|
||||
my $bitsUnsigned = $args{'bitsUnsigned'};
|
||||
|
||||
my $version = $this->Get(var => 'version');
|
||||
my $build = $this->Get(var => 'build');
|
||||
|
||||
my $candidateDir = CvsCatfile(GetFtpNightlyDir(), $version . '-candidates', 'build' . $build ) . '/';
|
||||
|
||||
my $osFileMatch = $this->SystemInfo(var => 'osname');
|
||||
|
||||
if ($bitsUnsigned && ($osFileMatch eq 'win32') && ($version ge '2.0')) {
|
||||
$candidateDir .= 'unsigned/';
|
||||
}
|
||||
|
||||
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';
|
||||
}
|
||||
|
||||
sub GetVersion {
|
||||
my $this = shift;
|
||||
my %args = @_;
|
||||
|
||||
if (! defined($args{'longName'})) {
|
||||
die "ASSERT: Bootstep::Config::GetVersion(): longName is a required argument";
|
||||
}
|
||||
my $longName = $args{'longName'};
|
||||
|
||||
my $version = $this->Get(var => 'version');
|
||||
my $longVersion = $version;
|
||||
$longVersion =~ s/a([0-9]+)$/ Alpha $1/;
|
||||
$longVersion =~ s/b([0-9]+)$/ Beta $1/;
|
||||
$longVersion =~ s/rc([0-9]+)$/ RC $1/;
|
||||
|
||||
return ($longName) ? $longVersion : $version;
|
||||
}
|
||||
|
||||
# Sometimes we need the application version to be different from what we "call"
|
||||
# the build, eg public release candidates for a major release (3.0 RC1). The var
|
||||
# appVersion is an optional definition used for $appName/config/version.txt, and
|
||||
# hence in the filenames coming off the tinderbox.
|
||||
sub GetAppVersion {
|
||||
my $this = shift;
|
||||
|
||||
return ($this->Exists(var => 'appVersion')) ?
|
||||
$this->Get(var => 'appVersion') : $this->GetVersion(longName => 0);
|
||||
}
|
||||
|
||||
sub GetOldVersion {
|
||||
my $this = shift;
|
||||
my %args = @_;
|
||||
|
||||
if (! defined($args{'longName'})) {
|
||||
die "ASSERT: Bootstep::Config::GetOldVersion(): longName is a required argument";
|
||||
}
|
||||
my $longName = $args{'longName'};
|
||||
|
||||
my $oldVersion = $this->Get(var => 'oldVersion');
|
||||
my $oldLongVersion = $oldVersion;
|
||||
$oldLongVersion =~ s/a([0-9]+)$/ Alpha $1/;
|
||||
$oldLongVersion =~ s/b([0-9]+)$/ Beta $1/;
|
||||
$oldLongVersion =~ s/rc([0-9]+)$/ RC $1/;
|
||||
|
||||
return ($longName) ? $oldLongVersion : $oldVersion;
|
||||
}
|
||||
|
||||
# Like GetAppVersion(), but for the previous release
|
||||
# eg we're doing 3.0RC2 and need to refer to 3.0RC1
|
||||
sub GetOldAppVersion {
|
||||
my $this = shift;
|
||||
|
||||
return ($this->Exists(var => 'oldAppVersion')) ?
|
||||
$this->Get(var => 'oldAppVersion') : $this->GetOldVersion(longName => 0);
|
||||
}
|
||||
|
||||
##
|
||||
# Exists checks to see if a config variable exists.
|
||||
# Returns boolean (1 or 0)
|
||||
#
|
||||
# This method supports system-specific overrides, or "sysvar"s.
|
||||
# For example, if a caller is on win32 and does
|
||||
# Exists(sysvar => "win32_buildDir") and only buildDir exists, a 0
|
||||
# will be returned. There is no "fallback" as in the case of Get.
|
||||
##
|
||||
|
||||
sub Exists {
|
||||
my $this = shift;
|
||||
my %args = @_;
|
||||
my $var = $args{'var'};
|
||||
# sysvar will attempt to prepend the OS name to the requested var
|
||||
my $sysvar = $args{'sysvar'};
|
||||
|
||||
if ((! defined($args{'var'})) && (! defined($args{'sysvar'}))) {
|
||||
die "ASSERT: Bootstep::Config::Get(): null var requested";
|
||||
} elsif ((defined($args{'var'})) && (defined($args{'sysvar'}))) {
|
||||
die "ASSERT: Bootstep::Config::Get(): both var and sysvar requested";
|
||||
}
|
||||
|
||||
if (defined($args{'sysvar'})) {
|
||||
# look for a system specific var first
|
||||
my $osname = $this->SystemInfo(var => 'osname');
|
||||
my $sysvarOverride = $osname . '_' . $sysvar;
|
||||
|
||||
if (exists($config{$sysvarOverride})) {
|
||||
return 1;
|
||||
} elsif (exists($config{$sysvar})) {
|
||||
return 1;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
} else {
|
||||
return exists($config{$var});
|
||||
}
|
||||
}
|
||||
|
||||
sub SystemInfo {
|
||||
my $this = shift;
|
||||
my %args = @_;
|
||||
|
||||
my $var = $args{'var'};
|
||||
|
||||
my ($sysname, $hostname, $release, $version, $machine ) = uname;
|
||||
|
||||
if ($var eq 'sysname') {
|
||||
return $sysname;
|
||||
} elsif ($var eq 'hostname') {
|
||||
return $hostname;
|
||||
} elsif ($var eq 'release') {
|
||||
return $release;
|
||||
} elsif ($var eq 'version') {
|
||||
return $version;
|
||||
} elsif ($var eq 'machine') {
|
||||
return $machine;
|
||||
} elsif ($var eq 'osname') {
|
||||
if ($sysname =~ /cygwin/i || $sysname =~ /mingw32/i) {
|
||||
return 'win32';
|
||||
} elsif ($sysname =~ /darwin/i) {
|
||||
return 'macosx';
|
||||
} elsif ($sysname =~ /linux/i) {
|
||||
return 'linux';
|
||||
} else {
|
||||
die("Unrecognized OS: $sysname");
|
||||
}
|
||||
} else {
|
||||
die("No system info named $var");
|
||||
}
|
||||
}
|
||||
|
||||
##
|
||||
# Bump - modifies config files
|
||||
#
|
||||
# Searches and replaces lines of the form:
|
||||
# # CONFIG: $BuildTag = '%productTag%_RELEASE';
|
||||
# $BuildTag = 'FIREFOX_1_5_0_9_RELEASE';
|
||||
#
|
||||
# The comment containing "CONFIG:" is parsed, and the value in between %%
|
||||
# is treated as the key. The next line will be overwritten by the value
|
||||
# matching this key in the private %config hash.
|
||||
#
|
||||
# If any of the requested keys are not found, this function calls die().
|
||||
##
|
||||
|
||||
sub Bump {
|
||||
my $this = shift;
|
||||
my %args = @_;
|
||||
|
||||
my $config = new Bootstrap::Config();
|
||||
|
||||
my $configFile = $args{'configFile'};
|
||||
if (! defined($configFile)) {
|
||||
die('ASSERT: Bootstrap::Config::Bump - configFile is a required argument');
|
||||
}
|
||||
|
||||
my $tmpFile = $configFile . '.tmp';
|
||||
|
||||
open(INFILE, "< $configFile")
|
||||
or die ("Bootstrap::Config::Bump - Could not open $configFile for reading: $!");
|
||||
open(OUTFILE, "> $tmpFile")
|
||||
or die ("Bootstrap::Config::Bump - Could not open $tmpFile for writing: $!");
|
||||
|
||||
my $skipNextLine = 0;
|
||||
my $KEY_REGEX = qr/ ([\w\-]+) /x;
|
||||
foreach my $line (<INFILE>) {
|
||||
if ($skipNextLine) {
|
||||
$skipNextLine = 0;
|
||||
next;
|
||||
} elsif ($line =~ /^# CONFIG:\s+/) {
|
||||
print OUTFILE $line;
|
||||
$skipNextLine = 1;
|
||||
my $interpLine = $line;
|
||||
$interpLine =~ s/^#\s+CONFIG:\s+//;
|
||||
foreach my $variable (grep(/%/,split(/(%$KEY_REGEX?%)/, $line))) {
|
||||
my $key = $variable;
|
||||
if (! ($key =~ s/.*%($KEY_REGEX)%.*/$1/)) {
|
||||
die("ASSERT: could not parse $variable");
|
||||
}
|
||||
|
||||
$key =~ s/^%(.*)%$/$1/;
|
||||
|
||||
if ($key =~ /^\s*$/) {
|
||||
die("ASSERT: could not get key from $variable");
|
||||
}
|
||||
|
||||
if (! $config->Exists(sysvar => $key)) {
|
||||
die("ASSERT: no replacement found for $key");
|
||||
}
|
||||
my $value = $config->Get(sysvar => $key);
|
||||
$interpLine =~ s/\%$key\%/$value/g;
|
||||
}
|
||||
print OUTFILE $interpLine;
|
||||
} else {
|
||||
print OUTFILE $line;
|
||||
}
|
||||
}
|
||||
|
||||
close(INFILE) or die ("Bootstrap::Config::Bump - Could not close $configFile for reading: $!");
|
||||
close(OUTFILE) or die ("Bootstrap::Config::Bump - Could not close $tmpFile for writing: $!");
|
||||
|
||||
move($tmpFile, $configFile)
|
||||
or die("Cannot rename $tmpFile to $configFile: $!");
|
||||
|
||||
}
|
||||
|
||||
1;
|
||||
@@ -1,436 +0,0 @@
|
||||
#
|
||||
# Base class for all Steps.
|
||||
#
|
||||
|
||||
package Bootstrap::Step;
|
||||
|
||||
use IO::Handle;
|
||||
use File::Spec::Functions;
|
||||
use POSIX qw(strftime);
|
||||
use File::Basename;
|
||||
use File::Path;
|
||||
use File::Temp qw(tempfile);
|
||||
|
||||
use Bootstrap::Config;
|
||||
use Bootstrap::Util qw(CvsCatfile GetPushRepo);
|
||||
use MozBuild::Util qw(RunShellCommand Email);
|
||||
|
||||
use base 'Exporter';
|
||||
|
||||
our @EXPORT = qw(catfile);
|
||||
|
||||
my $DEFAULT_LOGFILE = 'default.log';
|
||||
|
||||
sub new {
|
||||
my $proto = shift;
|
||||
my $class = ref($proto) || $proto;
|
||||
my $this = {};
|
||||
bless($this, $class);
|
||||
return $this;
|
||||
}
|
||||
|
||||
sub Shell {
|
||||
my $this = shift;
|
||||
my %args = @_;
|
||||
my $cmd = $args{'cmd'};
|
||||
my $cmdArgs = exists($args{'cmdArgs'}) ? $args{'cmdArgs'} : [];
|
||||
my $dir = $args{'dir'};
|
||||
my $timeout = exists($args{'timeout'}) ? $args{'timeout'} :
|
||||
$Bootstrap::Util::DEFAULT_SHELL_TIMEOUT;
|
||||
my $ignoreExitValue = exists($args{'ignoreExitValue'}) ?
|
||||
$args{'ignoreExitValue'} : 0;
|
||||
my $rv = '';
|
||||
my $config = new Bootstrap::Config();
|
||||
|
||||
my $logFile = exists($args{'logFile'}) ? $args{'logFile'} :
|
||||
catfile($config->Get(sysvar => 'logDir'), $DEFAULT_LOGFILE);
|
||||
|
||||
if (ref($cmdArgs) ne 'ARRAY') {
|
||||
die("ASSERT: Bootstrap::Step::Shell(): cmdArgs is not an array ref\n");
|
||||
}
|
||||
|
||||
my %runShellCommandArgs = (command => $cmd,
|
||||
args => $cmdArgs,
|
||||
timeout => $timeout,
|
||||
logfile => $logFile);
|
||||
|
||||
if ($config->Exists(var => 'dumpLogs')) {
|
||||
if ($config->Get(var => 'dumpLogs')) {
|
||||
$runShellCommandArgs{'output'} = 1;
|
||||
}
|
||||
}
|
||||
|
||||
if ($dir) {
|
||||
$runShellCommandArgs{'dir'} = $dir;
|
||||
}
|
||||
|
||||
if ($args{'prependToPath'}) {
|
||||
$runShellCommandArgs{'prependToPath'} = $args{'prependToPath'};
|
||||
}
|
||||
|
||||
if ($args{'appendToPath'}) {
|
||||
$runShellCommandArgs{'appendToPath'} = $args{'appendToPath'};
|
||||
}
|
||||
|
||||
$this->Log(msg => 'Running shell command' .
|
||||
(defined($dir) ? " in $dir" : '') . ':');
|
||||
$this->Log(msg => ' arg0: ' . $cmd);
|
||||
my $argNum = 1;
|
||||
foreach my $arg (@{$cmdArgs}) {
|
||||
$this->Log(msg => ' arg' . $argNum . ': ' . $arg);
|
||||
$argNum += 1;
|
||||
}
|
||||
$this->Log(msg => 'Starting time is ' . $this->CurrentTime());
|
||||
$this->Log(msg => 'Logging output to ' . $logFile);
|
||||
|
||||
$this->Log(msg => 'Timeout: ' . $timeout);
|
||||
|
||||
$rv = RunShellCommand(%runShellCommandArgs);
|
||||
|
||||
my $exitValue = $rv->{'exitValue'};
|
||||
my $timedOut = $rv->{'timedOut'};
|
||||
my $signalNum = $rv->{'signalNum'};
|
||||
my $dumpedCore = $rv->{'dumpedCore'};
|
||||
if ($timedOut) {
|
||||
$this->Log(msg => "output: $rv->{'output'}") if $rv->{'output'};
|
||||
die('FAIL shell call timed out after ' . $timeout . ' seconds');
|
||||
}
|
||||
if ($signalNum) {
|
||||
$this->Log(msg => 'WARNING shell recieved signal ' . $signalNum);
|
||||
}
|
||||
if ($dumpedCore) {
|
||||
$this->Log(msg => "output: $rv->{'output'}") if $rv->{'output'};
|
||||
die("FAIL shell call dumped core");
|
||||
}
|
||||
if ($ignoreExitValue) {
|
||||
$this->Log(msg => "Exit value $rv->{'output'}, but ignoring as told");
|
||||
} elsif ($exitValue) {
|
||||
if ($exitValue != 0) {
|
||||
$this->Log(msg => "output: $rv->{'output'}") if $rv->{'output'};
|
||||
die("shell call returned bad exit code: $exitValue");
|
||||
}
|
||||
}
|
||||
|
||||
if ($rv->{'output'} && not defined($logFile)) {
|
||||
$this->Log(msg => "output: $rv->{'output'}");
|
||||
}
|
||||
|
||||
# current time
|
||||
$this->Log(msg => 'Ending time is ' . $this->CurrentTime());
|
||||
}
|
||||
|
||||
sub Log {
|
||||
my $this = shift;
|
||||
my %args = @_;
|
||||
my $msg = $args{'msg'};
|
||||
print "log: $msg\n";
|
||||
}
|
||||
|
||||
sub CheckLog {
|
||||
my $this = shift;
|
||||
my %args = @_;
|
||||
|
||||
my $log = $args{'log'};
|
||||
my $notAllowed = $args{'notAllowed'};
|
||||
my $checkFor = $args{'checkFor'};
|
||||
my $checkForOnly = $args{'checkForOnly'};
|
||||
|
||||
if (not defined($log)) {
|
||||
die("No log file specified");
|
||||
}
|
||||
|
||||
open (FILE, "< $log") or die("Cannot open file $log: $!");
|
||||
my @contents = <FILE>;
|
||||
close FILE or die("Cannot close file $log: $!");
|
||||
|
||||
if ($notAllowed) {
|
||||
my @errors = grep(/$notAllowed/i, @contents);
|
||||
if (@errors) {
|
||||
die("Errors in log ($log): \n\n @errors");
|
||||
}
|
||||
}
|
||||
if ($checkFor) {
|
||||
if (not grep(/$checkFor/i, @contents)) {
|
||||
die("$checkFor is not present in file $log");
|
||||
}
|
||||
}
|
||||
if ($checkForOnly) {
|
||||
if (not grep(/$checkForOnly/i, @contents)) {
|
||||
die("$checkForOnly is not present in file $log");
|
||||
}
|
||||
my @errors = grep(!/$checkForOnly/i, @contents);
|
||||
if (@errors) {
|
||||
die("Errors in log ($log): \n\n @errors");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
sub CurrentTime {
|
||||
my $this = shift;
|
||||
|
||||
return strftime("%T %D", localtime());
|
||||
}
|
||||
|
||||
# Overridden by child if needed
|
||||
sub Push {
|
||||
my $this = shift;
|
||||
}
|
||||
|
||||
# Overridden by child if needed
|
||||
sub Announce {
|
||||
my $this = shift;
|
||||
}
|
||||
|
||||
sub SendAnnouncement {
|
||||
my $this = shift;
|
||||
my %args = @_;
|
||||
|
||||
my $config = new Bootstrap::Config();
|
||||
|
||||
my $blat = $config->Get(var => 'blat');
|
||||
my $sendmail = $config->Get(var => 'sendmail');
|
||||
my $from = $config->Get(var => 'from');
|
||||
my $to = $config->Get(var => 'to');
|
||||
my @ccList = $config->Exists(var => 'cc') ? split(/[,\s]+/,
|
||||
$config->Get(var => 'cc')) : ();
|
||||
my $hostname = $config->SystemInfo(var => 'hostname');
|
||||
|
||||
# This allows for per-step CC, since some consumers only care about
|
||||
# certain steps, e.g. partner repacks
|
||||
if ($args{'cc'}) {
|
||||
push @ccList, split(/[,\s]+/,$args{'cc'});
|
||||
}
|
||||
|
||||
my $subject = $hostname . ' - ' . $args{'subject'};
|
||||
my $message = $hostname . ' - ' . $args{'message'};
|
||||
|
||||
eval {
|
||||
Email(
|
||||
blat => $blat,
|
||||
sendmail => $sendmail,
|
||||
from => $from,
|
||||
to => $to,
|
||||
cc => \@ccList,
|
||||
subject => $subject,
|
||||
message => $message,
|
||||
);
|
||||
};
|
||||
if ($@) {
|
||||
die("Could not send announcement email: $@");
|
||||
}
|
||||
}
|
||||
|
||||
sub GetBuildIDFromFTP() {
|
||||
my $this = shift;
|
||||
my %args = @_;
|
||||
|
||||
my $os = $args{'os'};
|
||||
if (! defined($os)) {
|
||||
die("ASSERT: Bootstrap::Step::GetBuildID(): os is required argument");
|
||||
}
|
||||
my $releaseDir = $args{'releaseDir'};
|
||||
if (! defined($releaseDir)) {
|
||||
die("ASSERT: Bootstrap::Step::GetBuildID(): releaseDir is required argument");
|
||||
}
|
||||
|
||||
my $config = new Bootstrap::Config();
|
||||
my $stagingServer = $config->Get(var => 'stagingServer');
|
||||
|
||||
return MozBuild::Util::GetBuildIDFromFTP(os => $os,
|
||||
releaseDir => $releaseDir,
|
||||
stagingServer => $stagingServer);
|
||||
}
|
||||
|
||||
sub CvsCo {
|
||||
my $this = shift;
|
||||
my %args = @_;
|
||||
|
||||
# Required arguments
|
||||
die "ASSERT: Bootstrap::Util::CvsCo(): null cvsroot" if
|
||||
(!exists($args{'cvsroot'}));
|
||||
my $cvsroot = $args{'cvsroot'};
|
||||
|
||||
die "ASSERT: Bootstrap::Util::CvsCo(): null modules" if
|
||||
(!exists($args{'modules'}));
|
||||
my $modules = $args{'modules'};
|
||||
|
||||
die "ASSERT: Bootstrap::Util::CvsCo(): bad modules data" if
|
||||
(ref($modules) ne 'ARRAY');
|
||||
|
||||
# Optional arguments
|
||||
my $logFile = $args{'logFile'};
|
||||
my $tag = exists($args{'tag'}) ? $args{'tag'} : 0;
|
||||
my $date = exists($args{'date'}) ? $args{'date'} : 0;
|
||||
my $checkoutDir = exists($args{'checkoutDir'}) ? $args{'checkoutDir'} : 0;
|
||||
my $workDir = exists($args{'workDir'}) ? $args{'workDir'} : 0;
|
||||
my $ignoreExitValue = exists($args{'ignoreExitValue'}) ?
|
||||
$args{'ignoreExitValue'} : 0;
|
||||
my $timeout = exists($args{'timeout'}) ? $args{'timeout'} :
|
||||
$Bootstrap::Util::DEFAULT_SHELL_TIMEOUT;
|
||||
|
||||
my $config = new Bootstrap::Config();
|
||||
|
||||
my $useCvsCompression = 0;
|
||||
if ($config->Exists(var => 'useCvsCompression')) {
|
||||
$useCvsCompression = $config->Get(var => 'useCvsCompression');
|
||||
}
|
||||
|
||||
my @cmdArgs;
|
||||
push(@cmdArgs, '-z3') if ($useCvsCompression);
|
||||
push(@cmdArgs, ('-d', $cvsroot));
|
||||
push(@cmdArgs, 'co');
|
||||
# Don't use a tag/branch if pulling from HEAD
|
||||
push(@cmdArgs, ('-r', $tag)) if ($tag && $tag ne 'HEAD');
|
||||
push(@cmdArgs, ('-D', $date)) if ($date);
|
||||
push(@cmdArgs, ('-d', $checkoutDir)) if ($checkoutDir);
|
||||
push(@cmdArgs, @{$modules});
|
||||
|
||||
my %cvsCoArgs = (cmd => 'cvs',
|
||||
cmdArgs => \@cmdArgs,
|
||||
dir => $workDir,
|
||||
timeout => $timeout,
|
||||
ignoreExitValue => $ignoreExitValue,
|
||||
);
|
||||
if ($logFile) {
|
||||
$cvsCoArgs{'logFile'} = $logFile;
|
||||
}
|
||||
|
||||
$this->Shell(%cvsCoArgs);
|
||||
}
|
||||
|
||||
sub HgClone {
|
||||
my $this = shift;
|
||||
my %args = @_;
|
||||
|
||||
# Required arguments
|
||||
die "ASSERT: Bootstrap::Step::HgClone(): null repo" if
|
||||
(!exists($args{'repo'}));
|
||||
my $repo = $args{'repo'};
|
||||
|
||||
die "ASSERT: Bootstrap::Step::HgClone(): null workDir" if
|
||||
(!exists($args{'workDir'}));
|
||||
my $workDir = $args{'workDir'};
|
||||
|
||||
my $tag;
|
||||
if (exists($args{'tag'})) {
|
||||
$tag = $args{'tag'};
|
||||
}
|
||||
|
||||
my $repoDir = catfile($workDir, basename($repo));
|
||||
if (-e $repoDir) {
|
||||
$this->Log(msg => $repoDir . ' exists, removing it.');
|
||||
rmtree($repoDir);
|
||||
}
|
||||
$this->Shell(
|
||||
cmd => 'hg',
|
||||
cmdArgs => ['clone', $repo],
|
||||
dir => $workDir
|
||||
);
|
||||
|
||||
if ($tag) {
|
||||
$this->HgUpdate(
|
||||
repoDir => $repoDir,
|
||||
tag => $args{'tag'},
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
sub HgUpdate {
|
||||
my $this = shift;
|
||||
my %args = @_;
|
||||
|
||||
# Required arguments
|
||||
die "ASSERT: Bootstrap::Step::HgUpdate(): null repoDir" if
|
||||
(!exists($args{'repoDir'}));
|
||||
my $repoDir = $args{'repoDir'};
|
||||
|
||||
die "ASSERT: Bootstrap::Step::HgUpdate(): repoDir doesn't exist" if
|
||||
(! -e $repoDir);
|
||||
|
||||
if (!exists($args{'tag'}) or
|
||||
$args{'tag'} =~ /^default$/i) {
|
||||
# No need to update if no tag is set or we're using the default
|
||||
return;
|
||||
}
|
||||
my $tag = $args{'tag'};
|
||||
|
||||
$this->Shell(
|
||||
cmd => 'hg',
|
||||
cmdArgs => ['up', '-C', '-r', $tag],
|
||||
dir => $repoDir
|
||||
);
|
||||
}
|
||||
|
||||
sub HgPush {
|
||||
my $this = shift;
|
||||
my %args = @_;
|
||||
my $config = new Bootstrap::Config();
|
||||
|
||||
# Required arguments
|
||||
die "ASSERT: Bootstrap::Step::HgPush(): null repo" if
|
||||
(!exists($args{'repo'}));
|
||||
my $repo = $args{'repo'};
|
||||
|
||||
die "ASSERT: Bootstrap::Step::HgPush(): null dir" if
|
||||
(!exists($args{'workDir'}));
|
||||
my $workDir = $args{'workDir'};
|
||||
|
||||
# Required config file variables
|
||||
die "ASSERT: Bootstrap::Step::HgPush(): null hgSshKey" if
|
||||
(! $config->Exists(sysvar => 'hgSshKey'));
|
||||
my $hgSshKey = $config->Get(sysvar => 'hgSshKey');
|
||||
|
||||
die "ASSERT: Bootstrap::Step::HgPush(): null hgUsername" if
|
||||
(! $config->Exists(var => 'hgUsername'));
|
||||
my $hgUsername = $config->Get(var => 'hgUsername');
|
||||
|
||||
my $pushRepo = GetPushRepo(repo => $repo);
|
||||
|
||||
my @cmdArgs = ['push', '-e',
|
||||
'ssh -l ' . $hgUsername . ' -i "' . $hgSshKey . '"',
|
||||
$pushRepo];
|
||||
|
||||
$this->Shell(
|
||||
cmd => 'hg',
|
||||
cmdArgs => @cmdArgs,
|
||||
dir => $workDir
|
||||
);
|
||||
}
|
||||
|
||||
sub CreateCandidatesDir() {
|
||||
my $this = shift;
|
||||
|
||||
my $config = new Bootstrap::Config();
|
||||
|
||||
my $stagingUser = $config->Get(var => 'stagingUser');
|
||||
my $stagingServer = $config->Get(var => 'stagingServer');
|
||||
my $candidateDir = $config->GetFtpCandidateDir(bitsUnsigned => 1);
|
||||
|
||||
$this->Shell(
|
||||
cmd => 'ssh',
|
||||
cmdArgs => ['-2', '-l', $stagingUser, $stagingServer,
|
||||
'mkdir -p ' . $candidateDir],
|
||||
);
|
||||
|
||||
# Make sure permissions are created on the server correctly;
|
||||
#
|
||||
# Note the '..' at the end of the chmod string; this is because
|
||||
# Config::GetFtpCandidateDir() returns the full path, including the
|
||||
# buildN directories on the end. What we really want to ensure
|
||||
# have the correct permissions (from the mkdir call above) is the
|
||||
# firefox/nightly/$version-candidates/ directory.
|
||||
#
|
||||
# XXX - This is ugly; another solution is to fix the umask on stage, or
|
||||
# change what GetFtpCandidateDir() returns.
|
||||
|
||||
my $chmodArg = CvsCatfile($config->GetFtpCandidateDir(bitsUnsigned => 0),
|
||||
'..');
|
||||
|
||||
$this->Shell(
|
||||
cmd => 'ssh',
|
||||
cmdArgs => ['-2', '-l', $stagingUser, $stagingServer,
|
||||
'chmod 0755 ' . $chmodArg],
|
||||
);
|
||||
}
|
||||
|
||||
1;
|
||||
@@ -1,352 +0,0 @@
|
||||
#
|
||||
# Build step. Calls tinderbox to produce en-US Firefox build.
|
||||
#
|
||||
package Bootstrap::Step::Build;
|
||||
|
||||
use File::Temp qw(tempfile);
|
||||
|
||||
use Bootstrap::Step;
|
||||
use Bootstrap::Util qw(CvsCatfile);
|
||||
|
||||
use MozBuild::Util qw(MkdirWithPath);
|
||||
|
||||
@ISA = ("Bootstrap::Step");
|
||||
|
||||
sub Execute {
|
||||
my $this = shift;
|
||||
|
||||
my $config = new Bootstrap::Config();
|
||||
my $version = $config->GetVersion(longName => 0);
|
||||
my $buildDir = $config->Get(sysvar => 'buildDir');
|
||||
my $productTag = $config->Get(var => 'productTag');
|
||||
my $build = $config->Get(var => 'build');
|
||||
my $buildPlatform = $config->Get(sysvar => 'buildPlatform');
|
||||
my $logDir = $config->Get(sysvar => 'logDir');
|
||||
my $sysname = $config->SystemInfo(var => 'sysname');
|
||||
my $buildTag = $productTag . '_BUILD' . $build;
|
||||
|
||||
if ($version eq 'nightly') {
|
||||
$this->Log(msg => 'Skip force-clobber for nightly mode');
|
||||
} else {
|
||||
my $lastBuilt = catfile($buildDir, $buildPlatform, 'last-built');
|
||||
if (! unlink($lastBuilt)) {
|
||||
$this->Log(msg => "Cannot unlink last-built file $lastBuilt: $!");
|
||||
} else {
|
||||
$this->Log(msg => "Unlinked $lastBuilt");
|
||||
}
|
||||
}
|
||||
|
||||
my $buildLog = catfile($logDir, 'build_' . $buildTag . '-build.log');
|
||||
|
||||
# For Cygwin only, ensure that the system mount point is binmode
|
||||
# This forces CVS to use Unix-style linefeed EOL characters.
|
||||
if ($sysname =~ /cygwin/i) {
|
||||
$this->Shell(
|
||||
cmd => 'mount',
|
||||
cmdArgs => ['-b', '-sc', '/cygdrive'],
|
||||
dir => $buildDir,
|
||||
);
|
||||
}
|
||||
|
||||
$this->Shell(
|
||||
cmd => './build-seamonkey.pl',
|
||||
cmdArgs => ['--once', '--mozconfig', 'mozconfig', '--depend',
|
||||
'--config-cvsup-dir',
|
||||
catfile($buildDir, 'tinderbox-configs')],
|
||||
dir => $buildDir,
|
||||
logFile => $buildLog,
|
||||
timeout => 36000
|
||||
);
|
||||
|
||||
if ($version eq 'nightly') {
|
||||
$this->Log(msg => 'Nightly mode: skipping buildID storage and Talkback' .
|
||||
' symbol push to Breakpad server');
|
||||
} else {
|
||||
$this->StoreBuildID();
|
||||
# proxy for version is 2.0.0.* and osname is win32
|
||||
if ($sysname =~ /cygwin/i) {
|
||||
$this->PublishTalkbackSymbols();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
sub Verify {
|
||||
my $this = shift;
|
||||
|
||||
my $config = new Bootstrap::Config();
|
||||
my $version = $config->GetVersion(longName => 0);
|
||||
my $buildDir = $config->Get(sysvar => 'buildDir');
|
||||
my $productTag = $config->Get(var => 'productTag');
|
||||
my $build = $config->Get(var => 'build');
|
||||
my $buildTag = $productTag.'_BUILD'.$build;
|
||||
my $logDir = $config->Get(sysvar => 'logDir');
|
||||
|
||||
if ($version eq 'nightly') {
|
||||
$this->Log(msg => 'Skip Verify for nightly mode');
|
||||
return;
|
||||
}
|
||||
|
||||
my $buildLog = catfile($logDir, 'build_' . $buildTag . '-build.log');
|
||||
|
||||
$this->CheckLog(
|
||||
log => $buildLog,
|
||||
notAllowed => 'tinderbox: status: failed',
|
||||
);
|
||||
|
||||
my $logParser = new MozBuild::TinderLogParse(
|
||||
logFile => $buildLog,
|
||||
);
|
||||
|
||||
if (! defined($logParser->GetBuildID())) {
|
||||
die("No buildID found in $buildLog");
|
||||
}
|
||||
if (! defined($logParser->GetPushDir())) {
|
||||
die("No pushDir found in $buildLog");
|
||||
}
|
||||
}
|
||||
|
||||
sub Push {
|
||||
my $this = shift;
|
||||
|
||||
my $config = new Bootstrap::Config();
|
||||
my $version = $config->GetVersion(longName => 0);
|
||||
my $productTag = $config->Get(var => 'productTag');
|
||||
my $build = $config->Get(var => 'build');
|
||||
my $logDir = $config->Get(sysvar => 'logDir');
|
||||
my $stagingUser = $config->Get(var => 'stagingUser');
|
||||
my $stagingServer = $config->Get(var => 'stagingServer');
|
||||
|
||||
if ($version eq 'nightly') {
|
||||
$this->Log(msg => 'Skip Push for nightly mode');
|
||||
return;
|
||||
}
|
||||
|
||||
my $buildTag = $productTag . '_BUILD' . $build;
|
||||
my $buildLog = catfile($logDir, 'build_' . $buildTag . '-build.log');
|
||||
my $pushLog = catfile($logDir, 'build_' . $buildTag . '-push.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);
|
||||
$this->CreateCandidatesDir();
|
||||
|
||||
my $osFileMatch = $config->SystemInfo(var => 'osname');
|
||||
# TODO - use a more generic function for this kind of remapping
|
||||
if ($osFileMatch eq 'win32') {
|
||||
$osFileMatch = 'win';
|
||||
} elsif ($osFileMatch eq 'macosx') {
|
||||
$osFileMatch = 'mac';
|
||||
}
|
||||
|
||||
$this->Shell(
|
||||
cmd => 'ssh',
|
||||
cmdArgs => ['-2', '-l', $stagingUser, $stagingServer,
|
||||
'rsync', '-av',
|
||||
'--include=*' . $osFileMatch . '*',
|
||||
'--exclude=*',
|
||||
$pushDir,
|
||||
$candidateDir],
|
||||
logFile => $pushLog,
|
||||
);
|
||||
}
|
||||
|
||||
sub Announce {
|
||||
my $this = shift;
|
||||
|
||||
my $config = new Bootstrap::Config();
|
||||
my $version = $config->GetVersion(longName => 0);
|
||||
my $product = $config->Get(var => 'product');
|
||||
my $productTag = $config->Get(var => 'productTag');
|
||||
my $build = $config->Get(var => 'build');
|
||||
my $logDir = $config->Get(sysvar => 'logDir');
|
||||
|
||||
if ($version eq 'nightly') {
|
||||
$this->Log(msg => 'Skip Announce for nightly mode');
|
||||
return;
|
||||
}
|
||||
|
||||
my $buildTag = $productTag . '_BUILD' . $build;
|
||||
my $buildLog = catfile($logDir, 'build_' . $buildTag . '-build.log');
|
||||
|
||||
my $logParser = new MozBuild::TinderLogParse(
|
||||
logFile => $buildLog,
|
||||
);
|
||||
my $buildID = $logParser->GetBuildID();
|
||||
my $pushDir = $logParser->GetPushDir();
|
||||
|
||||
if (! defined($buildID)) {
|
||||
die("No buildID found in $buildLog");
|
||||
}
|
||||
if (! defined($pushDir)) {
|
||||
die("No pushDir found in $buildLog");
|
||||
}
|
||||
|
||||
$this->SendAnnouncement(
|
||||
subject => "$product $version build step finished",
|
||||
message => "$product $version en-US build was copied to the candidates dir.\nBuild ID is $buildID\nPush Dir was $pushDir",
|
||||
);
|
||||
}
|
||||
|
||||
sub StoreBuildID() {
|
||||
my $this = shift;
|
||||
|
||||
my $config = new Bootstrap::Config();
|
||||
my $productTag = $config->Get(var => 'productTag');
|
||||
my $build = $config->Get(var => 'build');
|
||||
my $logDir = $config->Get(sysvar => 'logDir');
|
||||
my $stagingUser = $config->Get(var => 'stagingUser');
|
||||
my $stagingServer = $config->Get(var => 'stagingServer');
|
||||
|
||||
my $buildTag = $productTag . '_BUILD' . $build;
|
||||
my $buildLog = catfile($logDir, 'build_' . $buildTag . '-build.log');
|
||||
my $pushLog = catfile($logDir, 'build_' . $buildTag . '-push.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!;
|
||||
|
||||
# drop os-specific buildID file on FTP
|
||||
my $buildID = $logParser->GetBuildID();
|
||||
if (! defined($buildID)) {
|
||||
die("No buildID found in $buildLog");
|
||||
}
|
||||
if (! $buildID =~ /^\d+$/) {
|
||||
die("ASSERT: Build: build ID is not numerical: $buildID")
|
||||
}
|
||||
|
||||
|
||||
my $osFileMatch = $config->SystemInfo(var => 'osname');
|
||||
|
||||
my ($bh, $buildIDTempFile) = tempfile(DIR => '.');
|
||||
print $bh 'buildID=' . $buildID;
|
||||
$bh->close() ||
|
||||
die("Could not open buildID temp file $buildIDTempFile: $!");
|
||||
chmod(0644, $buildIDTempFile);
|
||||
|
||||
my $buildIDFile = $osFileMatch . '_info.txt';
|
||||
$this->Shell(
|
||||
cmd => 'scp',
|
||||
cmdArgs => ['-p', $buildIDTempFile,
|
||||
$stagingUser . '@' . $stagingServer . ':' .
|
||||
$pushDir . '/' . $buildIDFile],
|
||||
logFile => $pushLog,
|
||||
);
|
||||
}
|
||||
|
||||
sub PublishTalkbackSymbols() {
|
||||
my $this = shift;
|
||||
|
||||
my $config = new Bootstrap::Config();
|
||||
my $product = $config->Get(var => 'product');
|
||||
my $version = $config->Get(var => 'version');
|
||||
my $build = $config->Get(var => 'build');
|
||||
my $productTag = $config->Get(var => 'productTag');
|
||||
my $logDir = $config->Get(sysvar => 'logDir');
|
||||
my $buildDir = $config->Get(sysvar => 'buildDir');
|
||||
my $buildPlatform = $config->Get(sysvar => 'buildPlatform');
|
||||
my $symbolDir = $config->Get(var => 'symbolDir');
|
||||
my $mozillaCvsroot = $config->Get(var => 'mozillaCvsroot');
|
||||
my $symbolServer = $config->Get(var => 'symbolServer');
|
||||
my $symbolServerUser = $config->Get(var => 'symbolServerUser');
|
||||
my $symbolServerPath = $config->Get(var => 'symbolServerPath');
|
||||
my $symbolServerKey = $config->Get(var => 'symbolServerKey');
|
||||
|
||||
my $buildTag = $productTag . '_BUILD' . $build;
|
||||
my $buildLog = catfile($logDir, 'build_' . $buildTag . '-build.log');
|
||||
my $symbolLog = catfile($logDir, 'build_' . $buildTag . '-symbols.log');
|
||||
my $versionedSymbolDir = catfile($symbolDir, $product . '-' . $version,
|
||||
'build' . $build);
|
||||
|
||||
# Create symbols work area.
|
||||
if (-e $versionedSymbolDir) {
|
||||
die("ASSERT: Build:PublishTalkbackSymbols(): $versionedSymbolDir already exists?");
|
||||
}
|
||||
MkdirWithPath(dir => $versionedSymbolDir)
|
||||
or die("Cannot mkdir $versionedSymbolDir: $!");
|
||||
|
||||
# checkouts
|
||||
$this->CvsCo(cvsroot => $mozillaCvsroot,
|
||||
checkoutDir => 'tools',
|
||||
modules => [CvsCatfile('mozilla', 'toolkit',
|
||||
'crashreporter', 'tools')],
|
||||
logFile => $symbolLog,
|
||||
workDir => $versionedSymbolDir
|
||||
);
|
||||
|
||||
# unpack the symbols tarball from tinderbox
|
||||
my $logParser = new MozBuild::TinderLogParse(
|
||||
logFile => $buildLog,
|
||||
);
|
||||
my $buildID = $logParser->GetBuildID();
|
||||
if (! $buildID =~ /^\d{10}$/) {
|
||||
die("ASSERT: Build:PublishTalkbackSymbols(): No buildID found in $buildLog");
|
||||
}
|
||||
|
||||
# yields dir $versionedSymbolDir/$buildID
|
||||
$this->Shell(
|
||||
cmd => 'tar',
|
||||
cmdArgs => ['xfj',
|
||||
catfile($buildDir, $buildPlatform, $buildID, 'symbols',
|
||||
$buildID.'.tar.bz2')],
|
||||
dir => $versionedSymbolDir,
|
||||
logFile => $symbolLog,
|
||||
);
|
||||
|
||||
# process symbols
|
||||
my $symbolOutputDir = catfile($versionedSymbolDir,'symbol');
|
||||
MkdirWithPath(dir => $symbolOutputDir)
|
||||
or die("Cannot mkdir $symbolOutputDir: $!");
|
||||
|
||||
my @pdbFiles = glob(catfile($versionedSymbolDir, $buildID, '*.pdb'));
|
||||
foreach $pdbFile (@pdbFiles) {
|
||||
$pdbFile =~ s/.*($buildID.*)/$1/;
|
||||
$this->Shell(
|
||||
cmd => 'tools/symbolstore.py',
|
||||
cmdArgs => ['-c', 'tools/win32/dump_syms.exe',
|
||||
'symbol',
|
||||
$pdbFile],
|
||||
logFile => catfile($symbolOutputDir,
|
||||
$product . '-' . $version . 'build' . $build .
|
||||
'-WINNT-' . $buildID . '-symbols.txt'),
|
||||
dir => $versionedSymbolDir,
|
||||
timeout => 600,
|
||||
);
|
||||
}
|
||||
|
||||
# push the symbols to the server
|
||||
$this->Shell(
|
||||
cmd => 'zip',
|
||||
cmdArgs => ['-r', catfile($versionedSymbolDir, 'symbols.zip'), '.'],
|
||||
dir => $symbolOutputDir,
|
||||
logFile => $symbolLog,
|
||||
timeout => 600,
|
||||
);
|
||||
|
||||
$ENV{'SYMBOL_SERVER_HOST'} = $symbolServer;
|
||||
$ENV{'SYMBOL_SERVER_USER'} = $symbolServerUser;
|
||||
$ENV{'SYMBOL_SERVER_SSH_KEY'} = $symbolServerKey;
|
||||
$ENV{'SYMBOL_SERVER_PATH'} = $symbolServerPath;
|
||||
|
||||
$this->Shell(
|
||||
cmd => catfile('tools', 'upload_symbols.sh'),
|
||||
cmdArgs => ['symbols.zip'],
|
||||
dir => $versionedSymbolDir,
|
||||
logFile => $symbolLog,
|
||||
timeout => 600,
|
||||
);
|
||||
}
|
||||
|
||||
1;
|
||||
@@ -1,153 +0,0 @@
|
||||
#
|
||||
# PartnerRepack step. Unpacks, modifies, repacks a Firefox en-US build.
|
||||
#
|
||||
package Bootstrap::Step::PartnerRepack;
|
||||
use Bootstrap::Step;
|
||||
use Bootstrap::Config;
|
||||
use Bootstrap::Util qw(CvsCatfile);
|
||||
use MozBuild::Util qw(MkdirWithPath);
|
||||
@ISA = ("Bootstrap::Step");
|
||||
|
||||
sub Execute {
|
||||
my $this = shift;
|
||||
|
||||
my $config = new Bootstrap::Config();
|
||||
my $product = $config->Get(var => 'product');
|
||||
my $version = $config->GetVersion(longName => 0);
|
||||
my $build = $config->Get(var => 'build');
|
||||
my $logDir = $config->Get(sysvar => 'logDir');
|
||||
my $hgPartnersRepo = $config->Get(var => 'hgPartnersRepo');
|
||||
my $hgPartnersTag = $config->Get(var => 'hgPartnersTag');
|
||||
my $partnerRepackDir = $config->Get(var => 'partnerRepackDir');
|
||||
my $mozillaCvsroot = $config->Get(var => 'mozillaCvsroot');
|
||||
|
||||
my $buildLog = catfile($logDir,
|
||||
'repack_' . $version . '-build-partner-repack.log');
|
||||
|
||||
MkdirWithPath(dir => $partnerRepackDir)
|
||||
or die("Cannot mkdir $partnerRepackDir: $!");
|
||||
|
||||
$this->CvsCo(cvsroot => $mozillaCvsroot,
|
||||
checkoutDir => 'package_tools',
|
||||
modules => [CvsCatfile('mozilla', 'build',
|
||||
'package','mac_osx')],
|
||||
logFile => $buildLog,
|
||||
workDir => $partnerRepackDir
|
||||
);
|
||||
|
||||
$this->HgClone(
|
||||
repo => $hgPartnersRepo,
|
||||
tag => $hgPartnersTag,
|
||||
workDir => $partnerRepackDir
|
||||
);
|
||||
|
||||
$this->Shell(
|
||||
cmd => './partner-repacks.py',
|
||||
cmdArgs => ['--version', $version,
|
||||
'--build-number', $build],
|
||||
dir => catfile($partnerRepackDir, 'partner-repacks', 'scripts'),
|
||||
appendToPath => "${partnerRepackDir}/package_tools",
|
||||
logFile => $buildLog,
|
||||
timeout => 3600
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
# Make sure we have appropriate repacks for every partner in the repo.
|
||||
sub Verify {
|
||||
my $this = shift;
|
||||
|
||||
my $config = new Bootstrap::Config();
|
||||
my $product = $config->Get(var => 'product');
|
||||
my $build = $config->Get(var => 'build');
|
||||
my $version = $config->GetVersion(longName => 0);
|
||||
my $logDir = $config->Get(sysvar => 'logDir');
|
||||
my $hgPartnersRepo = $config->Get(var => 'hgPartnersRepo');
|
||||
my $hgPartnersTag = $config->Get(var => 'hgPartnersTag');
|
||||
my $partnerRepackDir = $config->Get(var => 'partnerRepackDir');
|
||||
|
||||
my $buildLog = catfile($logDir,
|
||||
'repack_' . $version . '-build-partner-repack.log');
|
||||
|
||||
$this->Shell(
|
||||
cmd => './partner-repacks.py',
|
||||
cmdArgs => ['--version', $version,
|
||||
'--build-number', $build,
|
||||
'--verify-only'],
|
||||
dir => catfile($partnerRepackDir, 'partner-repacks', 'scripts'),
|
||||
logFile => $buildLog,
|
||||
timeout => 3600
|
||||
);
|
||||
}
|
||||
|
||||
sub Push {
|
||||
my $this = shift;
|
||||
|
||||
my $config = new Bootstrap::Config();
|
||||
my $product = $config->Get(var => 'product');
|
||||
my $version = $config->GetVersion(longName => 0);
|
||||
my $build = $config->Get(var => 'build');
|
||||
my $logDir = $config->Get(sysvar => 'logDir');
|
||||
my $stagingUser = $config->Get(var => 'stagingUser');
|
||||
my $stagingServer = $config->Get(var => 'stagingServer');
|
||||
my $partnerRepackDir = $config->Get(var => 'partnerRepackDir');
|
||||
my $remoteRepackDir = $config->Get(var => 'remoteRepackDir');
|
||||
my $linuxExtension = $config->GetLinuxExtension();
|
||||
|
||||
my $pushLog = catfile($logDir,
|
||||
'repack_' . $version . '-push-partner-repack.log');
|
||||
|
||||
my $pushDir = catfile($partnerRepackDir, "partner-repacks",
|
||||
"scripts", "repacked_builds");
|
||||
|
||||
$this->Shell(
|
||||
cmd => 'ssh',
|
||||
cmdArgs => ['-2', '-l', $stagingUser, $stagingServer,
|
||||
'mkdir', '-p', $remoteRepackDir
|
||||
],
|
||||
logFile => $pushLog,
|
||||
);
|
||||
|
||||
$this->Shell(
|
||||
cmd => 'rsync',
|
||||
cmdArgs => ['-Lav',
|
||||
'-e', 'ssh',
|
||||
'--include=*.dmg',
|
||||
'--include=*.exe',
|
||||
'--include=*.tar.'.$linuxExtension,
|
||||
'.',
|
||||
$stagingServer . ":" . $remoteRepackDir,
|
||||
],
|
||||
dir => $pushDir,
|
||||
logFile => $pushLog,
|
||||
timeout => 3600
|
||||
);
|
||||
}
|
||||
|
||||
sub Announce {
|
||||
my $this = shift;
|
||||
|
||||
my $config = new Bootstrap::Config();
|
||||
my $product = $config->Get(var => 'product');
|
||||
my $productTag = $config->Get(var => 'productTag');
|
||||
my $version = $config->GetVersion(longName => 0);
|
||||
my $build = $config->Get(var => 'build');
|
||||
my $logDir = $config->Get(sysvar => 'logDir');
|
||||
my $stagingServer = $config->Get(var => 'stagingServer');
|
||||
my $remoteRepackDir = $config->Get(var => 'remoteRepackDir');
|
||||
my $partnerRepackCC = $config->Get(var => 'partnerRepackCC');
|
||||
|
||||
my $buildLog = catfile($logDir,
|
||||
'repack_' . $version . '-build-partner-repack.log');
|
||||
|
||||
$remoteRepackDir =~ s|^/home/ftp||;
|
||||
|
||||
$this->SendAnnouncement(
|
||||
subject => "$product $version partner repack step finished",
|
||||
message => "$product $version partner repacks were copied to the staging directory:\n\n" .
|
||||
"http://${stagingServer}${remoteRepackDir}/${version}/build${build}/",
|
||||
cc => $partnerRepackCC,
|
||||
);
|
||||
}
|
||||
|
||||
1;
|
||||
@@ -1,199 +0,0 @@
|
||||
#
|
||||
# Updates step. Configures patcher files.
|
||||
#
|
||||
#
|
||||
package Bootstrap::Step::PatcherConfig;
|
||||
|
||||
use File::Temp qw(tempfile);
|
||||
|
||||
use MozBuild::Util qw(MkdirWithPath);
|
||||
|
||||
use Bootstrap::Step;
|
||||
use Bootstrap::Config;
|
||||
use Bootstrap::Util qw(CvsCatfile GetBouncerPlatforms
|
||||
GetBouncerToPatcherPlatformMap);
|
||||
|
||||
@ISA = ("Bootstrap::Step");
|
||||
|
||||
use strict;
|
||||
|
||||
# Channels that we want to add an extra annotation to
|
||||
my $RELEASE_CANDIDATE_CHANNELS = ['betatest','DisableCompleteJump'];
|
||||
|
||||
sub Execute {
|
||||
my $this = shift;
|
||||
|
||||
my $config = new Bootstrap::Config();
|
||||
my $logDir = $config->Get(sysvar => 'logDir');
|
||||
my $configBumpDir = $config->Get(var => 'configBumpDir');
|
||||
my $product = $config->Get(var => 'product');
|
||||
my $build = $config->Get(var => 'build');
|
||||
my $version = $config->GetVersion(longName => 0);
|
||||
my $appVersion = $config->GetAppVersion();
|
||||
my $longVersion = $config->GetVersion(longName => 1);
|
||||
my $oldVersion = $config->GetOldVersion(longName => 0);
|
||||
my $oldAppVersion = $config->GetOldAppVersion();
|
||||
my $oldLongVersion = $config->GetOldVersion(longName => 1);
|
||||
my $oldBuild = $config->Get(var => 'oldBuild');
|
||||
my $mozillaCvsroot = $config->Get(var => 'mozillaCvsroot');
|
||||
my $patcherConfig = $config->Get(var => 'patcherConfig');
|
||||
my $ftpServer = $config->Get(var => 'ftpServer');
|
||||
my $bouncerServer = $config->Get(var => 'bouncerServer');
|
||||
my $hgToolsRepo = $config->Get(var => 'hgToolsRepo');
|
||||
my $appName = $config->Get(var => 'appName');
|
||||
my $releaseTag = $config->Get(var => 'productTag') . '_RELEASE';
|
||||
my $stagingServer = $config->Get(var => 'stagingServer');
|
||||
my $ausServerUrl = $config->Get(var => 'ausServerUrl');
|
||||
my $useBetaChannel = $config->Get(var => 'useBetaChannel');
|
||||
my $linuxExtension = $config->GetLinuxExtension();
|
||||
|
||||
my $versionedConfigBumpDir = catfile($configBumpDir,
|
||||
"$product-$version-build$build");
|
||||
|
||||
my $checkedOutPatcherConfig = catfile($versionedConfigBumpDir, 'patcher',
|
||||
$patcherConfig);
|
||||
|
||||
# Create patcher config area in the config bump area.
|
||||
if (not -d $versionedConfigBumpDir) {
|
||||
MkdirWithPath(dir => $versionedConfigBumpDir)
|
||||
or die("Cannot mkdir $versionedConfigBumpDir: $!");
|
||||
}
|
||||
|
||||
# checkout config to bump
|
||||
$this->CvsCo(cvsroot => $mozillaCvsroot,
|
||||
checkoutDir => 'patcher',
|
||||
modules => [CvsCatfile('mozilla', 'tools', 'patcher-configs',
|
||||
$patcherConfig)],
|
||||
logFile => catfile($logDir, 'patcherconfig-checkout.log'),
|
||||
workDir => $versionedConfigBumpDir
|
||||
);
|
||||
|
||||
# Do all the work...
|
||||
# bug 456400 moved the BumpPatcherConfig logic to an external script to
|
||||
# more easily support both CVS and Mercurial based releases
|
||||
|
||||
$this->HgClone(
|
||||
repo => $hgToolsRepo,
|
||||
workDir => catfile($versionedConfigBumpDir)
|
||||
);
|
||||
$this->CvsCo(
|
||||
cvsroot => $mozillaCvsroot,
|
||||
modules => ['mozilla/' . $appName . '/locales/shipped-locales'],
|
||||
tag => $releaseTag,
|
||||
workDir => $versionedConfigBumpDir,
|
||||
checkoutDir => 'locales'
|
||||
);
|
||||
my $shippedLocales = $versionedConfigBumpDir . '/locales/shipped-locales';
|
||||
my @args = (catfile($versionedConfigBumpDir, 'tools', 'release',
|
||||
'patcher-config-bump.pl'),
|
||||
'-p', $product,
|
||||
'-v', $version,
|
||||
'-o', $oldVersion,
|
||||
'-a', $appVersion,
|
||||
'-b', $build,
|
||||
'-c', $checkedOutPatcherConfig,
|
||||
'-t', $stagingServer,
|
||||
'-f', $ftpServer,
|
||||
'-d', $bouncerServer,
|
||||
'-l', $shippedLocales);
|
||||
|
||||
if ($useBetaChannel) {
|
||||
push(@args, '-u');
|
||||
}
|
||||
|
||||
$this->Shell(
|
||||
cmd => 'perl',
|
||||
cmdArgs => \@args
|
||||
);
|
||||
|
||||
# verify that BumpPatcherConfig() actually did something.
|
||||
$this->Log(msg=> 'Ignoring shell value here because cvs diff returns a ' .
|
||||
'non-zero value if a diff exists; this is an assertion that a diff does ' .
|
||||
'exist');
|
||||
|
||||
$this->Shell(
|
||||
cmd => 'cvs',
|
||||
cmdArgs => ['diff', $patcherConfig ],
|
||||
logFile => catfile($logDir, 'patcherconfig-diff.log'),
|
||||
ignoreExitValue => 1,
|
||||
dir => catfile($versionedConfigBumpDir, 'patcher'),
|
||||
);
|
||||
|
||||
$this->Shell(
|
||||
cmd => 'cvs',
|
||||
cmdArgs => ['-d', $mozillaCvsroot,
|
||||
'ci', '-m', "\"Automated configuration bump: $patcherConfig, "
|
||||
. "for $product $version build$build\"", $patcherConfig],
|
||||
logFile => catfile($logDir, 'patcherconfig-checkin.log'),
|
||||
dir => catfile($versionedConfigBumpDir, 'patcher'),
|
||||
);
|
||||
|
||||
# bump the update verify configs too
|
||||
my $oldCandidatesDir = CvsCatfile('pub', 'mozilla.org', $product, 'nightly',
|
||||
$oldVersion . '-candidates',
|
||||
'build' . $oldBuild . '/');
|
||||
|
||||
my $oldTagVersion = $oldVersion;
|
||||
$oldTagVersion =~ s/\./_/g;
|
||||
my $oldReleaseTag = uc($product).'_'.$oldTagVersion.'_RELEASE';
|
||||
|
||||
$this->CvsCo(
|
||||
cvsroot => $mozillaCvsroot,
|
||||
modules => [CvsCatfile('mozilla', $appName, 'locales',
|
||||
'shipped-locales')],
|
||||
tag => $oldReleaseTag,
|
||||
workDir => $versionedConfigBumpDir,
|
||||
checkoutDir => 'old-locales'
|
||||
);
|
||||
my $oldShippedLocales = catfile($versionedConfigBumpDir, 'old-locales',
|
||||
'shipped-locales');
|
||||
|
||||
foreach my $osname (qw/ linux macosx win32/ ) {
|
||||
my $verifyConfig = $config->Get(var => $osname.'_verifyConfig');
|
||||
my @args = (catfile($versionedConfigBumpDir, 'tools', 'release',
|
||||
'update-verify-bump.pl'),
|
||||
'-o', $osname,
|
||||
'-p', $product,
|
||||
'--old-version=' . $oldVersion,
|
||||
'--old-app-version=' . $oldAppVersion,
|
||||
'--old-long-version=' . $oldLongVersion,
|
||||
'-v', $version,
|
||||
'--app-version=' . $appVersion,
|
||||
'--long-version=' . $longVersion,
|
||||
'-n', $build,
|
||||
'-a', $ausServerUrl,
|
||||
'-s', $stagingServer,
|
||||
'-c', catfile($versionedConfigBumpDir, 'tools', 'release', 'updates',
|
||||
$verifyConfig),
|
||||
'-d', $oldCandidatesDir,
|
||||
'-e', $linuxExtension,
|
||||
'-l', $oldShippedLocales
|
||||
);
|
||||
|
||||
$this->Shell(
|
||||
cmd => 'perl',
|
||||
cmdArgs => \@args
|
||||
);
|
||||
}
|
||||
|
||||
$this->Shell(
|
||||
cmd => 'hg',
|
||||
cmdArgs => ['commit', '-m',
|
||||
'"Automated configuration bump: update verify configs for '
|
||||
. $product . ' ' . $version . "build$build" . '"'],
|
||||
logFile => catfile($logDir, 'update_verify-checkin.log'),
|
||||
dir => catfile($versionedConfigBumpDir, 'tools')
|
||||
);
|
||||
$this->HgPush(
|
||||
repo => $hgToolsRepo,
|
||||
workDir => catfile($versionedConfigBumpDir, 'tools')
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
sub Verify {
|
||||
my $this = shift;
|
||||
return;
|
||||
}
|
||||
|
||||
1;
|
||||
@@ -1,257 +0,0 @@
|
||||
#
|
||||
# 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;
|
||||
use Bootstrap::Util qw(CvsCatfile);
|
||||
use MozBuild::Util qw(MkdirWithPath);
|
||||
@ISA = ("Bootstrap::Step");
|
||||
|
||||
sub Execute {
|
||||
my $this = shift;
|
||||
|
||||
my $config = new Bootstrap::Config();
|
||||
my $l10n_buildDir = $config->Get(sysvar => 'l10n_buildDir');
|
||||
my $productTag = $config->Get(var => 'productTag');
|
||||
my $build = $config->Get(var => 'build');
|
||||
my $logDir = $config->Get(sysvar => 'logDir');
|
||||
my $l10n_buildPlatform = $config->Get(sysvar => 'l10n_buildPlatform');
|
||||
my $sysname = $config->SystemInfo(var => 'sysname');
|
||||
my $buildTag = $productTag . '_BUILD' . $build;
|
||||
|
||||
my $buildLog = catfile($logDir, 'repack_' . $buildTag . '-build-l10n.log');
|
||||
my $lastBuilt = catfile($l10n_buildDir, $l10n_buildPlatform, 'last-built');
|
||||
unlink($lastBuilt)
|
||||
or $this->Log(msg => "Cannot unlink last-built file $lastBuilt: $!");
|
||||
$this->Log(msg => "Unlinked $lastBuilt");
|
||||
|
||||
# For Cygwin only, ensure that the system mount point is textmode
|
||||
# This forces CVS to use DOS-style carriage-return EOL characters.
|
||||
if ($sysname =~ /cygwin/i) {
|
||||
$this->Shell(
|
||||
cmd => 'mount',
|
||||
cmdArgs => ['-t', '-sc', '/cygdrive'],
|
||||
dir => $buildDir,
|
||||
);
|
||||
}
|
||||
|
||||
$this->Shell(
|
||||
cmd => './build-seamonkey.pl',
|
||||
cmdArgs => ['--once', '--mozconfig', 'mozconfig', '--depend',
|
||||
'--config-cvsup-dir',
|
||||
catfile($l10n_buildDir, 'tinderbox-configs')],
|
||||
dir => $l10n_buildDir,
|
||||
logFile => $buildLog,
|
||||
timeout => 36000
|
||||
);
|
||||
|
||||
# For Cygwin only, set the system mount point back to binmode
|
||||
# This forces CVS to use Unix-style linefeed EOL characters.
|
||||
if ($sysname =~ /cygwin/i) {
|
||||
$this->Shell(
|
||||
cmd => 'mount',
|
||||
cmdArgs => ['-b', '-sc', '/cygdrive'],
|
||||
dir => $buildDir,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
sub Verify {
|
||||
my $this = shift;
|
||||
|
||||
my $config = new Bootstrap::Config();
|
||||
my $productTag = $config->Get(var => 'productTag');
|
||||
my $product = $config->Get(var => 'product');
|
||||
my $build = $config->Get(var => 'build');
|
||||
my $oldBuild = $config->Get(var => 'oldBuild');
|
||||
my $logDir = $config->Get(sysvar => 'logDir');
|
||||
my $version = $config->GetVersion(longName => 0);
|
||||
my $oldVersion = $config->GetOldVersion(longName => 0);
|
||||
my $mozillaCvsroot = $config->Get(var => 'mozillaCvsroot');
|
||||
my $verifyDir = $config->Get(var => 'verifyDir');
|
||||
my $hgToolsRepo = $config->Get(var => 'hgToolsRepo');
|
||||
my $hgToolsTag = $config->Get(var => 'hgToolsTag');
|
||||
my $stagingServer = $config->Get(var => 'stagingServer');
|
||||
my $linuxExtension = $config->GetLinuxExtension();
|
||||
my $buildTag = $productTag.'_BUILD'.$build;
|
||||
|
||||
# l10n metadiff test
|
||||
|
||||
my $verifyDirVersion = catfile($verifyDir, $product . '-' . $version);
|
||||
|
||||
MkdirWithPath(dir => $verifyDirVersion)
|
||||
or die("Cannot mkdir $verifyDirVersion: $!");
|
||||
|
||||
|
||||
$this->HgClone(
|
||||
repo => $hgToolsRepo,
|
||||
tag => $hgToolsTag,
|
||||
workDir => $verifyDirVersion
|
||||
);
|
||||
|
||||
# Download current release
|
||||
$this->Shell(
|
||||
cmd => 'rsync',
|
||||
cmdArgs => ['-Lav',
|
||||
'-e', 'ssh',
|
||||
'--include=*.dmg',
|
||||
'--include=*.exe',
|
||||
'--include=*.tar.'.$linuxExtension,
|
||||
'--exclude=*',
|
||||
$stagingServer . ':/home/ftp/pub/' . $product
|
||||
. '/nightly/' . $version . '-candidates/build' . $build . '/*',
|
||||
$product . '-' . $version . '-build' . $build . '/',
|
||||
],
|
||||
dir => catfile($verifyDirVersion, 'tools', 'release', 'l10n'),
|
||||
logFile =>
|
||||
catfile($logDir, 'repack_verify-download_' . $version . '.log'),
|
||||
timeout => 3600
|
||||
);
|
||||
|
||||
# Download previous release
|
||||
$this->Shell(
|
||||
cmd => 'rsync',
|
||||
cmdArgs => ['-Lav',
|
||||
'-e', 'ssh',
|
||||
'--include=*.dmg',
|
||||
'--include=*.exe',
|
||||
'--include=*.tar.'.$linuxExtension,
|
||||
'--exclude=*',
|
||||
$stagingServer . ':/home/ftp/pub/' . $product
|
||||
. '/nightly/' . $oldVersion . '-candidates/build'
|
||||
. $oldBuild . '/*',
|
||||
$product . '-' . $oldVersion . '-build' . $oldBuild . '/',
|
||||
],
|
||||
dir => catfile($verifyDirVersion, 'tools', 'release', 'l10n'),
|
||||
logFile =>
|
||||
catfile($logDir, 'repack_verify-download_' . $oldVersion . '.log'),
|
||||
timeout => 3600
|
||||
);
|
||||
|
||||
my $newProduct = $product . '-' . $version . '-' . 'build' . $build;
|
||||
my $oldProduct = $product . '-' . $oldVersion . '-' . 'build' . $oldBuild;
|
||||
|
||||
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, 'tools', 'release', '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, 'tools', 'release', 'l10n'),
|
||||
logFile => catfile($logDir, 'repack_metadiff-l10n_verification.log'),
|
||||
);
|
||||
}
|
||||
|
||||
sub Push {
|
||||
my $this = shift;
|
||||
|
||||
my $config = new Bootstrap::Config();
|
||||
my $productTag = $config->Get(var => 'productTag');
|
||||
my $build = $config->Get(var => 'build');
|
||||
my $logDir = $config->Get(sysvar => 'logDir');
|
||||
my $stagingUser = $config->Get(var => 'stagingUser');
|
||||
my $stagingServer = $config->Get(var => 'stagingServer');
|
||||
|
||||
my $buildTag = $productTag . '_BUILD' . $build;
|
||||
my $buildLog = catfile($logDir, 'repack_' . $buildTag . '-build-l10n.log');
|
||||
my $pushLog = catfile($logDir, 'repack_' . $buildTag . '-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);
|
||||
$this->CreateCandidatesDir();
|
||||
|
||||
my $osFileMatch = $config->SystemInfo(var => 'osname');
|
||||
# TODO - use a more generic function for this kind of remapping
|
||||
if ($osFileMatch eq 'win32') {
|
||||
$osFileMatch = 'win';
|
||||
} elsif ($osFileMatch eq 'macosx') {
|
||||
$osFileMatch = 'mac';
|
||||
}
|
||||
|
||||
$this->Shell(
|
||||
cmd => 'ssh',
|
||||
cmdArgs => ['-2', '-l', $stagingUser, $stagingServer,
|
||||
'rsync', '-av',
|
||||
'--include=*' . $osFileMatch . '*',
|
||||
'--include=*.xpi',
|
||||
'--exclude=*',
|
||||
$pushDir, $candidateDir],
|
||||
logFile => $pushLog,
|
||||
);
|
||||
}
|
||||
|
||||
sub Announce {
|
||||
my $this = shift;
|
||||
|
||||
my $config = new Bootstrap::Config();
|
||||
my $product = $config->Get(var => 'product');
|
||||
my $productTag = $config->Get(var => 'productTag');
|
||||
my $version = $config->GetVersion(longName => 0);
|
||||
my $build = $config->Get(var => 'build');
|
||||
my $logDir = $config->Get(sysvar => 'logDir');
|
||||
|
||||
my $buildTag = $productTag . '_BUILD' . $build;
|
||||
my $buildLog = catfile($logDir, 'repack_' . $buildTag . '-build-l10n.log');
|
||||
|
||||
my $logParser = new MozBuild::TinderLogParse(
|
||||
logFile => $buildLog,
|
||||
);
|
||||
my $buildID = $logParser->GetBuildID();
|
||||
my $pushDir = $logParser->GetPushDir();
|
||||
|
||||
if (! defined($pushDir)) {
|
||||
die("No pushDir found in $buildLog");
|
||||
}
|
||||
|
||||
$this->SendAnnouncement(
|
||||
subject => "$product $version l10n repack step finished",
|
||||
message => "$product $version l10n builds were copied to the candidates directory.\nPush Dir was $pushDir",
|
||||
);
|
||||
}
|
||||
|
||||
1;
|
||||
@@ -1,46 +0,0 @@
|
||||
#
|
||||
# Sign step. Wait for signed builds to appear.
|
||||
#
|
||||
package Bootstrap::Step::Sign;
|
||||
use Bootstrap::Step;
|
||||
use Bootstrap::Config;
|
||||
@ISA = ("Bootstrap::Step");
|
||||
|
||||
sub Execute {
|
||||
my $this = shift;
|
||||
|
||||
my $config = new Bootstrap::Config();
|
||||
my $product = $config->Get(var => 'product');
|
||||
my $version = $config->Get(var => 'version');
|
||||
my $build = $config->Get(var => 'build');
|
||||
my $stagingServer = $config->Get(var => 'stagingServer');
|
||||
|
||||
my $logFile = 'win32_signing_build' . $build . '.log';
|
||||
my $url = 'http://' . $stagingServer . '/pub/mozilla.org/' . $product .
|
||||
'/nightly/' . $version . '-candidates/' . 'build' . $build . '/' . $logFile;
|
||||
|
||||
$this->Log(msg => 'Looking for url ' . $url);
|
||||
|
||||
while (system('wget', '-q', '--spider', $url)) {
|
||||
sleep(10);
|
||||
}
|
||||
|
||||
$this->Log(msg => 'Found signing log');
|
||||
}
|
||||
|
||||
sub Verify {}
|
||||
|
||||
sub Announce {
|
||||
my $this = shift;
|
||||
|
||||
my $config = new Bootstrap::Config();
|
||||
my $product = $config->Get(var => 'product');
|
||||
my $version = $config->GetVersion(longName => 0);
|
||||
|
||||
$this->SendAnnouncement(
|
||||
subject => "$product $version sign step finished",
|
||||
message => "$product $version win32 builds have been signed and copied to the candidates dir.",
|
||||
);
|
||||
}
|
||||
|
||||
1;
|
||||
@@ -1,143 +0,0 @@
|
||||
#
|
||||
# Source step. Creates a source tarball equivalent to what was used to
|
||||
# build the binary release, in the Build step.
|
||||
#
|
||||
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);
|
||||
@ISA = ("Bootstrap::Step");
|
||||
|
||||
sub Execute {
|
||||
my $this = shift;
|
||||
|
||||
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->GetVersion(longName => 0);
|
||||
my $build = $config->Get(var => 'build');
|
||||
my $logDir = $config->Get(sysvar => 'logDir');
|
||||
my $sourceDir = $config->Get(var => 'sourceDir');
|
||||
my $mozillaCvsroot = $config->Get(var => 'mozillaCvsroot');
|
||||
|
||||
# create staging area
|
||||
my $versionedSourceDir = catfile($sourceDir, $product . '-' . $version,
|
||||
'batch-source', 'build' . $build);
|
||||
|
||||
if (not -d $versionedSourceDir) {
|
||||
MkdirWithPath(dir => $versionedSourceDir)
|
||||
or die("Cannot create $versionedSourceDir: $!");
|
||||
}
|
||||
|
||||
$this->CvsCo(cvsroot => $mozillaCvsroot,
|
||||
tag => $productTag . '_RELEASE',
|
||||
modules => ['mozilla/client.mk',
|
||||
catfile('mozilla', $appName, 'config')],
|
||||
workDir => $versionedSourceDir,
|
||||
logFile => catfile($logDir, 'source.log')
|
||||
);
|
||||
|
||||
$this->Shell(
|
||||
cmd => 'make',
|
||||
cmdArgs => ['-f', 'client.mk', 'checkout',
|
||||
'MOZ_CO_PROJECT=' . $appName . ',xulrunner'],
|
||||
dir => catfile($versionedSourceDir, 'mozilla'),
|
||||
logFile => catfile($logDir, 'source.log'),
|
||||
);
|
||||
|
||||
# change all CVS/Root files to anonymous CVSROOT
|
||||
File::Find::find(\&CvsChrootCallback, catfile($versionedSourceDir,
|
||||
'mozilla'));
|
||||
|
||||
# remove leftover mozconfig files
|
||||
unlink(glob(catfile($versionedSourceDir, 'mozilla', '.mozconfig*')));
|
||||
|
||||
my $tarFile = $product . '-' . $version . '-' . 'source' . '.tar.bz2';
|
||||
|
||||
$this->Shell(
|
||||
cmd => 'tar',
|
||||
cmdArgs => ['-cjf', $tarFile, 'mozilla'],
|
||||
dir => catfile($versionedSourceDir),
|
||||
logFile => catfile($logDir, 'source.log'),
|
||||
);
|
||||
|
||||
chmod(0644, glob("$versionedSourceDir/$tarFile"));
|
||||
}
|
||||
|
||||
sub Verify {
|
||||
my $this = shift;
|
||||
|
||||
my $config = new Bootstrap::Config();
|
||||
my $logDir = $config->Get(sysvar => '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->GetVersion(longName => 0);
|
||||
my $build = $config->Get(var => 'build');
|
||||
my $logDir = $config->Get(sysvar => 'logDir');
|
||||
my $sourceDir = $config->Get(var => 'sourceDir');
|
||||
my $stagingUser = $config->Get(var => 'stagingUser');
|
||||
my $stagingServer = $config->Get(var => 'stagingServer');
|
||||
|
||||
my $candidateDir = $config->GetFtpCandidateDir(bitsUnsigned => 0);
|
||||
|
||||
my $versionedSourceDir = catfile($sourceDir, $product . '-' . $version);
|
||||
|
||||
$this->CreateCandidatesDir();
|
||||
|
||||
$this->Shell(
|
||||
cmd => 'rsync',
|
||||
cmdArgs => ['-av', '-e', 'ssh', catfile('batch-source', 'build' . $build,
|
||||
$product . '-' . $version . '-source.tar.bz2'),
|
||||
$stagingUser . '@' . $stagingServer . ':' . $candidateDir],
|
||||
logFile => catfile($logDir, 'source.log'),
|
||||
dir => catfile($versionedSourceDir),
|
||||
);
|
||||
}
|
||||
|
||||
sub Announce {
|
||||
my $this = shift;
|
||||
|
||||
my $config = new Bootstrap::Config();
|
||||
my $product = $config->Get(var => 'product');
|
||||
my $version = $config->GetVersion(longName => 0);
|
||||
|
||||
$this->SendAnnouncement(
|
||||
subject => "$product $version source step finished",
|
||||
message => "$product $version source archive was copied to the candidates dir.",
|
||||
);
|
||||
}
|
||||
|
||||
# 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;
|
||||
@@ -1,885 +0,0 @@
|
||||
#
|
||||
# Stage step. Copies nightly build format filenames to release directory
|
||||
# structure.
|
||||
#
|
||||
package Bootstrap::Step::Stage;
|
||||
|
||||
use File::Basename;
|
||||
use File::Copy qw(copy move);
|
||||
use File::Find qw(find);
|
||||
use File::Path qw(rmtree mkpath);
|
||||
|
||||
use Cwd;
|
||||
|
||||
use Bootstrap::Step;
|
||||
use Bootstrap::Config;
|
||||
use Bootstrap::Util qw(CvsCatfile);
|
||||
|
||||
use MozBuild::Util qw(MkdirWithPath);
|
||||
|
||||
@ISA = ("Bootstrap::Step");
|
||||
|
||||
use strict;
|
||||
|
||||
#
|
||||
# List of directories that are allowed to be in the stage-unsigned directory,
|
||||
# theoretically because TrimCallback() will know what to do with them.
|
||||
#
|
||||
my @ALLOWED_DELIVERABLE_DIRECTORIES = qw(windows-xpi mac-xpi linux-xpi);
|
||||
|
||||
# List of bouncer platforms; also used in shipped-locales files...
|
||||
my @ALL_PLATFORMS = qw(win32 linux osx osxppc);
|
||||
|
||||
# Various platform maps that map things to to the platform name used in the
|
||||
# shipped-locale files (which happen to be bouncer OSes, for some reason).
|
||||
my %DELIVERABLE_TO_PLATFORM = ('win32' => 'win32',
|
||||
'mac' => 'osx',
|
||||
'linux-i686' => 'linux');
|
||||
|
||||
my %XPIDIR_TO_PLATFORM = ('windows-xpi' => 'win32',
|
||||
'mac-xpi' => 'osx',
|
||||
'linux-xpi' => 'linux');
|
||||
|
||||
my @NON_LOCALE_XPIS = qw(adt.xpi browser.xpi talkback.xpi xpcom.xpi);
|
||||
|
||||
#########################################################################
|
||||
# Many, many regexps follow
|
||||
#########################################################################
|
||||
my $possible_files_re = # Possible files that we should match on.
|
||||
qr/ (?: #
|
||||
\.gz #
|
||||
| \.bz2 #
|
||||
| \.exe #
|
||||
| \.xpi #
|
||||
| \.dmg #
|
||||
| \.mar #
|
||||
) $ #
|
||||
/x; #
|
||||
|
||||
my $version_re = # Version strings.
|
||||
qr/ \d+ \w* # The first part of the version.
|
||||
(?: \. \d+ \w*)* # Any remainders in the version.
|
||||
/x; #
|
||||
|
||||
my $prefix_re = # Generic filename prefix.
|
||||
qr/ ([a-z]) # First character a-z.
|
||||
([a-z]+) # All following characters a-z.
|
||||
- #
|
||||
( $version_re ) # The version.
|
||||
/x; #
|
||||
|
||||
my $partial_update_prefix_re = # Generic filename prefix.
|
||||
qr/ ([a-z]) # First character a-z.
|
||||
([a-z]+) # All following characters a-z.
|
||||
- #
|
||||
( $version_re # The from version.
|
||||
- #
|
||||
$version_re ) # The to version.
|
||||
/x; #
|
||||
|
||||
my $bin_prefix_re = # Binary file prefix.
|
||||
qr/ $prefix_re # Match on our prefix.
|
||||
\. #
|
||||
([a-z]{2,3}|[a-z]{2,3}-[A-Z]{2,3}|[a-z]{2,3}-[A-Z]{2,3}-[a-zA-Z]*) # The locale. (en-US, ja-JPM, ast-ES)
|
||||
/x; #
|
||||
|
||||
my $bin_partial_prefix_re = # Binary file prefix.
|
||||
qr/ $partial_update_prefix_re # Match on our prefix.
|
||||
\. #
|
||||
([a-z]{2,3}|[a-z]{2,3}-[A-Z]{2,3}|[a-z]{2,3}-[A-Z]{2,3}-[a-zA-Z]*) # The locale. (en-US, ja-JPM, ast-ES)
|
||||
/x; #
|
||||
|
||||
my $win_partial_update_re = # Mac OS X update file.
|
||||
qr/ ^ # From start.
|
||||
$bin_partial_prefix_re # Match on our prefix.
|
||||
\.(win32)\.partial\.mar #
|
||||
$ # To end.
|
||||
/x; #
|
||||
|
||||
my $win_update_re = # Windows update files.
|
||||
qr/ ^ # From start.
|
||||
$bin_prefix_re # Match on our prefix.
|
||||
\.(win32) #
|
||||
(\.complete)? #
|
||||
\.mar #
|
||||
$ # To End.
|
||||
/x; #
|
||||
|
||||
my $win_installer_re = # Windows installer files.
|
||||
qr/ ^ # From start.
|
||||
$bin_prefix_re # Match on our prefix.
|
||||
\.(win32)\.installer\.exe #
|
||||
$ # To End.
|
||||
/x; #
|
||||
|
||||
my $xpi_langpack_re = # Langpack XPI files.
|
||||
qr/ ^ # From start.
|
||||
$bin_prefix_re # Match on our prefix.
|
||||
\.langpack\.xpi #
|
||||
$ # To End.
|
||||
/x; #
|
||||
|
||||
my $mac_partial_update_re = # Mac OS X partial update file.
|
||||
qr/ ^ # From start.
|
||||
$bin_partial_prefix_re # Match on our prefix.
|
||||
\.(mac)\.partial\.mar #
|
||||
$ # To end.
|
||||
/x; #
|
||||
|
||||
my $mac_update_re = # Mac OS X update file.
|
||||
qr/ ^ # From start.
|
||||
$bin_prefix_re # Match on our prefix.
|
||||
\.(mac) #
|
||||
(\.complete)? #
|
||||
\.mar #
|
||||
$ # To end.
|
||||
/x; #
|
||||
|
||||
my $mac_re = # Mac OS X disk images.
|
||||
qr/ ^ # From start.
|
||||
$bin_prefix_re # Match on our prefix.
|
||||
\.(mac)\.dmg #
|
||||
$ # To end.
|
||||
/x; #
|
||||
|
||||
my $linux_partial_update_re = # Mac OS X update file.
|
||||
qr/ ^ # From start.
|
||||
$bin_partial_prefix_re # Match on our prefix.
|
||||
\.(linux-i686)\.partial\.mar #
|
||||
$ # To end.
|
||||
/x; #
|
||||
|
||||
my $linux_update_re = # Linux update file.
|
||||
qr/ ^ # From start.
|
||||
$bin_prefix_re # Match on our prefix.
|
||||
\.(linux-i686) #
|
||||
(\.complete)? #
|
||||
\.mar #
|
||||
$ # To end.
|
||||
/x; #
|
||||
|
||||
my $linux_re = # Linux tarball.
|
||||
qr/ ^ # From start.
|
||||
$bin_prefix_re # Match on our prefix.
|
||||
\.(linux-i686) #
|
||||
\.tar\.(bz2|gz) #
|
||||
$ # To end.
|
||||
/x; #
|
||||
|
||||
my $source_re = # Source tarball.
|
||||
qr/ ^ # From start.
|
||||
$prefix_re # Match on our prefix.
|
||||
-source #
|
||||
\.tar\.bz2 #
|
||||
$ # To end.
|
||||
/x; #
|
||||
|
||||
sub GetStageDir {
|
||||
my $this = shift;
|
||||
|
||||
my $config = new Bootstrap::Config();
|
||||
|
||||
my $stageHome = $config->Get(var => 'stageHome');
|
||||
my $product = $config->Get(var => 'product');
|
||||
my $version = $config->GetVersion(longName => 0);
|
||||
return catfile($stageHome, $product . '-' . $version);
|
||||
}
|
||||
|
||||
sub Execute {
|
||||
my $this = shift;
|
||||
|
||||
my $config = new Bootstrap::Config();
|
||||
my $product = $config->Get(var => 'product');
|
||||
my $productTag = $config->Get(var => 'productTag');
|
||||
my $version = $config->GetVersion(longName => 0);
|
||||
my $build = $config->Get(var => 'build');
|
||||
my $logDir = $config->Get(sysvar => 'logDir');
|
||||
my $stageHome = $config->Get(var => 'stageHome');
|
||||
my $appName = $config->Get(var => 'appName');
|
||||
my $mozillaCvsroot = $config->Get(var => 'mozillaCvsroot');
|
||||
my $mofoCvsroot = $config->Get(var => 'mofoCvsroot');
|
||||
my $releaseTag = $config->Get(var => 'productTag') . '_RELEASE';
|
||||
my $stagingUser = $config->Get(var => 'stagingUser');
|
||||
my $stagingServer = $config->Get(var => 'stagingServer');
|
||||
|
||||
## Prepare the staging directory for the release.
|
||||
# Create the staging directory.
|
||||
|
||||
my $stageDir = $this->GetStageDir();
|
||||
|
||||
if (not -d $stageDir) {
|
||||
MkdirWithPath(dir => $stageDir)
|
||||
or die("Could not mkdir $stageDir: $!");
|
||||
$this->Log(msg => "Created directory $stageDir");
|
||||
}
|
||||
|
||||
# Create skeleton batch directory.
|
||||
my $skelDir = catfile($stageDir, 'batch-skel', 'stage');
|
||||
if (not -d $skelDir) {
|
||||
MkdirWithPath(dir => $skelDir)
|
||||
or die "Cannot create $skelDir: $!";
|
||||
$this->Log(msg => "Created directory $skelDir");
|
||||
chmod(0755, $skelDir)
|
||||
or die("Could not chmod 755 $skelDir: $!");
|
||||
$this->Log(msg => "Changed mode of $skelDir to 0775");
|
||||
}
|
||||
my (undef, undef, $gid) = getgrnam($product)
|
||||
or die "Could not getgrname for $product: $!";
|
||||
|
||||
# Create the contrib and contrib-localized directories with expected
|
||||
# access rights.
|
||||
for my $dir ('contrib', 'contrib-localized') {
|
||||
my $fullDir = catfile($skelDir, $dir);
|
||||
if (not -d $fullDir) {
|
||||
MkdirWithPath(dir => $fullDir)
|
||||
or die "Could not mkdir $fullDir : $!";
|
||||
$this->Log(msg => "Created directory $fullDir");
|
||||
}
|
||||
|
||||
chmod(oct(2775), $fullDir)
|
||||
or die "Cannot change mode on $fullDir to 2775: $!";
|
||||
$this->Log(msg => "Changed mode of $fullDir to 2775");
|
||||
chown(-1, $gid, $fullDir)
|
||||
or die "Cannot chgrp $fullDir to $product: $!";
|
||||
$this->Log(msg => "Changed group of $fullDir to $product");
|
||||
}
|
||||
|
||||
# Copy the PUBLIC KEY file from the cvs repo.
|
||||
my $batch1Dir = catfile($stageDir, 'batch1');
|
||||
if (not -d $batch1Dir) {
|
||||
MkdirWithPath(dir => $batch1Dir)
|
||||
or die "Cannot create $batch1Dir: $!";
|
||||
$this->Log(msg => "Created directory $batch1Dir");
|
||||
}
|
||||
|
||||
$this->Shell(
|
||||
cmd => 'cvs',
|
||||
cmdArgs => [ '-d', $mofoCvsroot,
|
||||
'co', '-d', 'key-checkout',
|
||||
CvsCatfile('release', 'keys', 'pgp',
|
||||
'PUBLIC-KEY')],
|
||||
logFile => catfile($logDir, 'stage_publickey_checkout.log'),
|
||||
dir => $batch1Dir
|
||||
);
|
||||
|
||||
# We do this to get the version of the key we shipped with in the logfile
|
||||
$this->Shell(
|
||||
cmd => 'cvs',
|
||||
cmdArgs => [ 'status' ],
|
||||
logFile => catfile($logDir, 'stage_publickey_checkout.log'),
|
||||
dir => catfile($batch1Dir, 'key-checkout'),
|
||||
);
|
||||
|
||||
my $keyFile = catfile($batch1Dir, 'key-checkout', 'PUBLIC-KEY');
|
||||
my $keyFileDest = catfile($skelDir, 'KEY');
|
||||
copy($keyFile, $keyFileDest) or die("Could not copy $keyFile to $keyFileDest: $!");
|
||||
chmod(0644, $keyFileDest) or
|
||||
die("Could not chmod $keyFileDest to 644");
|
||||
chown(-1, $gid, $keyFileDest) or
|
||||
die("Could not chown $keyFileDest to group $gid");
|
||||
|
||||
## Prepare the merging directory.
|
||||
$this->Shell(
|
||||
cmd => 'rsync',
|
||||
cmdArgs => ['-av', 'batch-skel/stage/', 'stage-merged/'],
|
||||
logFile => catfile($logDir, 'stage_merge_skel.log'),
|
||||
dir => $stageDir,
|
||||
);
|
||||
|
||||
# Collect the release files from the candidates directory into
|
||||
# a pruning/"trimmed" area; this area will be used to remove
|
||||
# locales and deliverables we don't ship.
|
||||
my $ftpNightlyDir = $config->GetFtpCandidateDir(bitsUnsigned => 0);
|
||||
|
||||
$this->Shell(
|
||||
cmd => 'rsync',
|
||||
cmdArgs => ['-Lav', '-e', 'ssh', '--exclude=contrib',
|
||||
$stagingUser . '@' . $stagingServer . ':' . $ftpNightlyDir,
|
||||
'./stage-unsigned'],
|
||||
logFile => catfile($logDir, 'download_stage.log'),
|
||||
dir => $batch1Dir
|
||||
);
|
||||
|
||||
my $prestageTrimmedDir = catfile($batch1Dir, 'stage-unsigned');
|
||||
|
||||
# Remove unknown/unrecognized directories from the -candidates dir; after
|
||||
# this, the only directories that should be in the stage-unsigned
|
||||
# directory are directories that we expliciately handle below, to prep
|
||||
# for groom-files.
|
||||
$this->{'scrubTrimmedDirDeleteList'} = [];
|
||||
|
||||
find(sub { return $this->ScrubTrimmedDirCallback(); }, $prestageTrimmedDir);
|
||||
|
||||
foreach my $delDir (@{$this->{'scrubTrimmedDirDeleteList'}}) {
|
||||
if (-e $delDir && -d $delDir) {
|
||||
$this->Log(msg => "rmtree() ing $delDir");
|
||||
if (rmtree($delDir, 1, 1) <= 0) {
|
||||
die("ASSERT: rmtree() called on $delDir, but nothing deleted.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$this->{'localeManifest'} = $config->GetLocaleInfo();
|
||||
|
||||
# All the magic happens here; we remove unshipped deliverables and cross-
|
||||
# check the locales we do ship in this callback.
|
||||
#
|
||||
# We also set the correct permissions and ownership of the dictories and
|
||||
# files in a mishmash of chmod()/chown() calls in TrimCallback() and later
|
||||
# in GroomFiles(); we should really attempt to consolidate these calls at
|
||||
# some point (says the hacker who wrote most of that ickyness ;-)
|
||||
find(sub { return $this->TrimCallback(); }, $prestageTrimmedDir);
|
||||
|
||||
# Process the update mars; we copy everything from the trimmed directory
|
||||
# that we created above; this will have only the locales/deliverables
|
||||
# we actually ship; then, remove everything but the mars, including
|
||||
# the [empty] directories; then, run groom-files in the directory that
|
||||
# has only updates now.
|
||||
$this->Shell(
|
||||
cmd => 'rsync',
|
||||
cmdArgs => ['-av', 'stage-unsigned/', 'mar/'],
|
||||
logFile => catfile($logDir, 'stage_trimmed_to_mars.log'),
|
||||
dir => $batch1Dir
|
||||
);
|
||||
|
||||
$this->{'leaveOnlyMarsDirDeleteList'} = [];
|
||||
find(sub { return $this->LeaveOnlyUpdateMarsCallback(); },
|
||||
catfile($stageDir, 'batch1', 'mar'));
|
||||
|
||||
foreach my $delDir (@{$this->{'leaveOnlyMarsDirDeleteList'}}) {
|
||||
if (-e $delDir && -d $delDir) {
|
||||
$this->Log(msg => "rmtree() ing $delDir");
|
||||
if (rmtree($delDir, 1, 1) <= 0) {
|
||||
die("ASSERT: rmtree() called on $delDir, but nothing deleted.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$this->GroomFiles(catfile($batch1Dir, 'mar'));
|
||||
|
||||
# Remove MAR files from stage-unsigned now that they have been processed.
|
||||
find(sub { return $this->RemoveMarsCallback(); },
|
||||
catfile($batch1Dir, 'stage-unsigned'));
|
||||
|
||||
# Nightly builds using a different naming scheme than production.
|
||||
# Rename the files.
|
||||
# TODO should support --long filenames, for e.g. Alpha and Beta
|
||||
$this->GroomFiles(catfile($batch1Dir, 'stage-unsigned'));
|
||||
|
||||
# fix xpi dir names - This is a hash of directory names in the pre-stage
|
||||
# dir -> directories under which those directories should be moved to;
|
||||
# the name will be "xpi", so windows-xpi becomes win32/xpi, etc.
|
||||
my %xpiDirs = ('windows-xpi' => 'win32',
|
||||
'linux-xpi' => 'linux-i686',
|
||||
'mac-xpi' => 'mac');
|
||||
|
||||
foreach my $xpiDir (keys(%xpiDirs)) {
|
||||
my $fromDir = catfile($batch1Dir, 'stage-unsigned', $xpiDir);
|
||||
my $parentToDir = catfile($batch1Dir, 'stage-unsigned',
|
||||
$xpiDirs{$xpiDir});
|
||||
my $toDir = catfile($parentToDir, 'xpi');
|
||||
|
||||
if (-e $fromDir) {
|
||||
if (! -e $parentToDir) {
|
||||
MkdirWithPath(dir => $parentToDir) or
|
||||
die("Cannot create $parentToDir");
|
||||
}
|
||||
move($fromDir, $toDir)
|
||||
or die(msg => "Cannot rename $fromDir $toDir: $!");
|
||||
$this->Log(msg => "Moved $fromDir -> $toDir");
|
||||
} else {
|
||||
$this->Log(msg => "Couldn't find $fromDir; not moving to $toDir");
|
||||
}
|
||||
}
|
||||
|
||||
# Create an rsync'ed stage-signed directory to rsync over to the
|
||||
# signing server.
|
||||
$this->Shell(
|
||||
cmd => 'rsync',
|
||||
cmdArgs => ['-av', 'stage-unsigned/', 'stage-signed/'],
|
||||
logFile => catfile($logDir, 'stage_unsigned_to_sign.log'),
|
||||
dir => $batch1Dir
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
sub Verify {
|
||||
my $this = shift;
|
||||
|
||||
my $config = new Bootstrap::Config();
|
||||
my $product = $config->Get(var => 'product');
|
||||
my $appName = $config->Get(var => 'appName');
|
||||
my $logDir = $config->Get(sysvar => 'logDir');
|
||||
my $build = $config->Get(var => 'build');
|
||||
my $stageHome = $config->Get(var => 'stageHome');
|
||||
my $productTag = $config->Get(var => 'productTag');
|
||||
my $mozillaCvsroot = $config->Get(var => 'mozillaCvsroot');
|
||||
my $linuxExtension = $config->GetLinuxExtension();
|
||||
|
||||
my $stageDir = $this->GetStageDir();
|
||||
|
||||
# check out locales manifest (shipped-locales)
|
||||
$this->Shell(
|
||||
cmd => 'cvs',
|
||||
cmdArgs => [ '-d', $mozillaCvsroot,
|
||||
'co', '-d', 'config',
|
||||
'-r', $productTag . '_RELEASE',
|
||||
CvsCatfile('mozilla', $appName, 'locales',
|
||||
'shipped-locales')],
|
||||
logFile => catfile($logDir, 'stage_shipped-locales_checkout.log'),
|
||||
dir => catfile($stageDir, 'batch1'),
|
||||
);
|
||||
|
||||
# Verify locales
|
||||
my $verifyLocalesLogFile = catfile($logDir, 'stage_verify_l10n.log');
|
||||
$this->Shell(
|
||||
cmd => catfile($stageHome, 'bin', 'verify-locales.pl'),
|
||||
cmdArgs => ['-m', catfile($stageDir, 'batch1', 'config',
|
||||
'shipped-locales'), '-l', $linuxExtension,
|
||||
'-p', $product],
|
||||
logFile => $verifyLocalesLogFile,
|
||||
dir => catfile($stageDir, 'batch1', 'stage-signed'),
|
||||
);
|
||||
|
||||
$this->CheckLog(
|
||||
log => $verifyLocalesLogFile,
|
||||
notAllowed => '^FAIL: '
|
||||
);
|
||||
$this->CheckLog(
|
||||
log => $verifyLocalesLogFile,
|
||||
notAllowed => '^ASSERT: '
|
||||
);
|
||||
}
|
||||
|
||||
sub Push {
|
||||
my $this = shift;
|
||||
|
||||
my $config = new Bootstrap::Config();
|
||||
my $logDir = $config->Get(sysvar => 'logDir');
|
||||
my $stageHome = $config->Get(var => 'stageHome');
|
||||
my $stagingUser = $config->Get(var => 'stagingUser');
|
||||
my $stagingServer = $config->Get(var => 'stagingServer');
|
||||
|
||||
# upload private staging area
|
||||
my $stageDir = $this->GetStageDir();
|
||||
|
||||
$this->Shell(
|
||||
cmd => 'rsync',
|
||||
cmdArgs => ['-av', '-e', 'ssh', $stageDir . '/',
|
||||
$stagingUser . '@' . $stagingServer . ':' .
|
||||
$stageDir],
|
||||
logFile => catfile($logDir, 'upload_stage_private.log'),
|
||||
);
|
||||
}
|
||||
|
||||
sub LeaveOnlyUpdateMarsCallback {
|
||||
my $this = shift;
|
||||
my $dirent = $File::Find::name;
|
||||
|
||||
my $marsDir = catfile($this->GetStageDir(), 'batch1', 'mar');
|
||||
|
||||
if (-f $dirent) {
|
||||
if ($dirent !~ /\.mar$/) {
|
||||
$this->Log(msg => "Unlinking non-mar deliverable: $dirent");
|
||||
unlink($dirent) or die("Couldn't unlink $dirent");
|
||||
}
|
||||
} elsif (-d $dirent) {
|
||||
if ($dirent ne $marsDir) {
|
||||
push(@{$this->{'leaveOnlyMarsDirDeleteList'}}, $dirent);
|
||||
}
|
||||
} else {
|
||||
$this->Log(msg => 'WARNING: LeaveOnlyUpdateMarsCallback(): '.
|
||||
"Unknown dirent type: $dirent");
|
||||
}
|
||||
}
|
||||
|
||||
sub RemoveMarsCallback {
|
||||
my $this = shift;
|
||||
my $dirent = $File::Find::name;
|
||||
|
||||
if (-f $dirent) {
|
||||
if ($dirent =~ /\.mar$/) {
|
||||
$this->Log(msg => "Unlinking mar: $dirent");
|
||||
unlink($dirent) or die("Couldn't unlink $dirent");
|
||||
}
|
||||
} elsif (-d $dirent) {
|
||||
# do nothing
|
||||
} else {
|
||||
$this->Log(msg => 'WARNING: RemoveMarsCallback(): '.
|
||||
"Unknown dirent type: $dirent");
|
||||
}
|
||||
}
|
||||
|
||||
#########################################################################
|
||||
# This is a bit of an odd callback; the idea is to emulate find's -maxdepth
|
||||
# option with an argument of 1; unfortunately, find2perl barfs on this option.
|
||||
# Also, File::Find::find() is an annoying combination of depth and breadth-first
|
||||
# search, depending on which version is installed (find() used to be different
|
||||
# than finddepth(), but now they're the same?).
|
||||
#
|
||||
# Anyway, what this does is add an entry in the object to add the list of
|
||||
# directories that should be deleted; if we rmtree() those directories here,
|
||||
# find() will go bonkers, because we removed things out from under it. So,
|
||||
# the next step after find() is called with this callback is to rmtree()
|
||||
# all the directories on the list that is populated in this callback.
|
||||
#########################################################################
|
||||
sub ScrubTrimmedDirCallback {
|
||||
my $this = shift;
|
||||
|
||||
my $config = new Bootstrap::Config();
|
||||
my $dirent = $File::Find::name;
|
||||
|
||||
my $trimmedDir = catfile($this->GetStageDir(), 'batch1',
|
||||
'stage-unsigned');
|
||||
|
||||
# if $dirent is a directory and is a direct child of the stage-unsigned
|
||||
# directory (a hacky attempt at the equivalent of find's maxdepth 1 option);
|
||||
if (-d $dirent && dirname($dirent) eq $trimmedDir) {
|
||||
foreach my $allowedDir (@ALLOWED_DELIVERABLE_DIRECTORIES) {
|
||||
return if (basename($dirent) eq $allowedDir);
|
||||
}
|
||||
|
||||
$this->Log(msg => "WILL DELETE: $dirent");
|
||||
push(@{$this->{'scrubTrimmedDirDeleteList'}}, $dirent);
|
||||
}
|
||||
}
|
||||
|
||||
sub TrimCallback {
|
||||
my $this = shift;
|
||||
|
||||
my $config = new Bootstrap::Config();
|
||||
my $dirent = $File::Find::name;
|
||||
|
||||
if (-f $dirent) {
|
||||
# Don't ship xforms in the release area
|
||||
if (($dirent =~ /xforms\.xpi/) ||
|
||||
# ZIP files are not shipped; neither are en-US lang packs
|
||||
($dirent =~ /\.zip$/) || ($dirent =~ /en-US\.xpi$/) ||
|
||||
# nor the BuildID files, nor the 2.0.0.x signing log
|
||||
($dirent =~ /_info.txt$/) || ($dirent =~ /win32_signing_build\d+\.log/) ) {
|
||||
unlink($dirent) || die "Could not unlink $dirent: $!";
|
||||
$this->Log(msg => "Unlinked $dirent");
|
||||
return;
|
||||
}
|
||||
|
||||
# source tarballs don't have a locale, so don't check them for one;
|
||||
# all other deliverables need to be checked to make sure they should
|
||||
# be in stage-unsigned, i.e. if their locale shipped.
|
||||
if ($dirent !~ /\-source\.tar\.bz2$/) {
|
||||
my $validDeliverable = 0;
|
||||
|
||||
# This logic is kinda weird, and I'd do it differently if I had
|
||||
# more time; basically, for 1.5.0.x branch, there are a set of
|
||||
# non-locale xpis that get shipped in the windows-xpi dir; so,
|
||||
# if the entry is an xpi, check it against the list of non-locale
|
||||
# xpis that we should ship. If it's one of those, let it through.
|
||||
# If not, it could still be a (shipable) locale-xpi, so give
|
||||
# IsValidLocaleDeliverable() a crack at it.
|
||||
#
|
||||
# If it's neither of those, then delete it.
|
||||
if ($dirent =~ /\.xpi$/) {
|
||||
my $xpiBasename = basename($dirent);
|
||||
$validDeliverable = grep(/^$xpiBasename$/, @NON_LOCALE_XPIS);
|
||||
}
|
||||
|
||||
if (!$validDeliverable) {
|
||||
$validDeliverable = $this->IsValidLocaleDeliverable();
|
||||
}
|
||||
|
||||
if (not $validDeliverable) {
|
||||
$this->Log(msg => "Deleting unwanted locale deliverable: " .
|
||||
$dirent);
|
||||
unlink($dirent) or die("Couldn't unlink() $dirent\n");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
chmod(0644, $dirent)
|
||||
|| die "Could not chmod $dirent to 0644: $!";
|
||||
$this->Log(msg => "Changed mode of $dirent to 0644");
|
||||
} elsif (-d $dirent) {
|
||||
chmod(0755, $dirent)
|
||||
or die "Could not chmod $dirent to 0755: $!";
|
||||
$this->Log(msg => "Changed mode of $dirent to 0755");
|
||||
} else {
|
||||
die("Bootstrap::Step::Stage::TrimCallback(): Unexpected " .
|
||||
"non-file/non-dir directory entry: $dirent");
|
||||
}
|
||||
|
||||
my $product = $config->Get(var => 'product');
|
||||
my (undef, undef, $gid) = getgrnam($product)
|
||||
or die "Could not getgrname for $product: $!";
|
||||
chown(-1, $gid, $dirent)
|
||||
or die "Cannot chgrp $dirent to $product: $!";
|
||||
$this->Log(msg => "Changed group of $dirent to $product");
|
||||
}
|
||||
|
||||
sub IsValidLocaleDeliverable {
|
||||
my $this = shift;
|
||||
my %args = @_;
|
||||
|
||||
my $config = new Bootstrap::Config();
|
||||
|
||||
my $linuxExtension = $config->GetLinuxExtension();
|
||||
|
||||
my $dirent = $File::Find::name;
|
||||
|
||||
my ($locale, $platform);
|
||||
my @parts = split(/\./, basename($dirent));
|
||||
my $partsCount = scalar(@parts);
|
||||
|
||||
if ($dirent =~ /\.tar\.$linuxExtension/) {
|
||||
# e.g. firefox-2.0.0.2.sk.linux-i686.tar.gz
|
||||
$locale = $parts[$partsCount - 4];
|
||||
$platform = 'linux';
|
||||
} elsif ($dirent =~ /\.exe/) {
|
||||
# e.g. firefox-2.0.0.2.zh-TW.win32.installer.exe
|
||||
$locale = $parts[$partsCount - 4];
|
||||
$platform = 'win32';
|
||||
} elsif ($dirent =~ /\.dmg/) {
|
||||
# e.g. firefox-2.0.0.2.tr.mac.dmg
|
||||
$locale = $parts[$partsCount - 3];
|
||||
$platform = 'osx';
|
||||
} elsif ($dirent =~ /\.xpi/) {
|
||||
# e.g. en-GB.xpi
|
||||
$locale = basename($File::Find::name);
|
||||
$locale =~ s/\.xpi$//;
|
||||
my $parentDir = basename($File::Find::dir);
|
||||
|
||||
if (exists($XPIDIR_TO_PLATFORM{$parentDir})) {
|
||||
$platform = $XPIDIR_TO_PLATFORM{$parentDir};
|
||||
} else {
|
||||
die 'ASSERT: IsValidLocaleDeliverable(): xpis found in an ' .
|
||||
'unexpected directory';
|
||||
}
|
||||
} elsif ($dirent =~ /\.mar/) {
|
||||
# e.g. firefox-2.0.0.2.tr.win32.[partial,complete].mar
|
||||
$locale = $parts[$partsCount - 4];
|
||||
$platform = $DELIVERABLE_TO_PLATFORM{$parts[$partsCount - 3]};
|
||||
} else {
|
||||
die('ASSERT: IsValidLocaleDeliverable(): Unknown file type in tree: ' .
|
||||
$dirent);
|
||||
}
|
||||
|
||||
foreach my $allowedPlatform (@{$this->{'localeManifest'}->{$locale}}) {
|
||||
return 1 if ($allowedPlatform eq $platform);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
sub Announce {
|
||||
my $this = shift;
|
||||
|
||||
my $config = new Bootstrap::Config();
|
||||
my $product = $config->Get(var => 'product');
|
||||
my $version = $config->GetVersion(longName => 0);
|
||||
|
||||
$this->SendAnnouncement(
|
||||
subject => "$product $version stage step finished",
|
||||
message => "$product $version staging area has been created.",
|
||||
);
|
||||
}
|
||||
|
||||
sub GroomFiles {
|
||||
my $this = shift;
|
||||
my $dir = shift;
|
||||
|
||||
if (not -d $dir) {
|
||||
$this->Log(msg => "Can't find dir: $dir");
|
||||
return 0;
|
||||
}
|
||||
|
||||
my $config = new Bootstrap::Config();
|
||||
my (undef, undef, $gid) = getgrnam($config->Get(var => 'product')) or
|
||||
die "Could not getgrname for " . $config->Get(var => 'product') .": $!";
|
||||
|
||||
my $start_dir = getcwd();
|
||||
chdir($dir) or
|
||||
die("Failed to chdir() to $dir\n");
|
||||
|
||||
if (! $this->GatherFiles()) {
|
||||
$this->Log(msg => "Failed to find files in $dir");
|
||||
return 0;
|
||||
}
|
||||
|
||||
for my $original_name (@{$this->{'files'}}) {
|
||||
my $new_name = $original_name;
|
||||
|
||||
my $original_dir = dirname($original_name);
|
||||
my $long_name = basename($original_name);
|
||||
|
||||
my @pretty_names = $this->GeneratePrettyName(
|
||||
name => $long_name
|
||||
);
|
||||
|
||||
my $once = 0;
|
||||
for my $pretty_name (@pretty_names) {
|
||||
|
||||
my $pretty_dirname = dirname($pretty_name);
|
||||
my $pretty_basename = basename($pretty_name);
|
||||
|
||||
if ( ! -e $pretty_name ) {
|
||||
if (! -d $pretty_dirname) {
|
||||
my @dirsCreated = ();
|
||||
|
||||
eval { @dirsCreated = mkpath($pretty_dirname, 1) };
|
||||
|
||||
if ($@ ne '') {
|
||||
die("Cannot create $pretty_dirname: $@");
|
||||
}
|
||||
|
||||
foreach my $dir (@dirsCreated) {
|
||||
chmod(0755, $dir) or die("Could not chmod $dir to 755");
|
||||
chown(-1, $gid, $dir) or die("Could not chown $dir " .
|
||||
"to group $gid");
|
||||
}
|
||||
|
||||
$this->Log(msg => "Created directory $pretty_dirname");
|
||||
}
|
||||
copy($original_name, $pretty_name) or
|
||||
die("Could not copy $original_name to $pretty_name: $!");
|
||||
chmod(0644, $pretty_name) or
|
||||
die("Could not chmod $pretty_name to 644");
|
||||
chown(-1, $gid, $pretty_name) or
|
||||
die("Could not chown $pretty_name to group $gid");
|
||||
$once = 1;
|
||||
}
|
||||
}
|
||||
|
||||
if ($once) {
|
||||
$this->Log(msg => "Deleting original file: " .
|
||||
$original_name);
|
||||
unlink($original_name) or
|
||||
die("Couldn't unlink() $original_name $!");
|
||||
}
|
||||
}
|
||||
|
||||
chdir($start_dir) or
|
||||
die("Failed to chdir() to starting directory: " .
|
||||
$start_dir . "\n");
|
||||
}
|
||||
|
||||
sub GatherFiles {
|
||||
my $this = shift;
|
||||
|
||||
@{$this->{'files'}} = ();
|
||||
File::Find::find(sub { return $this->GatherFilesCallback(); }, '.');
|
||||
|
||||
if (scalar(@{$this->{'files'}}) == 0) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@{$this->{'files'}} = sort(grep { /$possible_files_re/x } @{$this->{'files'}});
|
||||
}
|
||||
|
||||
#########################################################################
|
||||
# Callback, with internals generated by find2perl
|
||||
# Original find call was:
|
||||
# find . -type f -o -name "contrib*" -prune
|
||||
#########################################################################
|
||||
sub GatherFilesCallback {
|
||||
my $this = shift;
|
||||
my $dirent = $File::Find::name;
|
||||
|
||||
my ($dev,$ino,$mode,$nlink,$uid,$gid);
|
||||
|
||||
((($dev,$ino,$mode,$nlink,$uid,$gid) = lstat($dirent)) &&
|
||||
-f _
|
||||
||
|
||||
/^contrib.*\z/s &&
|
||||
($File::Find::prune = 1))
|
||||
&& push @{$this->{'files'}}, $dirent;
|
||||
}
|
||||
|
||||
sub GeneratePrettyName {
|
||||
my $this = shift;
|
||||
my %args = @_;
|
||||
|
||||
my $name = $args{'name'};
|
||||
print "name: $name\n";
|
||||
my $config = new Bootstrap::Config();
|
||||
my $currentVersion = $config->GetVersion(longName => 1);
|
||||
my $currentVersionShort = $config->GetVersion(longName => 0);
|
||||
my $oldVersionShort = $config->GetOldVersion(longName => 0);
|
||||
|
||||
my @result;
|
||||
|
||||
# $1 = first character of name
|
||||
# $2 = rest of name
|
||||
# $3 = old version
|
||||
# $4 = locale
|
||||
# $5 = platform
|
||||
# $6 = file extension (linux only)
|
||||
|
||||
# Windows update files.
|
||||
if ( $name =~ m/ $win_update_re /x ) {
|
||||
# Windows update files.
|
||||
push @result, "update/$5/$4/$1$2-" . $currentVersionShort .
|
||||
".complete.mar";
|
||||
|
||||
} elsif ( $name =~ m/ $win_partial_update_re /x ) {
|
||||
# Windows partial update files.
|
||||
push @result, "update/$5/$4/$1$2-" . $oldVersionShort . '-' .
|
||||
$currentVersionShort . ".partial.mar";
|
||||
|
||||
# Windows installer files.
|
||||
} elsif ( $name =~ m/ $win_installer_re /x ) {
|
||||
# Windows installer files.
|
||||
push @result, "$5/$4/" . uc($1) . "$2 Setup " . $currentVersion . ".exe";
|
||||
|
||||
# Mac OS X disk image files.
|
||||
} elsif ( $name =~ m/ $mac_re /x ) {
|
||||
# Mac OS X disk image files.
|
||||
push @result, "$5/$4/" . uc($1) . "$2 ". $currentVersion . ".dmg";
|
||||
|
||||
# Mac OS X update files.
|
||||
} elsif ( $name =~ m/ $mac_update_re /x ) {
|
||||
# Mac OS X update files.
|
||||
push @result, "update/$5/$4/$1$2-" . $currentVersionShort .
|
||||
".complete.mar";
|
||||
|
||||
} elsif ( $name =~ m/ $mac_partial_update_re /x ) {
|
||||
# Mac partial update files.
|
||||
push @result, "update/$5/$4/$1$2-" . $oldVersionShort . '-' .
|
||||
$currentVersionShort . ".partial.mar";
|
||||
|
||||
# Linux tarballs.
|
||||
} elsif ( $name =~ m/ $linux_re /x ) {
|
||||
# Linux tarballs.
|
||||
push @result, "$5/$4/$1$2-" . $currentVersionShort . ".tar.$6";
|
||||
|
||||
# Linux update files.
|
||||
} elsif ( $name =~ m/ $linux_update_re /x ) {
|
||||
# Linux update files.
|
||||
push @result, "update/$5/$4/$1$2-" . $currentVersionShort .
|
||||
".complete.mar";
|
||||
|
||||
} elsif ( $name =~ m/ $linux_partial_update_re /x ) {
|
||||
# Linux partial update files.
|
||||
push @result, "update/$5/$4/$1$2-" . $oldVersionShort . '-' .
|
||||
$currentVersionShort . ".partial.mar";
|
||||
|
||||
# Source tarballs.
|
||||
} elsif ( $name =~ m/ $source_re /x ) {
|
||||
# Source tarballs.
|
||||
push @result, "source/$1$2-" . $currentVersionShort . "-source.tar.bz2";
|
||||
|
||||
# XPI langpack files.
|
||||
} elsif ( $name =~ m/ $xpi_langpack_re /x ) {
|
||||
# XPI langpack files.
|
||||
my $locale = "$4";
|
||||
for my $platform ( "win32", "linux-i686" ) {
|
||||
push @result, "$platform/xpi/$locale.xpi";
|
||||
}
|
||||
}
|
||||
|
||||
if (scalar(@result) == 0) {
|
||||
$this->Log(msg => "No matches found for: $name");
|
||||
return 0;
|
||||
}
|
||||
|
||||
return @result;
|
||||
}
|
||||
|
||||
1;
|
||||
@@ -1,348 +0,0 @@
|
||||
#
|
||||
# Tag step. Sets up the tagging directory, and checks out the mozilla source.
|
||||
#
|
||||
package Bootstrap::Step::Tag;
|
||||
|
||||
use Cwd;
|
||||
use File::Copy qw(move);
|
||||
use File::Path qw(rmtree);
|
||||
use POSIX qw(strftime);
|
||||
|
||||
use MozBuild::Util qw(MkdirWithPath RunShellCommand);
|
||||
use Bootstrap::Util qw(CvsCatfile);
|
||||
|
||||
use Bootstrap::Step;
|
||||
use Bootstrap::Step::Tag::Bump;
|
||||
use Bootstrap::Step::Tag::Mozilla;
|
||||
use Bootstrap::Step::Tag::l10n;
|
||||
use Bootstrap::Step::Tag::Talkback;
|
||||
use Bootstrap::Config;
|
||||
|
||||
use strict;
|
||||
|
||||
our @ISA = qw(Bootstrap::Step);
|
||||
|
||||
# Talkback will be appended in Execute() if it is to be used
|
||||
my @TAG_SUB_STEPS = qw( Bump
|
||||
Mozilla
|
||||
l10n
|
||||
);
|
||||
|
||||
sub Execute {
|
||||
my $this = shift;
|
||||
|
||||
my $config = new Bootstrap::Config();
|
||||
my $productTag = $config->Get(var => 'productTag');
|
||||
my $build = $config->Get(var => 'build');
|
||||
my $milestone = $config->Get(var => 'milestone');
|
||||
my $tagDir = $config->Get(var => 'tagDir');
|
||||
my $mozillaCvsroot = $config->Get(var => 'mozillaCvsroot');
|
||||
my $branchTag = $config->Get(var => 'branchTag');
|
||||
my $pullDate = $config->Get(var => 'pullDate');
|
||||
my $logDir = $config->Get(sysvar => 'logDir');
|
||||
my $useTalkback = $config->Exists(var => 'useTalkback') ?
|
||||
$config->Get(var => 'useTalkback') : 0;
|
||||
|
||||
my $releaseTag = $productTag . '_RELEASE';
|
||||
my $buildTag = $productTag . '_BUILD' . $build;
|
||||
my $releaseTagDir = catfile($tagDir, $releaseTag);
|
||||
my $buildTagDir = catfile($tagDir, $buildTag);
|
||||
|
||||
# If specified, tag Talkback
|
||||
if ($useTalkback) {
|
||||
push(@TAG_SUB_STEPS, 'Talkback');
|
||||
}
|
||||
|
||||
# create the main tag directory
|
||||
if (not -d $buildTagDir) {
|
||||
MkdirWithPath(dir => $buildTagDir)
|
||||
or die("Cannot mkdir $buildTagDir: $!");
|
||||
}
|
||||
|
||||
# Tagging area for Mozilla
|
||||
my $cvsrootTagDir = catfile($buildTagDir, 'cvsroot');
|
||||
if (-e $cvsrootTagDir) {
|
||||
die "ASSERT: Tag::Execute(): $cvsrootTagDir already exists?";
|
||||
}
|
||||
|
||||
MkdirWithPath(dir => $cvsrootTagDir)
|
||||
or die("Cannot mkdir $cvsrootTagDir: $!");
|
||||
|
||||
# Check out Mozilla from the branch you want to tag.
|
||||
# TODO this should support running without branch tag or pull date.
|
||||
|
||||
my $geckoTag = undef;
|
||||
|
||||
if (1 == $build) {
|
||||
$this->CvsCo(cvsroot => $mozillaCvsroot,
|
||||
tag => $branchTag,
|
||||
date => $pullDate,
|
||||
modules => [CvsCatfile('mozilla', 'client.mk')],
|
||||
workDir => $cvsrootTagDir,
|
||||
logFile => catfile($logDir, 'tag_checkout_client_mk.log')
|
||||
);
|
||||
|
||||
$this->CheckLog(log => catfile($logDir, 'tag_checkout_client_mk.log'),
|
||||
checkForOnly => '^U mozilla/client.mk');
|
||||
|
||||
$this->Shell(cmd => 'gmake',
|
||||
cmdArgs => ['-f', 'client.mk', 'checkout',
|
||||
'MOZ_CO_PROJECT=all',
|
||||
'MOZ_CO_DATE=' . $pullDate],
|
||||
dir => catfile($cvsrootTagDir, 'mozilla'),
|
||||
logFile => catfile($logDir, 'tag_mozilla-checkout.log'));
|
||||
|
||||
$this->CheckLog(
|
||||
log => catfile($logDir, 'tag_mozilla-checkout.log'),
|
||||
checkFor => '^U',
|
||||
);
|
||||
|
||||
# Bug 419030 changed the way NSS is checked out for Fx/Tb 2.0.0.x,
|
||||
# pulling most of mozilla/security from one tag but checking out a
|
||||
# 2nd copy of mozilla/security/nss (into nss-fips) from another
|
||||
# Since we can't tag or branch files on two revisions we exclude
|
||||
# the older one from any operations by removing it.
|
||||
if (-e catfile($cvsrootTagDir,'mozilla','security','nss-fips')) {
|
||||
$this->Log(msg => 'Removing cvsroot/mozilla/security/nss-fips');
|
||||
if (rmtree(catfile($cvsrootTagDir,'mozilla','security','nss-fips'),1) <= 0) {
|
||||
die("ASSERT: rmtree() called on mozilla/security/nss-fips but nothing deleted.");
|
||||
}
|
||||
}
|
||||
|
||||
$geckoTag = $this->GenerateRelbranchName(milestone => $milestone);
|
||||
|
||||
# The glob seems weird/pointless, but it's because CvsTag requires a
|
||||
# list of files to operate on in the branch => 1 case. This may (or
|
||||
# may not) be considered a bug, depending on how paranoid you're
|
||||
# feeling about automatically creating branches.
|
||||
|
||||
my $cwd = getcwd();
|
||||
chdir(catfile($cvsrootTagDir, 'mozilla')) or
|
||||
die "Couldn't chdir() to $cvsrootTagDir/mozilla: $!\n";
|
||||
my @topLevelMozCVSFiles = grep(!/^CVS$/, glob('*'));
|
||||
chdir($cwd) or die "Couldn't chdir() home: $!\n";
|
||||
|
||||
$this->CvsTag(tagName => $geckoTag,
|
||||
branch => 1,
|
||||
files => \@topLevelMozCVSFiles,
|
||||
coDir => catfile($cvsrootTagDir, 'mozilla'),
|
||||
logFile => catfile($logDir, 'tag-relbranch_tag-' .
|
||||
$geckoTag));
|
||||
|
||||
$this->Shell(cmd => 'cvs',
|
||||
cmdArgs => ['up',
|
||||
'-r', $geckoTag],
|
||||
dir => catfile($cvsrootTagDir, 'mozilla'),
|
||||
logFile => catfile($logDir, 'tag-relbranch_update_' .
|
||||
$geckoTag));
|
||||
} else {
|
||||
# We go through some convoluted hoops here to get the _RELBRANCH
|
||||
# datespec without forcing it to be specified. Because of this,
|
||||
# there's lots of icky CVS parsing.
|
||||
|
||||
my $buildOneTag = $productTag . '_BUILD1';
|
||||
my $checkoutLog = "tag_build${build}_checkout_client_ck.log";
|
||||
|
||||
$this->CvsCo(cvsroot => $mozillaCvsroot,
|
||||
tag => $branchTag,
|
||||
date => $pullDate,
|
||||
modules => [CvsCatfile('mozilla', 'client.mk')],
|
||||
workDir => $cvsrootTagDir,
|
||||
logFile => catfile($logDir, $checkoutLog)
|
||||
);
|
||||
|
||||
$this->CheckLog(log => catfile($logDir, $checkoutLog),
|
||||
checkForOnly => '^U mozilla/client.mk');
|
||||
|
||||
# Use RunShellCommand() here because we need to grab the output,
|
||||
# and Shell() sends the output to a log.
|
||||
my $clientMkInfo = RunShellCommand(command => 'cvs',
|
||||
args => ['log',
|
||||
'client.mk'],
|
||||
dir => catfile($cvsrootTagDir,
|
||||
'mozilla'));
|
||||
|
||||
if ($clientMkInfo->{'exitValue'} != 0) {
|
||||
die("cvs log call on client.mk failed: " .
|
||||
$clientMkInfo->{'exitValue'} . "\n");
|
||||
}
|
||||
|
||||
my $inSymbolic = 0;
|
||||
my $inDescription = 0;
|
||||
my $haveRev = 0;
|
||||
my $cvsRev = '';
|
||||
my $cvsDateSpec = '';
|
||||
foreach my $logLine (split(/\n/, $clientMkInfo->{'output'})) {
|
||||
if ($inSymbolic && $logLine =~ /^\s+$buildOneTag:\s([\d\.]+)$/) {
|
||||
$cvsRev = $1;
|
||||
$inSymbolic = 0;
|
||||
next;
|
||||
} elsif ($inDescription && $logLine =~ /^revision $cvsRev$/) {
|
||||
$haveRev = 1;
|
||||
next;
|
||||
} elsif ($haveRev) {
|
||||
if ($logLine =~ /^date:\s([^;]+);/) {
|
||||
# Gives us a line like: "2006/12/05 19:12:58"
|
||||
$cvsDateSpec = $1;
|
||||
last;
|
||||
}
|
||||
|
||||
die 'ASSERT: Step::Tag::Execute(): have rev, but did not ' .
|
||||
'find a datespec?';
|
||||
} elsif ($logLine =~ /^symbolic names:/) {
|
||||
$inSymbolic = 1;
|
||||
next;
|
||||
} elsif ($logLine =~ /^description:/) {
|
||||
$inDescription = 1;
|
||||
next;
|
||||
}
|
||||
}
|
||||
|
||||
# relBranchDateSpec now has something like: "2006/12/05 19:12:58"
|
||||
my $relBranchDateSpec = $cvsDateSpec;
|
||||
# Strip off the time...
|
||||
$relBranchDateSpec =~ s/^\s*([\d\/]+).*/$1/;
|
||||
# Strip out the /'s; now we have our datespec: 20061205
|
||||
$relBranchDateSpec =~ s/\///g;
|
||||
|
||||
$geckoTag = $this->GenerateRelbranchName(milestone => $milestone,
|
||||
datespec => $relBranchDateSpec);
|
||||
|
||||
$this->CvsCo(cvsroot => $mozillaCvsroot,
|
||||
tag => $geckoTag,
|
||||
modules => ['mozilla'],
|
||||
workDir => $cvsrootTagDir,
|
||||
logFile => catfile($logDir, 'tag_checkout_client_mk.log')
|
||||
);
|
||||
}
|
||||
|
||||
$config->Set(var => 'geckoBranchTag', value => $geckoTag);
|
||||
|
||||
# Call substeps
|
||||
for (my $curStep = 0; $curStep < scalar(@TAG_SUB_STEPS); $curStep++) {
|
||||
my $stepName = $TAG_SUB_STEPS[$curStep];
|
||||
eval {
|
||||
$this->Log(msg => 'Tag running substep ' . $stepName);
|
||||
my $step = "Bootstrap::Step::Tag::$stepName"->new();
|
||||
$step->Execute();
|
||||
$step->Verify();
|
||||
};
|
||||
if ($@) {
|
||||
die("Tag substep $stepName died: $@");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
sub Verify {
|
||||
my $this = shift;
|
||||
|
||||
my $config = new Bootstrap::Config();
|
||||
my $logDir = $config->Get(sysvar => 'logDir');
|
||||
|
||||
# This step doesn't really do anything now, because the verification it used
|
||||
# to do (which wasn't much) is now done in the Execute() method, since the
|
||||
# biz logic for build 1 vs. build > 1 is different.
|
||||
}
|
||||
|
||||
#
|
||||
# All of the logic for CvsTag() was moved to Bootstrap::Util::CvsTag(), however
|
||||
# this shim out to that function was kept because this does some argument
|
||||
# handling and also various error-condition handling that would have to be
|
||||
# duplicated if every call-site was converted to Bootstrap::Util::CvsTag(),
|
||||
# so this version was kept to centralize the handling of that. See bug 387970.
|
||||
#
|
||||
|
||||
sub CvsTag {
|
||||
my $this = shift;
|
||||
my %args = @_;
|
||||
|
||||
# All the required args first, followed by the optional ones...
|
||||
|
||||
die "ASSERT: Bootstrap::Step::Tag::CvsTag(): null logFile"
|
||||
if (!exists($args{'logFile'}));
|
||||
die "ASSERT: Bootstrap::Step::Tag::CvsTag(): null coDir" if
|
||||
(!exists($args{'coDir'}));
|
||||
|
||||
# We renamed this argument when CvsTag() got moved...
|
||||
$args{'cvsDir'} = $args{'coDir'};
|
||||
|
||||
# Check if we're supposed to dump the tagging output to stdout...
|
||||
my $config = new Bootstrap::Config();
|
||||
if ($config->Exists(var => 'dumpLogs') &&
|
||||
$config->Get(var => 'dumpLogs')) {
|
||||
$args{'output'} = 1;
|
||||
}
|
||||
|
||||
# We call this by full scoping (and don't include it in the use() statement
|
||||
# for Bootstrap::Util above) to disambiguate between the Util version and
|
||||
# the Tag version, which is a shim now.
|
||||
my $rv = Bootstrap::Util::CvsTag(%args);
|
||||
|
||||
if ($rv->{'timedOut'} || ($rv->{'exitValue'} != 0)) {
|
||||
$this->Log(msg => "Bootstrap::Step::Tag::CvsTag failed; rv: " .
|
||||
"$rv->{'exitValue'}, timeout: $rv->{'timedOut'}, output: " .
|
||||
"$rv->{'output'}");
|
||||
die("Bootstrap::Step::Tag::CvsTag: exited bogusly: $rv->{'exitValue'}");
|
||||
}
|
||||
|
||||
return $rv;
|
||||
}
|
||||
|
||||
#
|
||||
# Give me some information, I'll give you the GECKO$version_$datespec_RELBRANCH
|
||||
# tag back; utility function, so we can centralize creation of this string.
|
||||
#
|
||||
# It has two modes; if you give it a branch (always required), you'll get a new
|
||||
# (current) _RELBRANCH tag; if you give it a datespec, you'll get a _RELBRANCH
|
||||
# tag based on that datespec (which, of course, may or may not exist.
|
||||
#
|
||||
# You can override all of this logic by setting "RelbranchOverride" in the
|
||||
# bootstrap.cfg.
|
||||
#
|
||||
sub GenerateRelbranchName {
|
||||
my $this = shift;
|
||||
my %args = @_;
|
||||
|
||||
die "ASSERT: GenerateRelbranchName(): null milestone" if
|
||||
(!exists($args{'milestone'}));
|
||||
|
||||
my $config = new Bootstrap::Config();
|
||||
|
||||
if ($config->Exists(var => 'RelbranchOverride')) {
|
||||
return $config->Get(var => 'RelbranchOverride');
|
||||
}
|
||||
|
||||
# Convert milestone (1.8.1.x => 181 or 1.9b1 => 19b1)
|
||||
|
||||
my $geckoVersion = $args{'milestone'};
|
||||
|
||||
# 1.9.0.10 style version numbers (for releases, generally)
|
||||
if ($geckoVersion =~ m/(\d\.){3,4}/) {
|
||||
$geckoVersion =~ s/\.//g;
|
||||
$geckoVersion =~ s/^(\d{3}).*$/$1/;
|
||||
die "ASSERT: GenerateRelbranchName(): Gecko version should be only " .
|
||||
"numbers by now" if ($geckoVersion !~ /^\d{3}$/);
|
||||
}
|
||||
# 1.9b1 style version numbers (for alpha/betas, generally)
|
||||
elsif ($geckoVersion =~ m/\d\.\d[ab]\d+/i) {
|
||||
$geckoVersion =~ s/\.//g;
|
||||
}
|
||||
# new major version, eg 1.9 (Fx3)
|
||||
elsif ($geckoVersion =~ m/^\d\.\d$/) {
|
||||
$geckoVersion =~ s/\.//g;
|
||||
}
|
||||
else {
|
||||
die "ASSERT: GenerateRelbranchName(): Unknown Gecko version format";
|
||||
}
|
||||
|
||||
my $geckoDateSpec = exists($args{'datespec'}) ? $args{'datespec'} :
|
||||
strftime('%Y%m%d', gmtime());
|
||||
|
||||
# This assert()ion has a Y21k (among other) problem(s)...
|
||||
die "ASSERT: GenerateRelbranchName(): invalid datespec" if
|
||||
($geckoDateSpec !~ /^20\d{6}$/);
|
||||
|
||||
return 'GECKO' . $geckoVersion . '_' . $geckoDateSpec . '_RELBRANCH';
|
||||
}
|
||||
|
||||
1;
|
||||
@@ -1,148 +0,0 @@
|
||||
#
|
||||
# Tag::Bump substep. Bumps version files for Mozilla appropriately.
|
||||
#
|
||||
package Bootstrap::Step::Tag::Bump;
|
||||
|
||||
use strict;
|
||||
|
||||
use File::Copy qw(move);
|
||||
|
||||
use MozBuild::Util qw(MkdirWithPath);
|
||||
|
||||
use Bootstrap::Util qw(CvsCatfile);
|
||||
use Bootstrap::Step;
|
||||
use Bootstrap::Config;
|
||||
use Bootstrap::Step::Tag;
|
||||
|
||||
our @ISA = ("Bootstrap::Step::Tag");
|
||||
|
||||
sub Execute {
|
||||
my $this = shift;
|
||||
|
||||
my $config = new Bootstrap::Config();
|
||||
my $product = $config->Get(var => 'product');
|
||||
my $productTag = $config->Get(var => 'productTag');
|
||||
my $branchTag = $config->Get(var => 'branchTag');
|
||||
my $pullDate = $config->Get(var => 'pullDate');
|
||||
my $version = $config->GetVersion(longName => 0);
|
||||
my $appVersion = $config->GetAppVersion();
|
||||
my $build = int($config->Get(var => 'build'));
|
||||
my $milestone = $config->Get(var => 'milestone');
|
||||
my $appName = $config->Get(var => 'appName');
|
||||
my $logDir = $config->Get(sysvar => 'logDir');
|
||||
my $mozillaCvsroot = $config->Get(var => 'mozillaCvsroot');
|
||||
my $hgToolsRepo = $config->Get(var => 'hgToolsRepo');
|
||||
my $tagDir = $config->Get(var => 'tagDir');
|
||||
my $geckoBranchTag = $config->Get(var => 'geckoBranchTag');
|
||||
my $bumpMilestoneTxt = $config->Get(var => 'bumpMilestoneTxt');
|
||||
|
||||
my $releaseTag = $productTag . '_RELEASE';
|
||||
my $buildTag = $productTag . '_BUILD' . $build;
|
||||
|
||||
my $buildTagDir = catfile($tagDir, $buildTag);
|
||||
my $cvsrootTagDir = catfile($buildTagDir, 'cvsroot');
|
||||
|
||||
## TODO - we need to handle the case here where we're in security firedrill
|
||||
## mode, and we need to bump versions on the GECKO_ branch, but they
|
||||
## won't have "pre" in them. :-o
|
||||
#
|
||||
# We only do the bump step for build1
|
||||
|
||||
if ($build > 1) {
|
||||
$this->Log(msg => "Skipping Tag::Bump::Execute substep for build $build.");
|
||||
return;
|
||||
}
|
||||
|
||||
# pull version files
|
||||
my $moduleVer = CvsCatfile($appName, 'app', 'module.ver');
|
||||
my $versionTxt = CvsCatfile($appName, 'config', 'version.txt');
|
||||
my $milestoneTxt = CvsCatfile('config', 'milestone.txt');
|
||||
|
||||
my @bumpFiles = ('client.mk', $moduleVer, $versionTxt);
|
||||
|
||||
# milestone changes based on configuration
|
||||
if ($bumpMilestoneTxt) {
|
||||
@bumpFiles = (@bumpFiles, $milestoneTxt);
|
||||
}
|
||||
|
||||
# Check out Mozilla from the branch you want to tag.
|
||||
# TODO this should support running without branch tag or pull date.
|
||||
$this->CvsCo(
|
||||
cvsroot => $mozillaCvsroot,
|
||||
tag => $geckoBranchTag,
|
||||
modules => [CvsCatfile('mozilla', 'client.mk'),
|
||||
CvsCatfile('mozilla', $appName, 'app', 'module.ver'),
|
||||
CvsCatfile('mozilla', $appName, 'config', 'version.txt'),
|
||||
CvsCatfile('mozilla', 'config', 'milestone.txt')],
|
||||
workDir => $cvsrootTagDir,
|
||||
logFile => catfile($logDir, 'tag-bump_checkout.log')
|
||||
);
|
||||
|
||||
### Perform version bump
|
||||
|
||||
# bug 449208 moved this logic to an external script to more easily
|
||||
# support both CVS and Mercurial based releases
|
||||
$this->HgClone(
|
||||
repo => $hgToolsRepo,
|
||||
workDir => catfile($buildTagDir)
|
||||
);
|
||||
$this->Shell(
|
||||
cmd => 'perl',
|
||||
cmdArgs => [catfile($buildTagDir, 'tools', 'release', 'version-bump.pl'),
|
||||
'-w', catfile($cvsrootTagDir, 'mozilla'),
|
||||
'-t', $releaseTag,
|
||||
'-a', $appName,
|
||||
'-v', $appVersion,
|
||||
'-m', $milestone,
|
||||
@bumpFiles],
|
||||
logFile => catfile($logDir, 'tag-bump_files.log'),
|
||||
);
|
||||
|
||||
my $bumpCiMsg = 'Automated checkin: version bump, remove pre tag for '
|
||||
. $product . ' ' . $version . ' release on '
|
||||
. $geckoBranchTag;
|
||||
$this->Shell(
|
||||
cmd => 'cvs',
|
||||
cmdArgs => ['commit', '-m', $bumpCiMsg,
|
||||
@bumpFiles,
|
||||
],
|
||||
dir => catfile($buildTagDir, 'cvsroot', 'mozilla'),
|
||||
logFile => catfile($logDir, 'tag-bump_checkin.log'),
|
||||
);
|
||||
}
|
||||
|
||||
sub Verify {
|
||||
my $this = shift;
|
||||
|
||||
my $config = new Bootstrap::Config();
|
||||
my $logDir = $config->Get(sysvar => 'logDir');
|
||||
my $appName = $config->Get(var => 'appName');
|
||||
my $product = $config->Get(var => 'product');
|
||||
my $milestone = $config->Exists(var => 'milestone') ?
|
||||
$config->Get(var => 'milestone') : undef;
|
||||
my $build = $config->Get(var => 'build');
|
||||
|
||||
if ($build > 1) {
|
||||
$this->Log(msg => "Skipping Tag::Bump::Verify substep for build $build.");
|
||||
return;
|
||||
}
|
||||
|
||||
my $moduleVer = catfile($appName, 'app', 'module.ver');
|
||||
my $versionTxt = catfile($appName, 'config', 'version.txt');
|
||||
my $milestoneTxt = catfile('config', 'milestone.txt');
|
||||
my @bumpFiles = ('client.mk', $moduleVer, $versionTxt);
|
||||
|
||||
# milestone changes only occur with Firefox releases
|
||||
if ($product eq 'firefox') {
|
||||
@bumpFiles = (@bumpFiles, $milestoneTxt);
|
||||
}
|
||||
|
||||
foreach my $file (@bumpFiles) {
|
||||
$this->CheckLog(
|
||||
log => catfile($logDir, 'tag-bump_checkin.log'),
|
||||
checkFor => $file,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
1;
|
||||
@@ -1,111 +0,0 @@
|
||||
#
|
||||
# Tag Mozilla substep. Applies appropriate tags to Mozilla source code.
|
||||
#
|
||||
package Bootstrap::Step::Tag::Mozilla;
|
||||
|
||||
use File::Copy qw(move);
|
||||
use File::Spec::Functions;
|
||||
|
||||
use MozBuild::Util qw(MkdirWithPath);
|
||||
use Bootstrap::Util qw(GetDiffFileList);
|
||||
|
||||
use Bootstrap::Config;
|
||||
use Bootstrap::Step::Tag;
|
||||
|
||||
use strict;
|
||||
|
||||
our @ISA = ("Bootstrap::Step::Tag");
|
||||
|
||||
sub Execute {
|
||||
my $this = shift;
|
||||
|
||||
my $config = new Bootstrap::Config();
|
||||
my $productTag = $config->Get(var => 'productTag');
|
||||
my $build = int($config->Get(var => 'build'));
|
||||
my $logDir = $config->Get(sysvar => 'logDir');
|
||||
my $mozillaCvsroot = $config->Get(var => 'mozillaCvsroot');
|
||||
my $tagDir = $config->Get(var => 'tagDir');
|
||||
|
||||
my $releaseTag = $productTag . '_RELEASE';
|
||||
my $buildTag = $productTag . '_BUILD' . $build;
|
||||
my $buildTagDir = catfile($tagDir, $buildTag);
|
||||
my $cvsrootTagDir = catfile($buildTagDir, 'cvsroot');
|
||||
|
||||
# Create the BUILD tag
|
||||
$this->CvsTag(
|
||||
tagName => $buildTag,
|
||||
coDir => catfile($cvsrootTagDir, 'mozilla'),
|
||||
logFile => catfile($logDir,
|
||||
'tag-mozilla_cvsroot_tag-' . $buildTag . '.log'),
|
||||
);
|
||||
|
||||
# Create or move the RELEASE tag
|
||||
#
|
||||
# This is for the Verify() method; we assume that we actually set (or reset,
|
||||
# in the case of build > 1) the _RELEASE tag; if that's not the case, we reset
|
||||
# this value below.
|
||||
$config->Set(var => 'tagModifyMozillaReleaseTag', value => 1);
|
||||
|
||||
if ($build > 1) {
|
||||
my $previousBuildTag = $productTag . '_BUILD' . ($build - 1);
|
||||
my $diffFileList = GetDiffFileList(cvsDir => catfile($cvsrootTagDir,
|
||||
'mozilla'),
|
||||
prevTag => $previousBuildTag,
|
||||
newTag => $buildTag);
|
||||
|
||||
if (scalar(@{$diffFileList}) > 0) {
|
||||
$this->CvsTag(
|
||||
tagName => $releaseTag,
|
||||
coDir => catfile($cvsrootTagDir, 'mozilla'),
|
||||
force => 1,
|
||||
files => $diffFileList,
|
||||
logFile => catfile($logDir,
|
||||
'tag-mozilla_cvsroot_tag-' . $releaseTag .
|
||||
'.log'),
|
||||
);
|
||||
} else {
|
||||
$config->Set(var => 'tagModifyMozillaReleaseTag', value => 0,
|
||||
force => 1);
|
||||
$this->Log(msg => "No diffs found in cvsroot for build $build; NOT " .
|
||||
"modifying $releaseTag");
|
||||
}
|
||||
} else {
|
||||
$this->CvsTag(
|
||||
tagName => $releaseTag,
|
||||
coDir => catfile($cvsrootTagDir, 'mozilla'),
|
||||
logFile => catfile($logDir,
|
||||
'tag-mozilla_cvsroot_tag-' . $releaseTag . '.log'),
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
sub Verify {
|
||||
my $this = shift;
|
||||
|
||||
my $config = new Bootstrap::Config();
|
||||
my $productTag = $config->Get(var => 'productTag');
|
||||
my $logDir = $config->Get(sysvar => 'logDir');
|
||||
my $build = $config->Get(var => 'build');
|
||||
|
||||
my $releaseTag = $productTag . '_RELEASE';
|
||||
my $buildTag = $productTag . '_BUILD' . $build;
|
||||
|
||||
my @checkTags = ($buildTag);
|
||||
|
||||
# If build > 1 and we took no changes in cvsroot for that build, the _RELEASE
|
||||
# tag won't have changed, so we shouldn't attempt to check it.
|
||||
if ($config->Get(var => 'tagModifyMozillaReleaseTag')) {
|
||||
push(@checkTags, $releaseTag);
|
||||
}
|
||||
|
||||
# TODO: should this complain about W's?
|
||||
foreach my $tag (@checkTags) {
|
||||
$this->CheckLog(
|
||||
log => catfile($logDir, 'tag-mozilla_cvsroot_tag-' . $tag . '.log'),
|
||||
checkFor => '^T',
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
1;
|
||||
@@ -1,90 +0,0 @@
|
||||
#
|
||||
# Tag step. Applies a CVS tag to the appropriate repositories.
|
||||
#
|
||||
package Bootstrap::Step::Tag::Talkback;
|
||||
|
||||
use strict;
|
||||
|
||||
use File::Copy qw(move);
|
||||
|
||||
use MozBuild::Util qw(MkdirWithPath);
|
||||
|
||||
use Bootstrap::Util qw(CvsCatfile);
|
||||
use Bootstrap::Step;
|
||||
use Bootstrap::Config;
|
||||
use Bootstrap::Step::Tag;
|
||||
|
||||
our @ISA = ("Bootstrap::Step::Tag");
|
||||
|
||||
sub Execute {
|
||||
my $this = shift;
|
||||
|
||||
my $config = new Bootstrap::Config();
|
||||
my $productTag = $config->Get(var => 'productTag');
|
||||
my $branchTag = $config->Get(var => 'branchTag');
|
||||
my $build = int($config->Get(var => 'build'));
|
||||
my $pullDate = $config->Get(var => 'pullDate');
|
||||
my $logDir = $config->Get(sysvar => 'logDir');
|
||||
my $mofoCvsroot = $config->Get(var => 'mofoCvsroot');
|
||||
my $tagDir = $config->Get(var => 'tagDir');
|
||||
|
||||
my $releaseTag = $productTag . '_RELEASE';
|
||||
my $buildTag = $productTag . '_BUILD' . $build;
|
||||
my $releaseTagDir = catfile($tagDir, $buildTag);
|
||||
|
||||
# Since talkback so seldom changes, we don't include it in our fancy
|
||||
# respin logic; we only need to tag it for build 1.
|
||||
if ($build > 1) {
|
||||
$this->Log(msg => "Not tagging Talkback repo for build $build.");
|
||||
return;
|
||||
}
|
||||
|
||||
# Create the mofo tag directory.
|
||||
my $mofoDir = catfile($releaseTagDir, 'mofo');
|
||||
if (not -d $mofoDir) {
|
||||
MkdirWithPath(dir => $mofoDir)
|
||||
or die("Cannot mkdir $mofoDir: $!");
|
||||
}
|
||||
|
||||
# Check out the talkback files from the branch you want to tag.
|
||||
$this->CvsCo(
|
||||
cvsroot => $mofoCvsroot,
|
||||
tag => $branchTag,
|
||||
date => $pullDate,
|
||||
modules => [CvsCatfile('talkback', 'fullsoft')],
|
||||
workDir => catfile($releaseTagDir, 'mofo'),
|
||||
logFile => catfile($logDir, 'tag-talkback_mofo-checkout.log')
|
||||
);
|
||||
|
||||
# Create the talkback RELEASE tag.
|
||||
$this->CvsTag(
|
||||
tagName => $releaseTag,
|
||||
coDir => catfile($releaseTagDir, 'mofo', 'talkback', 'fullsoft'),
|
||||
logFile => catfile($logDir,
|
||||
'tag-talkback_mofo-tag-' . $releaseTag . '.log'),
|
||||
);
|
||||
}
|
||||
|
||||
sub Verify {
|
||||
my $this = shift;
|
||||
|
||||
my $config = new Bootstrap::Config();
|
||||
my $logDir = $config->Get(sysvar => 'logDir');
|
||||
my $productTag = $config->Get(var => 'productTag');
|
||||
my $build = $config->Get(var => 'build');
|
||||
|
||||
if ($build > 1) {
|
||||
$this->Log(msg => "Not verifying Talkback repo for build $build.");
|
||||
return;
|
||||
}
|
||||
|
||||
my $releaseTag = $productTag . '_RELEASE';
|
||||
|
||||
$this->CheckLog(
|
||||
log => catfile($logDir,
|
||||
'tag-talkback_mofo-tag-' . $releaseTag . '.log'),
|
||||
checkFor => '^T',
|
||||
);
|
||||
}
|
||||
|
||||
1;
|
||||
@@ -1,162 +0,0 @@
|
||||
#
|
||||
# Tag step. Applies a CVS tag to the appropriate repositories.
|
||||
#
|
||||
package Bootstrap::Step::Tag::l10n;
|
||||
|
||||
use Cwd;
|
||||
use File::Copy qw(move);
|
||||
use File::Spec::Functions;
|
||||
|
||||
use MozBuild::Util qw(MkdirWithPath);
|
||||
|
||||
use Bootstrap::Step;
|
||||
use Bootstrap::Config;
|
||||
use Bootstrap::Step::Tag;
|
||||
use Bootstrap::Util qw(CvsCatfile GetDiffFileList);
|
||||
|
||||
use strict;
|
||||
|
||||
our @ISA = ("Bootstrap::Step::Tag");
|
||||
|
||||
sub Execute {
|
||||
my $this = shift;
|
||||
|
||||
my $config = new Bootstrap::Config();
|
||||
my $product = $config->Get(var => 'product');
|
||||
my $productTag = $config->Get(var => 'productTag');
|
||||
my $branchTag = $config->Get(var => 'branchTag');
|
||||
my $l10n_pullDate = $config->Get(var => 'l10n_pullDate');
|
||||
my $build = int($config->Get(var => 'build'));
|
||||
my $appName = $config->Get(var => 'appName');
|
||||
my $logDir = $config->Get(sysvar => 'logDir');
|
||||
my $l10nCvsroot = $config->Get(var => 'l10nCvsroot');
|
||||
my $tagDir = $config->Get(var => 'tagDir');
|
||||
|
||||
my $releaseTag = $productTag . '_RELEASE';
|
||||
my $buildTag = $productTag . '_BUILD' . $build;
|
||||
my $releaseTagDir = catfile($tagDir, $buildTag);
|
||||
|
||||
# Create the l10n tag directory.
|
||||
my $l10nTagDir = catfile($releaseTagDir, 'l10n');
|
||||
|
||||
if (not -d $l10nTagDir) {
|
||||
MkdirWithPath(dir => $l10nTagDir) or
|
||||
die("Cannot mkdir $l10nTagDir: $!");
|
||||
}
|
||||
|
||||
# Grab list of shipped locales
|
||||
#
|
||||
# Note: GetLocaleInfo() has a dependency on the $releaseTag above already
|
||||
# being set; it should be by when the l10n tagging step gets run, though.
|
||||
|
||||
my $localeInfo = $config->GetLocaleInfo();
|
||||
|
||||
# Config::Set() for us by Step::Tag::Execute()
|
||||
my $geckoTag = $config->Get(var => 'geckoBranchTag');
|
||||
|
||||
for my $locale (sort(keys(%{$localeInfo}))) {
|
||||
# skip en-US; it's kept in the main repo
|
||||
next if ($locale eq 'en-US');
|
||||
|
||||
# Make sure to pull from the right tag and/or date for buildN.
|
||||
$this->CvsCo(cvsroot => $l10nCvsroot,
|
||||
tag => (1 == $build) ? $branchTag : $geckoTag,
|
||||
date => (1 == $build) ? $l10n_pullDate : 0,
|
||||
modules => [CvsCatfile('l10n', $locale)],
|
||||
workDir => $l10nTagDir,
|
||||
logFile => catfile($logDir, 'tag-l10n_checkout.log'));
|
||||
}
|
||||
|
||||
my $cwd = getcwd();
|
||||
chdir(catfile($l10nTagDir, 'l10n')) or
|
||||
die "chdir() to $l10nTagDir/l10n failed: $!\n";
|
||||
my @topLevelFiles = grep(!/^CVS$/, glob('*'));
|
||||
chdir($cwd) or die "Couldn't chdir() home: $!\n";
|
||||
|
||||
if (1 == $build) {
|
||||
$this->CvsTag(tagName => $geckoTag,
|
||||
branch => 1,
|
||||
files => \@topLevelFiles,
|
||||
coDir => catfile($l10nTagDir, 'l10n'),
|
||||
logFile => catfile($logDir, 'tag-l10n_relbranch_tag_' .
|
||||
$geckoTag));
|
||||
|
||||
|
||||
$this->Shell(cmd => 'cvs',
|
||||
cmdArgs => ['up',
|
||||
'-r', $geckoTag],
|
||||
dir => catfile($l10nTagDir, 'l10n'),
|
||||
logFile => catfile($logDir, 'tag-l10n_relbranch_update_' .
|
||||
$geckoTag));
|
||||
}
|
||||
|
||||
# Create the l10n BUILD tag
|
||||
$this->CvsTag(
|
||||
tagName => $buildTag,
|
||||
coDir => catfile($l10nTagDir, 'l10n'),
|
||||
logFile => catfile($logDir, 'tag-l10n_tag_' . $buildTag. '.log'),
|
||||
);
|
||||
|
||||
# Create the l10n RELEASE tag
|
||||
my %releaseTagArgs = (tagName => $releaseTag,
|
||||
coDir => catfile($l10nTagDir, 'l10n'),
|
||||
logFile => catfile($logDir, 'tag-l10n_tag_' .
|
||||
$releaseTag. '.log'));
|
||||
|
||||
# This is for the Verify() method; we assume that we actually set (or reset,
|
||||
# in the case of build > 1) the _RELEASE tag; if that's not the case, we reset
|
||||
# this value below.
|
||||
$config->Set(var => 'tagModifyl10nReleaseTag', value => 1);
|
||||
|
||||
# If we're retagging build(N > 1), we need to tag -F
|
||||
if ($build > 1) {
|
||||
my $previousBuildTag = $productTag . '_BUILD' . ($build - 1);
|
||||
my $diffFileList = GetDiffFileList(cvsDir => catfile($l10nTagDir,
|
||||
'l10n'),
|
||||
prevTag => $previousBuildTag,
|
||||
newTag => $buildTag);
|
||||
|
||||
if (scalar(@{$diffFileList}) > 0) {
|
||||
$releaseTagArgs{'force'} = 1;
|
||||
$releaseTagArgs{'files'} = $diffFileList;
|
||||
$this->CvsTag(%releaseTagArgs);
|
||||
} else {
|
||||
$this->Log(msg => "No diffs found in l10n for build $build; NOT " .
|
||||
"modifying $releaseTag");
|
||||
$config->Set(var => 'tagModifyl10nReleaseTag', value => 0,
|
||||
force => 1);
|
||||
}
|
||||
} else {
|
||||
# If we're build 1, we obviously need to apply the _RELEASE tag...
|
||||
$this->CvsTag(%releaseTagArgs);
|
||||
}
|
||||
}
|
||||
|
||||
sub Verify {
|
||||
my $this = shift;
|
||||
|
||||
my $config = new Bootstrap::Config();
|
||||
my $logDir = $config->Get(sysvar => 'logDir');
|
||||
my $productTag = $config->Get(var => 'productTag');
|
||||
my $build = $config->Get(var => 'build');
|
||||
|
||||
my $releaseTag = $productTag . '_RELEASE';
|
||||
my $buildTag = $productTag . '_BUILD' . $build;
|
||||
|
||||
my @checkTags = ($buildTag);
|
||||
|
||||
# If build > 1 and we took no changes in cvsroot for that build, the _RELEASE
|
||||
# tag won't have changed, so we shouldn't attempt to check it.
|
||||
if ($config->Get(var => 'tagModifyl10nReleaseTag')) {
|
||||
push(@checkTags, $releaseTag);
|
||||
}
|
||||
|
||||
foreach my $tag (@checkTags) {
|
||||
$this->CheckLog(
|
||||
log => catfile($logDir, 'tag-l10n_tag_' . $tag . '.log'),
|
||||
checkFor => '^T',
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
1;
|
||||
@@ -1,208 +0,0 @@
|
||||
##
|
||||
# TinderConfig - creates config file for Tinderbox
|
||||
##
|
||||
|
||||
package Bootstrap::Step::TinderConfig;
|
||||
|
||||
use Bootstrap::Step;
|
||||
use Bootstrap::Config;
|
||||
use Bootstrap::Util qw(CvsCatfile CvsTag);
|
||||
|
||||
use MozBuild::TinderLogParse;
|
||||
use MozBuild::Util qw(MkdirWithPath);
|
||||
|
||||
@ISA = ("Bootstrap::Step");
|
||||
|
||||
sub Execute {
|
||||
my $this = shift;
|
||||
|
||||
my $config = new Bootstrap::Config();
|
||||
my $configBumpDir = $config->Get(var => 'configBumpDir');
|
||||
my $productTag = $config->Get(var => 'productTag');
|
||||
my $version = $config->GetVersion(longName => 0);
|
||||
my $build = int($config->Get(var => 'build'));
|
||||
my $mozillaCvsroot = $config->Get(var => 'mozillaCvsroot');
|
||||
my $product = $config->Get(var => 'product');
|
||||
my $logDir = $config->Get(sysvar => 'logDir');
|
||||
my $branchTag = $config->Get(var => 'branchTag');
|
||||
my $osname = $config->SystemInfo(var => 'osname');
|
||||
|
||||
my $releaseTag = $productTag . '_RELEASE';
|
||||
|
||||
my $productConfigBumpDir = catfile($configBumpDir,
|
||||
"$product-$version-build$build");
|
||||
|
||||
if (-e $productConfigBumpDir) {
|
||||
die "ASSERT: Step::TinderConfig::Execute(): $productConfigBumpDir " .
|
||||
'already exists?';
|
||||
}
|
||||
|
||||
MkdirWithPath(dir => $productConfigBumpDir)
|
||||
or die("Cannot mkdir $productConfigBumpDir: $!");
|
||||
|
||||
my @branches = @{DetermineBranches()};
|
||||
|
||||
if (scalar(@branches) != 2) {
|
||||
die("ASSERT: Bootstrap::Step::TinderConfig(): Got " .
|
||||
scalar(@branches) . " branches from DetermineBranches(), " .
|
||||
"needed 2.");
|
||||
}
|
||||
|
||||
foreach my $branch (@branches) {
|
||||
$this->CvsCo(cvsroot => $mozillaCvsroot,
|
||||
checkoutDir => $branch,
|
||||
tag => $branch,
|
||||
modules => [CvsCatfile('mozilla', 'tools',
|
||||
'tinderbox-configs', $product, $osname)],
|
||||
logFile => catfile($logDir,
|
||||
'build_config-checkout-' . $branch . '.log'),
|
||||
workDir => $productConfigBumpDir
|
||||
);
|
||||
|
||||
my @bumpConfigFiles = qw(tinder-config.pl mozconfig);
|
||||
|
||||
foreach my $configFile (@bumpConfigFiles) {
|
||||
$config->Bump( configFile =>
|
||||
catfile($productConfigBumpDir, $branch, $configFile));
|
||||
$this->Shell(
|
||||
cmd => 'cvs',
|
||||
cmdArgs => ['-d', $mozillaCvsroot,
|
||||
'ci', '-m',
|
||||
'"Automated configuration bump, release for '
|
||||
. $product . ' ' . $version . "build$build" . '"',
|
||||
$configFile],
|
||||
logFile => catfile($logDir,
|
||||
'build_config-checkin-' . $configFile . '-' .
|
||||
$branch . '.log'),
|
||||
dir => catfile($productConfigBumpDir, $branch)
|
||||
);
|
||||
}
|
||||
|
||||
if ($version eq 'nightly') {
|
||||
$this->Log(msg => 'Skipping TinderConfig tagging for nightly mode');
|
||||
next;
|
||||
}
|
||||
|
||||
my @tagNames = ($productTag . '_RELEASE',
|
||||
$productTag . '_BUILD' . $build);
|
||||
|
||||
foreach my $configTagName (@tagNames) {
|
||||
# XXX - Don't like doing this this way (specifically, the logic
|
||||
# change depending on the name of the branch in this loop...)
|
||||
#
|
||||
# Also, the force argument to CvsTag() is interesting; we only
|
||||
# want to cvs tag -F a whatever_RELEASE tag if we're not tagging
|
||||
# the first build; so, the logic is (build > 1 && we're doing a _RELEASE
|
||||
# tag; also, we have to surround it in int(); otherwise, if it's
|
||||
# false, we get the empty string, which is undef which is bad.
|
||||
$configTagName .= '_l10n' if ($branch =~ /l10n/);
|
||||
|
||||
my $rv = CvsTag(tagName => $configTagName,
|
||||
force => int($build > 1 &&
|
||||
$configTagName =~ /_RELEASE/),
|
||||
files => \@bumpConfigFiles,
|
||||
cvsDir => catfile($productConfigBumpDir,
|
||||
$branch),
|
||||
logFile => catfile($logDir, 'build_config-tag-' .
|
||||
$branch . '.log'),
|
||||
output => 1
|
||||
);
|
||||
|
||||
if ($rv->{'timedOut'} || ($rv->{'exitValue'} != 0)) {
|
||||
$this->Log(msg => "CvsTag() in TinderConfig() failed; " .
|
||||
"tag: $configTagName, rv: $rv->{'exitValue'}, " .
|
||||
"timeout: $rv->{'timedOut'}, output: $rv->{'output'}");
|
||||
die("Bootstrap::Step::TinderConfig tag failed: "
|
||||
. $rv->{'exitValue'});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
sub Verify {
|
||||
my $this = shift;
|
||||
|
||||
my $config = new Bootstrap::Config();
|
||||
my $branchTag = $config->Get(var => 'branchTag');
|
||||
my $logDir = $config->Get(sysvar => 'logDir');
|
||||
my $version = $config->Get(var => 'version');
|
||||
|
||||
my @branches = @{DetermineBranches()};
|
||||
|
||||
if (scalar(@branches) != 2) {
|
||||
die("ASSERT: Bootstrap::Step::TinderConfig(): Got " .
|
||||
scalar(@branches) . " branches from DetermineBranches(), " .
|
||||
"needed 2.");
|
||||
}
|
||||
|
||||
foreach my $branch (@branches) {
|
||||
$this->CheckLog(
|
||||
log => catfile($logDir,
|
||||
'build_config-checkout-' . $branch . '.log'),
|
||||
notAllowed => 'fail',
|
||||
);
|
||||
|
||||
$this->CheckLog(
|
||||
log => catfile($logDir,
|
||||
'build_config-checkout-' . $branch . '.log'),
|
||||
notAllowed => 'aborted',
|
||||
);
|
||||
|
||||
# In nightly mode we don't do any tagging, so there's nothing to verify
|
||||
if ($version eq 'nightly') {
|
||||
$this->Log(msg => 'Skipping tag verification for nightly mode.');
|
||||
} else {
|
||||
$this->CheckLog(
|
||||
log => catfile($logDir, 'build_config-tag-' . $branch . '.log'),
|
||||
checkFor => '^T',
|
||||
);
|
||||
}
|
||||
|
||||
foreach my $configFile ('mozconfig', 'tinder-config.pl') {
|
||||
$this->CheckLog(
|
||||
log => catfile($logDir,
|
||||
'build_config-checkin-' . $configFile . '-' . $branch . '.log'),
|
||||
notAllowed => 'fail',
|
||||
);
|
||||
$this->CheckLog(
|
||||
log => catfile($logDir,
|
||||
'build_config-checkin-' . $configFile . '-' . $branch . '.log'),
|
||||
notAllowed => 'aborted',
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
sub DetermineBranches {
|
||||
my $this = shift;
|
||||
my %args = @_;
|
||||
|
||||
my $config = new Bootstrap::Config();
|
||||
my $version = $config->Get(var => 'version');
|
||||
my $branchTag = $config->Get(var => 'branchTag');
|
||||
|
||||
my @branches = ();
|
||||
# tinderbox-configs tags are different on branches vs trunk
|
||||
# Additionally, nightlies use different branches
|
||||
# Do the right thing in all cases
|
||||
if ($branchTag eq 'HEAD') {
|
||||
if ($version eq 'nightly') {
|
||||
push(@branches, ('HEAD', 'l10n'));
|
||||
}
|
||||
else {
|
||||
push(@branches, ('release', 'l10n_release'));
|
||||
}
|
||||
}
|
||||
else {
|
||||
if ($version eq 'nightly') {
|
||||
push(@branches, $branchTag);
|
||||
push(@branches, $branchTag . '_l10n');
|
||||
}
|
||||
else {
|
||||
push(@branches, $branchTag . '_release');
|
||||
push(@branches, $branchTag . '_l10n_release');
|
||||
}
|
||||
}
|
||||
|
||||
return \@branches;
|
||||
}
|
||||
@@ -1,313 +0,0 @@
|
||||
#
|
||||
# Updates step. Generates binary update (MAR) files as well as AUS config
|
||||
# snippets.
|
||||
#
|
||||
package Bootstrap::Step::Updates;
|
||||
|
||||
use Bootstrap::Step;
|
||||
use Bootstrap::Config;
|
||||
use Bootstrap::Util qw(CvsCatfile GetLocaleManifest);
|
||||
|
||||
use File::Find qw(find);
|
||||
use POSIX qw(strftime);
|
||||
|
||||
use MozBuild::Util qw(MkdirWithPath);
|
||||
|
||||
@ISA = ("Bootstrap::Step");
|
||||
|
||||
sub Execute {
|
||||
my $this = shift;
|
||||
|
||||
my $config = new Bootstrap::Config();
|
||||
my $product = $config->Get(var => 'product');
|
||||
my $logDir = $config->Get(sysvar => 'logDir');
|
||||
my $oldVersion = $config->GetOldVersion(longName => 0);
|
||||
my $version = $config->GetVersion(longName => 0);
|
||||
my $mozillaCvsroot = $config->Get(var => 'mozillaCvsroot');
|
||||
my $updateDir = $config->Get(var => 'updateDir');
|
||||
my $patcherConfig = $config->Get(var => 'patcherConfig');
|
||||
my $patcherToolsRev = $config->Get(var => 'patcherToolsRev');
|
||||
|
||||
my $versionedUpdateDir = catfile($updateDir, $product . '-' . $version);
|
||||
|
||||
# Create updates area.
|
||||
if (not -d $versionedUpdateDir) {
|
||||
MkdirWithPath(dir => $versionedUpdateDir)
|
||||
or die("Cannot mkdir $versionedUpdateDir: $!");
|
||||
}
|
||||
|
||||
# check out patcher
|
||||
$this->CvsCo(cvsroot => $mozillaCvsroot,
|
||||
checkoutDir => 'patcher',
|
||||
modules => [CvsCatfile('mozilla', 'tools', 'patcher')],
|
||||
tag => $patcherToolsRev,
|
||||
logFile => catfile($logDir, 'updates_patcher-checkout.log'),
|
||||
workDir => $versionedUpdateDir
|
||||
);
|
||||
|
||||
# check out utilities
|
||||
$this->CvsCo(cvsroot => $mozillaCvsroot,
|
||||
checkoutDir => 'MozBuild',
|
||||
modules => [CvsCatfile('mozilla', 'tools', 'release',
|
||||
'MozBuild')],
|
||||
tag => $patcherToolsRev,
|
||||
logFile => catfile($logDir,
|
||||
'updates_patcher-utils-checkout.log'),
|
||||
workDir => catfile($versionedUpdateDir, 'patcher')
|
||||
);
|
||||
|
||||
# this config lives in the public repo since bug 408849 was checked in
|
||||
$this->CvsCo(cvsroot => $mozillaCvsroot,
|
||||
checkoutDir => 'config',
|
||||
modules => [CvsCatfile('mozilla', 'tools', 'patcher-configs',
|
||||
$patcherConfig)],
|
||||
logFile => catfile($logDir,
|
||||
'updates_patcher-config-checkout.log'),
|
||||
workDir => $versionedUpdateDir
|
||||
);
|
||||
|
||||
# build tools
|
||||
my $originalCvsrootEnv = $ENV{'CVSROOT'};
|
||||
$ENV{'CVSROOT'} = $mozillaCvsroot;
|
||||
$this->Shell(
|
||||
cmd => './patcher2.pl',
|
||||
cmdArgs => ['--build-tools', '--tools-revision=' . $patcherToolsRev,
|
||||
'--app=' . $product,
|
||||
'--config=../config/' . $patcherConfig],
|
||||
logFile => catfile($logDir, 'updates_patcher-build-tools.log'),
|
||||
dir => catfile($versionedUpdateDir, 'patcher'),
|
||||
);
|
||||
if ($originalCvsrootEnv) {
|
||||
$ENV{'CVSROOT'} = $originalCvsrootEnv;
|
||||
}
|
||||
|
||||
# download complete MARs
|
||||
$this->Shell(
|
||||
cmd => './patcher2.pl',
|
||||
cmdArgs => ['--download', '--app=' . $product,
|
||||
'--config=../config/' . $patcherConfig],
|
||||
logFile => catfile($logDir, 'updates_patcher-download.log'),
|
||||
dir => catfile($versionedUpdateDir, 'patcher'),
|
||||
);
|
||||
|
||||
# Create partial patches and snippets
|
||||
$this->Shell(
|
||||
cmd => './patcher2.pl',
|
||||
cmdArgs => ['--create-patches', '--app=' . $product,
|
||||
'--config=../config/' . $patcherConfig,
|
||||
'--partial-patchlist-file=patchlist.cfg'],
|
||||
logFile => catfile($logDir, 'updates_patcher-create-patches.log'),
|
||||
dir => catfile($versionedUpdateDir, 'patcher'),
|
||||
timeout => 18000,
|
||||
);
|
||||
|
||||
### quick verification
|
||||
my $fullUpdateDir = catfile($versionedUpdateDir, 'patcher', 'temp',
|
||||
$product, $oldVersion . '-' . $version);
|
||||
$snippetErrors = undef; # evil (??) global to get results from callbacks
|
||||
|
||||
# ensure that there are only test channels in aus2.test dir
|
||||
File::Find::find(\&TestAusCallback, catfile($fullUpdateDir,"aus2.test"));
|
||||
|
||||
# ensure that there are only beta channels in beta dir (if that exists)
|
||||
if (-d catfile($fullUpdateDir, "aus2.beta")) {
|
||||
File::Find::find(\&BetaAusCallback, catfile($fullUpdateDir,"aus2.beta"));
|
||||
File::Find::find(\&ReleaseAusCallback, catfile($fullUpdateDir,"aus2"));
|
||||
}
|
||||
# otherwise allow beta and release in aus2 dir
|
||||
else {
|
||||
File::Find::find(\&ReleaseBetaAusCallback, catfile($fullUpdateDir,"aus2"));
|
||||
}
|
||||
|
||||
if ($snippetErrors) {
|
||||
$snippetErrors =~ s!$fullUpdateDir/!!g;
|
||||
die("Execute: Snippets failed location checks: $snippetErrors\n");
|
||||
}
|
||||
}
|
||||
|
||||
sub Verify {
|
||||
my $this = shift;
|
||||
|
||||
my $config = new Bootstrap::Config();
|
||||
my $logDir = $config->Get(sysvar => 'logDir');
|
||||
my $hgToolsRepo = $config->Get(var => 'hgToolsRepo');
|
||||
my $verifyDir = $config->Get(var => 'verifyDir');
|
||||
my $osname = $config->SystemInfo(var => 'osname');
|
||||
my $product = $config->Get(var => 'product');
|
||||
my $version = $config->GetVersion(longName => 0);
|
||||
my $verifyConfig = $config->Get(sysvar => 'verifyConfig');
|
||||
|
||||
# Create verification area.
|
||||
my $verifyDirVersion = catfile($verifyDir, $product . '-' . $version);
|
||||
MkdirWithPath(dir => $verifyDirVersion)
|
||||
or die("Could not mkdir $verifyDirVersion: $!");
|
||||
|
||||
$this->HgClone(
|
||||
repo => $hgToolsRepo,
|
||||
workDir => $verifyDirVersion
|
||||
);
|
||||
|
||||
my $verifyLog = catfile($logDir, 'updates_verify.log');
|
||||
$this->Shell(
|
||||
cmd => './verify.sh',
|
||||
cmdArgs => ['-c', $verifyConfig],
|
||||
logFile => $verifyLog,
|
||||
dir => catfile($verifyDirVersion, 'tools', 'release', 'updates'),
|
||||
timeout => 36000,
|
||||
);
|
||||
|
||||
$this->CheckLog(
|
||||
log => $verifyLog,
|
||||
notAllowed => '^FAIL',
|
||||
);
|
||||
}
|
||||
|
||||
# locate snippets for which the channel doesn't end in test
|
||||
sub TestAusCallback {
|
||||
my $dir = $File::Find::name;
|
||||
if ( ($dir =~ /\.txt/) and
|
||||
(not $dir =~ /\/\w*test\/(partial|complete)\.txt$/)) {
|
||||
$snippetErrors .= "\nNon-test: $dir";
|
||||
}
|
||||
}
|
||||
|
||||
# locate snippets for which the channel isn't beta
|
||||
sub BetaAusCallback {
|
||||
my $dir = $File::Find::name;
|
||||
if ( ($dir =~ /\.txt/) and
|
||||
(not $dir =~ /\/beta\/(partial|complete)\.txt$/)) {
|
||||
$snippetErrors .= "\nNon-beta: $dir";
|
||||
}
|
||||
}
|
||||
|
||||
# locate snippets for which the channel isn't release
|
||||
sub ReleaseAusCallback {
|
||||
my $dir = $File::Find::name;
|
||||
if ( ($dir =~ /\.txt/) and
|
||||
(not $dir =~ /\/release\/(partial|complete)\.txt$/)) {
|
||||
$snippetErrors .= "\nNon-release: $dir";
|
||||
}
|
||||
}
|
||||
|
||||
# locate snippets for which the channel isn't release or beta
|
||||
sub ReleaseBetaAusCallback {
|
||||
my $dir = $File::Find::name;
|
||||
if ( ($dir =~ /\.txt/) and
|
||||
(not $dir =~ /\/(release|beta)\/(partial|complete)\.txt$/)) {
|
||||
$snippetErrors .= "\nNon-release: $dir";
|
||||
}
|
||||
}
|
||||
|
||||
sub PermissionsAusCallback {
|
||||
my $dir = $File::Find::name;
|
||||
|
||||
if (-f $dir) {
|
||||
chmod(0644, $dir) or die("Couldn't chmod $dir to 644: $!");
|
||||
} elsif (-d $dir) {
|
||||
chmod(0775, $dir) or die("Couldn't chmod $dir to 775: $!");
|
||||
}
|
||||
}
|
||||
|
||||
sub Push {
|
||||
my $this = shift;
|
||||
|
||||
my $config = new Bootstrap::Config();
|
||||
my $logDir = $config->Get(sysvar => 'logDir');
|
||||
my $product = $config->Get(var => 'product');
|
||||
my $version = $config->GetVersion(longName => 0);
|
||||
my $build = $config->Get(var => 'build');
|
||||
my $oldVersion = $config->GetOldVersion(longName => 0);
|
||||
my $stagingUser = $config->Get(var => 'stagingUser');
|
||||
my $stagingServer = $config->Get(var => 'stagingServer');
|
||||
my $ausUser = $config->Get(var => 'ausUser');
|
||||
my $ausServer = $config->Get(var => 'ausServer');
|
||||
my $updateDir = $config->Get(var => 'updateDir');
|
||||
|
||||
my $pushLog = catfile($logDir, 'updates_push.log');
|
||||
my $fullUpdateDir = catfile($updateDir, $product . '-' . $version,
|
||||
'patcher', 'temp', $product,
|
||||
$oldVersion . '-' . $version);
|
||||
my $candidateDir = $config->GetFtpCandidateDir(bitsUnsigned => 0);
|
||||
|
||||
# push partial mar files up to ftp server
|
||||
my $marsDir = catfile('ftp', $product, 'nightly',
|
||||
$version . '-candidates', 'build' . $build) . '/';
|
||||
|
||||
chmod(0644, glob(catfile($fullUpdateDir,$marsDir,"*partial.mar")))
|
||||
or die("Couldn't chmod a partial mar to 644: $!");
|
||||
$this->Shell(
|
||||
cmd => 'rsync',
|
||||
cmdArgs => ['-av', '-e', 'ssh',
|
||||
'--include=*partial.mar',
|
||||
'--exclude=*',
|
||||
$marsDir,
|
||||
$stagingUser . '@' . $stagingServer . ':' . $candidateDir],
|
||||
dir => $fullUpdateDir,
|
||||
logFile => $pushLog,
|
||||
);
|
||||
|
||||
# push update snippets to AUS server
|
||||
my $pushDir = strftime("%Y%m%d", localtime) . '-' . ucfirst($product) .
|
||||
'-' . $version;
|
||||
my $targetPrefix = CvsCatfile('/opt','aus2','snippets','staging',
|
||||
$pushDir);
|
||||
$config->Set(var => 'ausDeliveryDir', value => $targetPrefix);
|
||||
|
||||
my @snippetDirs = glob(catfile($fullUpdateDir, "aus2*"));
|
||||
|
||||
File::Find::find(\&PermissionsAusCallback, @snippetDirs);
|
||||
|
||||
foreach $dir (@snippetDirs) {
|
||||
my $targetDir = $targetPrefix;
|
||||
if ($dir =~ /aus2\.(.*)$/) {
|
||||
$targetDir .= '-' . $1;
|
||||
}
|
||||
|
||||
$this->Shell(
|
||||
cmd => 'rsync',
|
||||
cmdArgs => ['-av',
|
||||
'-e', 'ssh -i ' . catfile($ENV{'HOME'},'.ssh','aus'),
|
||||
$dir . '/',
|
||||
$ausUser . '@' . $ausServer . ':' . $targetDir],
|
||||
logFile => $pushLog,
|
||||
);
|
||||
}
|
||||
|
||||
# Backup test channels
|
||||
$this->Shell(
|
||||
cmd => 'ssh',
|
||||
cmdArgs => ['-i ' . catfile($ENV{'HOME'},'.ssh','aus'),
|
||||
$ausUser . '@' . $ausServer,
|
||||
'/home/cltbld/bin/backupsnip', $pushDir . '-test'],
|
||||
logFile => $pushLog,
|
||||
# the 2.x -> 3.x major update generated a *lot* of snippets
|
||||
# backupsnip now takes significantly more time to run
|
||||
timeout => 7200
|
||||
);
|
||||
# Push test channels live
|
||||
$this->Shell(
|
||||
cmd => 'ssh',
|
||||
cmdArgs => ['-i ' . catfile($ENV{'HOME'},'.ssh','aus'),
|
||||
$ausUser . '@' . $ausServer,
|
||||
'/home/cltbld/bin/pushsnip', $pushDir . '-test'],
|
||||
logFile => $pushLog,
|
||||
);
|
||||
# Wait for timeout on AUS's NFS caching to expire before
|
||||
# attempting to test newly-pushed snippets
|
||||
sleep(360);
|
||||
}
|
||||
|
||||
sub Announce {
|
||||
my $this = shift;
|
||||
|
||||
my $config = new Bootstrap::Config();
|
||||
my $product = $config->Get(var => 'product');
|
||||
my $version = $config->GetVersion(longName => 0);
|
||||
|
||||
$this->SendAnnouncement(
|
||||
subject => "$product $version update step finished",
|
||||
message => "$product $version updates finished. Partial mars were copied to the candidates dir, and the test snippets were pushed live.",
|
||||
);
|
||||
}
|
||||
|
||||
1;
|
||||
@@ -1,344 +0,0 @@
|
||||
#
|
||||
# Bootstrap utility functions.
|
||||
#
|
||||
|
||||
package Bootstrap::Util;
|
||||
|
||||
use File::Temp qw(tempfile tempdir);
|
||||
use File::Spec::Functions;
|
||||
use MozBuild::Util qw(RunShellCommand);
|
||||
use base qw(Exporter);
|
||||
|
||||
our @EXPORT_OK = qw(CvsCatfile CvsTag
|
||||
GetPushRepo
|
||||
GetDiffFileList
|
||||
GetFtpNightlyDir
|
||||
LoadLocaleManifest
|
||||
GetEqualPlatforms
|
||||
GetLocaleManifest
|
||||
GetBouncerPlatforms GetPatcherPlatforms
|
||||
GetBouncerToPatcherPlatformMap
|
||||
GetBuildbotToFTPPlatformMap
|
||||
GetFTPToBuildbotPlatformMap);
|
||||
|
||||
our($DEFAULT_SHELL_TIMEOUT);
|
||||
|
||||
use strict;
|
||||
|
||||
# This maps Bouncer platforms, used in bouncer and the shipped-locales file
|
||||
# to patcher2 platforms used in... patcher2. They're different for some
|
||||
# historical reason, which should be considered a bug.
|
||||
#
|
||||
# This is somewhat incomplete, as Bouncer has the 'osxppc' platform and
|
||||
# patcher2 has the 'unimac' platform, neither of which we need any more
|
||||
# beacuse we don't need to disambiguate between PPC mac and universal binaries
|
||||
# anymore.
|
||||
#
|
||||
# Also, bouncer uses "win", not win32; shipped-locales uses win32. They
|
||||
# couldn't be the same, of course.
|
||||
|
||||
my %PLATFORM_MAP = (# bouncer/shipped-locales platform => patcher2 platform
|
||||
'win32' => 'win32',
|
||||
'linux' => 'linux-i686',
|
||||
'linux64' => 'linux-x86_64',
|
||||
'osx' => 'mac',
|
||||
'osx64' => 'mac64',
|
||||
'osxppc' => 'macppc');
|
||||
|
||||
my %PLATFORM_FTP_MAP = (# buildbot platform => ftp directory
|
||||
'linux' => 'linux-i686',
|
||||
'linux64' => 'linux-x86_64',
|
||||
'macosx' => 'mac',
|
||||
'macosx64' => 'mac64',
|
||||
'win32' => 'win32');
|
||||
|
||||
my %EQUAL_PLATFORMS = ('linux' => ['linux64'], 'osx' => ['osx64']);
|
||||
|
||||
my $DEFAULT_CVSROOT = ':pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot';
|
||||
|
||||
$DEFAULT_SHELL_TIMEOUT = 3600;
|
||||
|
||||
##
|
||||
# Turn an array of directory/filenames into a CVS module path.
|
||||
# ( name comes from File::Spec::catfile() )
|
||||
#
|
||||
# Note that this function does not take any arguments, to make the usage
|
||||
# more like File::Spec::catfile()
|
||||
##
|
||||
sub CvsCatfile {
|
||||
return join('/', @_);
|
||||
}
|
||||
|
||||
sub GetBouncerToPatcherPlatformMap {
|
||||
return %PLATFORM_MAP;
|
||||
}
|
||||
sub GetBuildbotToFTPPlatformMap {
|
||||
return %PLATFORM_FTP_MAP;
|
||||
}
|
||||
|
||||
sub GetBouncerPlatforms {
|
||||
return keys(%PLATFORM_MAP);
|
||||
}
|
||||
|
||||
sub GetEqualPlatforms {
|
||||
my $platform = shift;
|
||||
return $EQUAL_PLATFORMS{$platform} || 0;
|
||||
}
|
||||
|
||||
sub GetFTPToBuildbotPlatformMap {
|
||||
my %ret;
|
||||
while (my ($key, $value) = each %PLATFORM_FTP_MAP){
|
||||
$ret{$value}=$key;
|
||||
}
|
||||
return %ret;
|
||||
}
|
||||
|
||||
##
|
||||
# GetFtpNightlyDir - construct the FTP path for pushing builds & updates to
|
||||
# returns scalar
|
||||
#
|
||||
# no mandatory arguments
|
||||
##
|
||||
|
||||
sub GetFtpNightlyDir {
|
||||
my $config = new Bootstrap::Config();
|
||||
my $product = $config->Get(var => 'product');
|
||||
|
||||
my $nightlyDir = CvsCatfile('/home', 'ftp', 'pub', $product, 'nightly') . '/';
|
||||
return $nightlyDir;
|
||||
}
|
||||
|
||||
sub GetPatcherPlatforms {
|
||||
return values(%PLATFORM_MAP);
|
||||
}
|
||||
|
||||
# Loads and parses the shipped-locales manifest file, so get hash of
|
||||
# locale -> [bouncer] platform mappings; returns success/failure in
|
||||
# reading/parsing the locales file.
|
||||
|
||||
sub LoadLocaleManifest {
|
||||
my %args = @_;
|
||||
|
||||
die "ASSERT: LoadLocaleManifest(): needs a HASH ref" if
|
||||
(not exists($args{'localeHashRef'}) or
|
||||
ref($args{'localeHashRef'}) ne 'HASH');
|
||||
|
||||
my $localeHash = $args{'localeHashRef'};
|
||||
my $manifestFile = $args{'manifest'};
|
||||
|
||||
if (not -e $manifestFile) {
|
||||
die ("ASSERT: Bootstrap::Util::LoadLocaleManifest(): Can't find manifest"
|
||||
. " $manifestFile");
|
||||
}
|
||||
|
||||
open(MANIFEST, "<$manifestFile") or return 0;
|
||||
my @manifestLines = <MANIFEST>;
|
||||
close(MANIFEST);
|
||||
|
||||
my @bouncerPlatforms = GetBouncerPlatforms();
|
||||
@bouncerPlatforms = sort(@bouncerPlatforms);
|
||||
|
||||
foreach my $line (@manifestLines) {
|
||||
# We create an instance variable so if the caller munges the reference
|
||||
# to which a certain locale points, they won't screw up all the other
|
||||
# locales; previously, this was a shared array ref, which is bad.
|
||||
my @bouncerPlatformsInstance = @bouncerPlatforms;
|
||||
|
||||
my @elements = split(/\s+/, $line);
|
||||
# Grab the locale; we do it this way, so we can use the rest of the
|
||||
# array as a platform list, if we need it...
|
||||
my $locale = shift(@elements);
|
||||
@elements = sort(@elements);
|
||||
|
||||
# We don't add a $ on the end, because of things like ja-JP-mac
|
||||
if ($locale !~ /^[a-z]{2}(\-[A-Z]{2})?/) {
|
||||
die "ASSERT: invalid locale in manifest file: $locale";
|
||||
}
|
||||
|
||||
# So this is kinda weird; if the locales are followed by a platform,
|
||||
# then they don't exist for all the platforms; if they're all by their
|
||||
# lonesome, then they exist for all platforms. So, since we shifted off
|
||||
# the locale above, if there's anything left in the array, it's the
|
||||
# platforms that are valid for this locale; if there isn't, then that
|
||||
# platform is valid for all locales.
|
||||
$localeHash->{$locale} = scalar(@elements) ? \@elements :
|
||||
\@bouncerPlatformsInstance;
|
||||
|
||||
foreach my $platform (@{$localeHash->{$locale}}) {
|
||||
die "ASSERT: invalid platform: $platform" if
|
||||
(not grep($platform eq $_, @bouncerPlatforms));
|
||||
}
|
||||
}
|
||||
|
||||
# Add en-US, which isn't in shipped-locales, because it's assumed that
|
||||
# we always need en-US, for all platforms, to ship.
|
||||
$localeHash->{'en-US'} = \@bouncerPlatforms;
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
sub GetLocaleManifest {
|
||||
my %args = @_;
|
||||
|
||||
my $mozillaCvsroot = $args{'cvsroot'} || $DEFAULT_CVSROOT;
|
||||
# XXX - The cruel joke is that this default value won't work; there is
|
||||
# no shipped-locales file on the trunk... yet...
|
||||
my $releaseTag = $args{'tag'} || 'HEAD';
|
||||
my $appName = $args{'app'};
|
||||
|
||||
my $localeManifest = {};
|
||||
|
||||
# Remove unshipped files/locales and set proper mode on dirs; start
|
||||
# by checking out the shipped-locales file
|
||||
$ENV{'CVS_RSH'} = 'ssh';
|
||||
|
||||
my ($shippedLocalesTmpHandle, $shippedLocalesTmpFile) = tempfile();
|
||||
$shippedLocalesTmpHandle->close();
|
||||
|
||||
# We dump stderr here so we can ignore having to parse all of the
|
||||
# RCS info that cvs dumps when you co with -p
|
||||
my $rv = RunShellCommand(command => 'cvs',
|
||||
args => ['-d', $mozillaCvsroot,
|
||||
'co', '-p',
|
||||
'-r', $releaseTag,
|
||||
CvsCatfile('mozilla', $appName,
|
||||
'locales', 'shipped-locales')],
|
||||
redirectStderr => 0,
|
||||
logfile => $shippedLocalesTmpFile);
|
||||
|
||||
if ($rv->{'exitValue'} != 0) {
|
||||
die "ASSERT: GetLocaleManifest(): shipped-locale checkout failed\n";
|
||||
}
|
||||
|
||||
if (not LoadLocaleManifest(localeHashRef => $localeManifest,
|
||||
manifest => $shippedLocalesTmpFile)) {
|
||||
die "Bootstrap::Util: GetLocaleManifest() failed to load manifest\n";
|
||||
}
|
||||
|
||||
return $localeManifest;
|
||||
}
|
||||
|
||||
sub CvsTag {
|
||||
my %args = @_;
|
||||
|
||||
# All the required args first, followed by the optional ones...
|
||||
die "ASSERT: Bootstrap::Step::Tag::CvsTag(): null tagName" if
|
||||
(!exists($args{'tagName'}));
|
||||
my $tagName = $args{'tagName'};
|
||||
|
||||
die "ASSERT: Bootstrap::Step::Tag::CvsTag(): null cvsDir" if
|
||||
(!exists($args{'cvsDir'}));
|
||||
my $cvsDir = $args{'cvsDir'};
|
||||
|
||||
die "ASSERT: Bootstrap::Step::Tag::CvsTag(): invalid files data" if
|
||||
(exists($args{'files'}) && ref($args{'files'}) ne 'ARRAY');
|
||||
|
||||
die "ASSERT: Bootstrap::Step::Tag::CvsTag(): null logFile"
|
||||
if (!exists($args{'logFile'}));
|
||||
my $logFile = $args{'logFile'};
|
||||
|
||||
my $branch = exists($args{'branch'}) ? $args{'branch'} : 0;
|
||||
my $files = exists($args{'files'}) ? $args{'files'} : [];
|
||||
my $force = exists($args{'force'}) ? $args{'force'} : 0;
|
||||
my $timeout = exists($args{'timeout'}) ? $args{'timeout'} :
|
||||
$DEFAULT_SHELL_TIMEOUT;
|
||||
|
||||
# only force or branch specific files, not the whole tree
|
||||
if ($force && scalar(@{$files}) <= 0) {
|
||||
die("ASSERT: Bootstrap::Util::CvsTag(): Cannot specify force without files");
|
||||
} elsif ($branch && scalar(@{$files}) <= 0) {
|
||||
die("ASSERT: Bootstrap::UtilCvsTag(): Cannot specify branch without files");
|
||||
} elsif ($branch && $force) {
|
||||
die("ASSERT: Bootstrap::UtilCvsTag(): Cannot specify both branch and force");
|
||||
}
|
||||
|
||||
my @cmdArgs;
|
||||
push(@cmdArgs, 'tag');
|
||||
push(@cmdArgs, '-F') if ($force);
|
||||
push(@cmdArgs, '-b') if ($branch);
|
||||
push(@cmdArgs, $tagName);
|
||||
push(@cmdArgs, @{$files}) if (scalar(@{$files}) > 0);
|
||||
|
||||
# We can't use Bootstrap::Step logs since we are in Util, oh well...
|
||||
print 'log: Running "cvs tag" as follows in' . $cvsDir . ":\n";
|
||||
print 'log: cvs ' . join(' ', @cmdArgs) . "\n";
|
||||
print 'log: Logging output to: ' . $logFile . "\n";
|
||||
print 'log: Timeout: ' . $timeout . "\n";
|
||||
|
||||
my %cvsTagArgs = (command => 'cvs',
|
||||
args => \@cmdArgs,
|
||||
dir => $cvsDir,
|
||||
logfile => $logFile);
|
||||
|
||||
$cvsTagArgs{'timeout'} = $timeout if (defined($timeout));
|
||||
$cvsTagArgs{'output'} = $args{'output'} if (exists($args{'output'}));
|
||||
|
||||
return RunShellCommand(%cvsTagArgs);
|
||||
}
|
||||
|
||||
sub GetPushRepo {
|
||||
my %args = @_;
|
||||
my ($repo, $pushRepo);
|
||||
|
||||
# Required arguments
|
||||
die "ASSERT: Bootstrap::Util::GetPushRepo(): null repo" if
|
||||
(!exists($args{'repo'}));
|
||||
$pushRepo = $repo = $args{'repo'};
|
||||
|
||||
$pushRepo =~ s/^https?/ssh/;
|
||||
if ($pushRepo !~ m/^ssh/) {
|
||||
die "ASSERT: Bootstrap::Util::GetPushRepo(): could not generate " .
|
||||
"push repo for: $repo";
|
||||
}
|
||||
return $pushRepo;
|
||||
}
|
||||
|
||||
sub GetDiffFileList {
|
||||
my %args = @_;
|
||||
|
||||
foreach my $requiredArg (qw(cvsDir prevTag newTag)) {
|
||||
if (!exists($args{$requiredArg})) {
|
||||
die "ASSERT: MozBuild::Util::GetDiffFileList(): null arg: " .
|
||||
$requiredArg;
|
||||
}
|
||||
}
|
||||
|
||||
my $cvsDir = $args{'cvsDir'};
|
||||
my $firstTag = $args{'prevTag'};
|
||||
my $newTag = $args{'newTag'};
|
||||
|
||||
my $rv = RunShellCommand(command => 'cvs',
|
||||
args => ['-q', 'diff', '-uN',
|
||||
'-r', $firstTag,
|
||||
'-r', $newTag],
|
||||
dir => $cvsDir,
|
||||
timeout => 3600);
|
||||
|
||||
# Gah. So, the shell return value of "cvs diff" is dependent on whether or
|
||||
# not there were diffs, NOT whether or not the command succeeded. (Thanks,
|
||||
# CVS!) So, we can't really check exitValue here, since it could be 1 or
|
||||
# 0, depending on whether or not there were diffs (and both cases are valid
|
||||
# for this function). Maybe if there's an error it returns a -1? Or 2?
|
||||
# Who knows.
|
||||
#
|
||||
# So basically, we check that it's not 1 or 0, which... isn't a great test.
|
||||
#
|
||||
# TODO - check to see if timedOut, dumpedCore, or sigNum are set.
|
||||
if ($rv->{'exitValue'} != 1 && $rv->{'exitValue'} != 0) {
|
||||
die("ASSERT: MozBuild::Util::GetDiffFileList(): cvs diff returned " .
|
||||
$rv->{'exitValue'});
|
||||
}
|
||||
|
||||
my @differentFiles = ();
|
||||
|
||||
foreach my $line (split(/\n/, $rv->{'output'})) {
|
||||
if ($line =~ /^Index:\s(.+)$/) {
|
||||
push(@differentFiles, $1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return \@differentFiles;
|
||||
}
|
||||
|
||||
1;
|
||||
@@ -1,94 +0,0 @@
|
||||
PRODUCT = $(shell grep "^product[ \t]" bootstrap.cfg | sed -e 's/[^=]*= *//')
|
||||
VERSION = $(shell grep "^version[ \t]" bootstrap.cfg | sed -e 's/[^=]*= *//')
|
||||
OLD_VERSION = $(shell grep "^oldVersion[ \t]" bootstrap.cfg | sed -e 's/[^=]*= *//')
|
||||
OLD_BUILD = $(shell grep "^oldBuild[ \t]" bootstrap.cfg | sed -e 's/[^=]*= *//')
|
||||
PRODUCT_TAG = $(shell grep "^productTag[ \t]" bootstrap.cfg | sed -e 's/[^=]*= *//')
|
||||
# extract the numeric build value from the config file
|
||||
PRODUCT_BUILD = $(shell grep "^build[ \t]" bootstrap.cfg | sed -e 's/[^0-9]*\([0-9]*\).*/\1/')
|
||||
|
||||
test:
|
||||
for f in release t/test.pl `find . -name "*.pm"`; do \
|
||||
perl -c $$f || exit $?; done
|
||||
if [ -f t/test.log ]; then rm t/test.log; fi
|
||||
if [ ! -f bootstrap.cfg ]; then cp bootstrap.cfg.example bootstrap.cfg; fi
|
||||
cp t/tinder-config.pl.orig t/tinder-config.pl
|
||||
./t/test.pl
|
||||
|
||||
stage:
|
||||
# basic environment
|
||||
mkdir -p /builds/config
|
||||
mkdir -p /builds/tags
|
||||
mkdir -p /builds/updates/
|
||||
mkdir -p /builds/verify/
|
||||
mkdir -p /builds/logs/
|
||||
mkdir -p /data/symbols/
|
||||
# fake key
|
||||
mkdir -p /home/ftp/pub/${PRODUCT}/releases/1.5/
|
||||
touch /home/ftp/pub/${PRODUCT}/releases/1.5/KEY
|
||||
# ftp
|
||||
mkdir -p /home/ftp/pub/${PRODUCT}/nightly
|
||||
chown -R cltbld:${PRODUCT} /home/ftp/pub/${PRODUCT}
|
||||
chmod -R g+rwx /home/ftp/pub/${PRODUCT}
|
||||
chmod -R o+rx /home/ftp/pub
|
||||
# staging environment
|
||||
mkdir -p /data/cltbld/${PRODUCT}-${VERSION}/batch1/stage
|
||||
# download old builds, for l10n verify
|
||||
cd /data && wget -nv --cut-dirs=3 -np -r ftp://ftp.mozilla.org/pub/mozilla.org/${PRODUCT}/nightly/${OLD_VERSION}-candidates/build${OLD_BUILD}/* && mv ftp.mozilla.org/nightly/* /home/ftp/pub/${PRODUCT}/nightly/ && rm -rfv ftp.mozilla.org
|
||||
# download old release, for update verify
|
||||
cd /data && wget -nv --cut-dirs=3 -np -r -e robots=off http://stage.mozilla.org/pub/mozilla.org/${PRODUCT}/releases/${OLD_VERSION}/ && mv stage.mozilla.org/releases/* /home/ftp/pub/${PRODUCT}/releases/ && rm -rfv stage.mozilla.org
|
||||
|
||||
|
||||
cvsmirror: cvsmirror_mofo cvsmirror_main
|
||||
|
||||
cvsmirror_main:
|
||||
rsync -a --delete-after --exclude=CVSROOT/config --exclude=CVSROOT/loginfo cvs-mirror.mozilla.org::mozilla/ /builds/cvsmirror.clean/cvsroot/
|
||||
rsync -a --delete-after cvs-mirror.mozilla.org::l10n/ /builds/cvsmirror.clean/l10n/
|
||||
chgrp -R cvs /builds/cvsmirror.clean/cvsroot /builds/cvsmirror.clean/l10n
|
||||
chmod -R g+rw /builds/cvsmirror.clean/cvsroot /builds/cvsmirror.clean/l10n
|
||||
cvs -d /builds/cvsmirror.clean/cvsroot rtag -d ${PRODUCT_TAG}_RELEASE mozilla
|
||||
cvs -d /builds/cvsmirror.clean/cvsroot rtag -d ${PRODUCT_TAG}_RELEASE_l10n mozilla/tools/tinderbox-configs/
|
||||
cvs -d /builds/cvsmirror.clean/l10n rtag -d ${PRODUCT_TAG}_RELEASE l10n
|
||||
for ((build=1; build <= ${PRODUCT_BUILD}; build++)); do \
|
||||
cvs -d /builds/cvsmirror.clean/cvsroot rtag -d ${PRODUCT_TAG}_BUILD$$build mozilla;\
|
||||
cvs -d /builds/cvsmirror.clean/cvsroot rtag -d ${PRODUCT_TAG}_BUILD$$build_l10n mozilla/tools/tinderbox-configs/;\
|
||||
cvs -d /builds/cvsmirror.clean/l10n rtag -d ${PRODUCT_TAG}_BUILD$$build l10n;\
|
||||
done
|
||||
|
||||
cvsmirror_mofo:
|
||||
mkdir -p /builds/cvsmirror.clean/tmp/mofo
|
||||
mkdir -p /builds/cvsmirror.clean/mofo
|
||||
cvs -d /builds/cvsmirror.clean/mofo init
|
||||
cd /builds/cvsmirror.clean/tmp/mofo && cvs -d cltbld@cvs.mozilla.org:/mofo export -r MOZILLA_1_8_BRANCH talkback
|
||||
cd /builds/cvsmirror.clean/tmp/mofo && cvs -d cltbld@cvs.mozilla.org:/mofo export -r HEAD release
|
||||
cd /builds/cvsmirror.clean/tmp/mofo/release && cvs -d /builds/cvsmirror.clean/mofo import -d -m "import CVS snapshot" release MOZILLA_1_8_BRANCH_release R0_1
|
||||
cd /builds/cvsmirror.clean/tmp/mofo/talkback && cvs -d /builds/cvsmirror.clean/mofo import -d -m "import CVS snapshot" talkback MOZILLA_1_8_BRANCH R0_1
|
||||
rm -rf /builds/cvsmirror.clean/tmp/mofo
|
||||
chgrp -R cvs /builds/cvsmirror.clean/mofo
|
||||
chmod g+rwx /builds/cvsmirror.clean/mofo
|
||||
chmod -R g+rw /builds/cvsmirror.clean/mofo
|
||||
|
||||
clean_stage: clean_logs
|
||||
rm -rf /builds/config/*
|
||||
rm -rf /builds/tags/*
|
||||
rm -rf /builds/source/*
|
||||
rm -rf /builds/release/logs/*
|
||||
rm -rf /builds/updates/*
|
||||
rm -rf /builds/verify/*
|
||||
rm -rf /builds/symbols/*
|
||||
rm -rf /data/cltbld/${PRODUCT}-*/
|
||||
rm -rf /data/symbols/*
|
||||
rm -rf /home/ftp/pub/${PRODUCT}/*
|
||||
|
||||
clean_cvsmirror: clean_cvsmirror_main clean_cvsmirror_mofo
|
||||
rm -rf /builds/cvsmirror.clean/*
|
||||
|
||||
clean_cvsmirror_main:
|
||||
rm -rf /builds/cvsmirror.clean/cvsroot/*
|
||||
rm -rf /builds/cvsmirror.clean/l10n/*
|
||||
|
||||
clean_cvsmirror_mofo:
|
||||
rm -rf /builds/cvsmirror.clean/mofo/*
|
||||
|
||||
clean_logs:
|
||||
rm -rf /builds/logs/*
|
||||
|
||||
@@ -1,116 +0,0 @@
|
||||
##
|
||||
# TinderLogParse - A tinderbox log parser
|
||||
##
|
||||
|
||||
package MozBuild::TinderLogParse;
|
||||
|
||||
sub new {
|
||||
my $class = shift;
|
||||
my %args = @_;
|
||||
|
||||
my $logFile = $args{'logFile'};
|
||||
if (! defined($logFile)) {
|
||||
die("ASSERT: TinderLogParse::new logFile is a required argument");
|
||||
}
|
||||
|
||||
my $this = { logFile => $logFile };
|
||||
bless($this, $class);
|
||||
return $this;
|
||||
}
|
||||
|
||||
##
|
||||
# GetBuildID - attempts to find build ID in a tinderbox log file
|
||||
#
|
||||
# Searches for a string of the form:
|
||||
# buildid: 2007030311
|
||||
# Only the buildID, '2007030311', is to be returned.
|
||||
#
|
||||
##
|
||||
|
||||
sub GetBuildID {
|
||||
my $this = shift;
|
||||
my %args = @_;
|
||||
|
||||
my $log = $this->GetLogFileName();
|
||||
|
||||
my $buildID = undef;
|
||||
my $searchString = "buildid: ";
|
||||
|
||||
open (FILE, "< $log") or die("Cannot open file $log: $!");
|
||||
while (<FILE>) {
|
||||
if ($_ =~ /$searchString/) {
|
||||
$buildID = $_;
|
||||
|
||||
# remove search string
|
||||
$buildID =~ s/$searchString//;
|
||||
|
||||
# remove trailing slash
|
||||
$buildID =~ s/\.$//;
|
||||
last;
|
||||
}
|
||||
}
|
||||
|
||||
close FILE or die("Cannot close file $log: $!");
|
||||
|
||||
if (! defined($buildID)) {
|
||||
return undef;
|
||||
}
|
||||
if (! $buildID =~ /^\d+$/) {
|
||||
die("ASSERT: Build: build ID is not numerical: $buildID")
|
||||
}
|
||||
|
||||
chomp($buildID);
|
||||
return $buildID;
|
||||
}
|
||||
|
||||
##
|
||||
# GetPushDir - attempts to find the directory Tinderbox pushed to build to
|
||||
#
|
||||
# Searches for a string of the form:
|
||||
# Linux Firefox Build available at:
|
||||
# localhost/2007-04-07-18-firefox2.0.0.4/
|
||||
# Matches on "Build available at:" and returns the next line.
|
||||
##
|
||||
|
||||
sub GetPushDir {
|
||||
my $this = shift;
|
||||
my %args = @_;
|
||||
|
||||
my $log = $this->GetLogFileName();
|
||||
|
||||
my $found = 0;
|
||||
my $pushDir = undef;
|
||||
my $searchString = "Build available at:";
|
||||
|
||||
open (FILE, "< $log") or die("Cannot open file $log: $!");
|
||||
while (<FILE>) {
|
||||
if ($found) {
|
||||
$pushDir = $_;
|
||||
last;
|
||||
}
|
||||
if ($_ =~ /$searchString/) {
|
||||
$found = 1;
|
||||
}
|
||||
}
|
||||
|
||||
close FILE or die("Cannot close file $log: $!");
|
||||
|
||||
if (! defined($pushDir)) {
|
||||
return undef;
|
||||
}
|
||||
|
||||
chomp($pushDir);
|
||||
# remove empty space at end of URL
|
||||
$pushDir =~ s/\s+$//;
|
||||
|
||||
return $pushDir;
|
||||
}
|
||||
|
||||
sub GetLogFileName {
|
||||
my $this = shift;
|
||||
my %args = @_;
|
||||
|
||||
return $this->{'logFile'};
|
||||
}
|
||||
|
||||
1;
|
||||
@@ -1,628 +0,0 @@
|
||||
package MozBuild::Util;
|
||||
|
||||
use strict;
|
||||
|
||||
use File::Path;
|
||||
use IO::Handle;
|
||||
use IO::Select;
|
||||
use IPC::Open3;
|
||||
use POSIX qw(:sys_wait_h);
|
||||
use File::Basename qw(fileparse);
|
||||
use File::Copy qw(move);
|
||||
use File::Temp qw(tempfile);
|
||||
use File::Spec::Functions;
|
||||
use Cwd;
|
||||
|
||||
use base qw(Exporter);
|
||||
|
||||
our @EXPORT_OK = qw(RunShellCommand MkdirWithPath HashFile DownloadFile Email
|
||||
UnpackBuild GetBuildIDFromFTP);
|
||||
|
||||
my $DEFAULT_EXEC_TIMEOUT = 600;
|
||||
my $EXEC_IO_READINCR = 1000;
|
||||
my $EXEC_REAP_TIMEOUT = 10;
|
||||
|
||||
# RunShellCommand is a safe, performant way that handles all the gotchas of
|
||||
# spawning a simple shell command. It's meant to replace backticks and open()s,
|
||||
# while providing flexibility to handle stdout and stderr differently, provide
|
||||
# timeouts to stop runaway programs, and provide easy-to-obtain information
|
||||
# about return values, signals, output, and the like.
|
||||
#
|
||||
# Arguments:
|
||||
# command - string: the command to run
|
||||
# args - optional array ref: list of arguments to an array
|
||||
# logfile - optional string: logfile to copy output to
|
||||
# timeout - optional int: timeout value, in seconds, to wait for a command;
|
||||
# defaults to ten minutes; set to 0 for no timeout
|
||||
# redirectStderr - bool, default true: redirect child's stderr onto stdout
|
||||
# stream?
|
||||
# appendLogfile - bool, default true: append to the logfile (as opposed to
|
||||
# overwriting it?)
|
||||
# printOutputImmedaitely - bool, default false: print the output here to
|
||||
# whatever is currently defined as *STDOUT?
|
||||
# background - bool, default false: spawn a command and return all the info
|
||||
# the caller needs to handle the program; assumes the caller takes
|
||||
# complete responsibility for waitpid(), handling of the stdout/stderr
|
||||
# IO::Handles, etc.
|
||||
#
|
||||
|
||||
sub RunShellCommand {
|
||||
my %args = @_;
|
||||
|
||||
my $shellCommand = $args{'command'};
|
||||
die('ASSERT: RunShellCommand(): Empty command.')
|
||||
if (not(defined($shellCommand)) || $shellCommand =~ /^\s+$/);
|
||||
my $commandArgs = $args{'args'};
|
||||
die('ASSERT: RunShellCommand(): commandArgs not an array ref.')
|
||||
if (defined($commandArgs) && ref($commandArgs) ne 'ARRAY');
|
||||
|
||||
my $logfile = $args{'logfile'};
|
||||
|
||||
# Optional
|
||||
my $timeout = exists($args{'timeout'}) ?
|
||||
int($args{'timeout'}) : $DEFAULT_EXEC_TIMEOUT;
|
||||
my $redirectStderr = exists($args{'redirectStderr'}) ?
|
||||
$args{'redirectStderr'} : 1;
|
||||
my $appendLogfile = exists($args{'appendLog'}) ? $args{'appendLog'} : 1;
|
||||
my $printOutputImmediately = exists($args{'output'}) ? $args{'output'} : 0;
|
||||
my $background = exists($args{'bg'}) ? $args{'bg'} : 0;
|
||||
my $changeToDir = exists($args{'dir'}) ? $args{'dir'} : undef;
|
||||
|
||||
# This is a compatibility check for the old calling convention;
|
||||
if ($shellCommand =~ /\s/) {
|
||||
$shellCommand =~ s/^\s+//;
|
||||
$shellCommand =~ s/\s+$//;
|
||||
|
||||
die("ASSERT: old RunShellCommand() calling convention detected\n")
|
||||
if ($shellCommand =~ /\s+/);
|
||||
}
|
||||
|
||||
# Glob the command together to check for 2>&1 constructs...
|
||||
my $entireCommand = $shellCommand .
|
||||
(defined($commandArgs) ? join (' ', @{$commandArgs}) : '');
|
||||
|
||||
# If we see 2>&1 in the command, set redirectStderr (overriding the option
|
||||
# itself, and remove the construct from the command and arguments.
|
||||
if ($entireCommand =~ /2\>\&1/) {
|
||||
$redirectStderr = 1;
|
||||
$shellCommand =~ s/2\>\&1//g;
|
||||
if (defined($commandArgs)) {
|
||||
for (my $i = 0; $i < scalar(@{$commandArgs}); $i++) {
|
||||
$commandArgs->[$i] =~ s/2\>\&1//g;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
local $_;
|
||||
|
||||
chomp($shellCommand);
|
||||
|
||||
my $cwd = getcwd();
|
||||
my $exitValue = undef;
|
||||
my $signalNum = undef;
|
||||
my $sigName = undef;
|
||||
my $dumpedCore = undef;
|
||||
my $childEndedTime = undef;
|
||||
my $timedOut = 0;
|
||||
my $output = '';
|
||||
my $childPid = 0;
|
||||
my $childStartedTime = 0;
|
||||
my $childReaped = 0;
|
||||
my $prevStdoutBufferingSetting = 0;
|
||||
local *LOGFILE;
|
||||
|
||||
my $original_path = $ENV{'PATH'};
|
||||
if ($args{'prependToPath'} or $args{'appendToPath'}) {
|
||||
$ENV{'PATH'} = AugmentPath(%args);
|
||||
}
|
||||
|
||||
if ($printOutputImmediately) {
|
||||
# We Only end up doing this if it's requested that we're going to print
|
||||
# output immediately. Additionally, we can't call autoflush() on STDOUT
|
||||
# here, because doing so automatically sets it to on (gee, thanks);
|
||||
# $| is the only way to get the value.
|
||||
my $prevFd = select(STDOUT);
|
||||
$prevStdoutBufferingSetting = $|;
|
||||
select($prevFd);
|
||||
STDOUT->autoflush(1);
|
||||
}
|
||||
|
||||
if (defined($changeToDir)) {
|
||||
chdir($changeToDir) or die("RunShellCommand(): failed to chdir() to "
|
||||
. "$changeToDir\n");
|
||||
}
|
||||
|
||||
eval {
|
||||
local $SIG{'ALRM'} = sub { die("alarm\n") };
|
||||
local $SIG{'PIPE'} = sub { die("pipe\n") };
|
||||
|
||||
my @execCommand = ($shellCommand);
|
||||
push(@execCommand, @{$commandArgs}) if (defined($commandArgs) &&
|
||||
scalar(@{$commandArgs} > 0));
|
||||
|
||||
my $childIn = new IO::Handle();
|
||||
my $childOut = new IO::Handle();
|
||||
my $childErr = new IO::Handle();
|
||||
|
||||
alarm($timeout);
|
||||
$childStartedTime = time();
|
||||
|
||||
$childPid = open3($childIn, $childOut, $childErr, @execCommand);
|
||||
$childIn->close();
|
||||
|
||||
if ($args{'background'}) {
|
||||
alarm(0);
|
||||
|
||||
# Restore external state
|
||||
chdir($cwd) if (defined($changeToDir));
|
||||
if ($printOutputImmediately) {
|
||||
my $prevFd = select(STDOUT);
|
||||
$| = $prevStdoutBufferingSetting;
|
||||
select($prevFd);
|
||||
}
|
||||
|
||||
return { startTime => $childStartedTime,
|
||||
endTime => undef,
|
||||
timedOut => $timedOut,
|
||||
exitValue => $exitValue,
|
||||
sigNum => $signalNum,
|
||||
output => undef,
|
||||
dumpedCore => $dumpedCore,
|
||||
pid => $childPid,
|
||||
stdout => $childOut,
|
||||
stderr => $childErr };
|
||||
}
|
||||
|
||||
if (defined($logfile)) {
|
||||
my $openArg = $appendLogfile ? '>>' : '>';
|
||||
open(LOGFILE, $openArg . $logfile) or
|
||||
die('Could not ' . $appendLogfile ? 'append' : 'open' .
|
||||
" logfile $logfile: $!");
|
||||
LOGFILE->autoflush(1);
|
||||
}
|
||||
|
||||
my $childSelect = new IO::Select();
|
||||
$childSelect->add($childErr);
|
||||
$childSelect->add($childOut);
|
||||
|
||||
# Should be safe to call can_read() in blocking mode, since,
|
||||
# IF NOTHING ELSE, the alarm() we set will catch a program that
|
||||
# fails to finish executing within the timeout period.
|
||||
|
||||
while (my @ready = $childSelect->can_read()) {
|
||||
foreach my $fh (@ready) {
|
||||
my $line = undef;
|
||||
my $rv = $fh->sysread($line, $EXEC_IO_READINCR);
|
||||
|
||||
# Check for read()ing nothing, and getting errors...
|
||||
if (not defined($rv)) {
|
||||
warn "sysread() failed with: $!\n";
|
||||
next;
|
||||
}
|
||||
|
||||
# If we didn't get anything from the read() and the child is
|
||||
# dead, we've probably exhausted the buffer, and can stop
|
||||
# trying...
|
||||
if (0 == $rv) {
|
||||
$childSelect->remove($fh) if ($childReaped);
|
||||
next;
|
||||
}
|
||||
|
||||
# This check is down here instead of up above because if we're
|
||||
# throwing away stderr, we want to empty out the buffer, so
|
||||
# the pipe isn't constantly readable. So, sysread() stderr,
|
||||
# alas, only to throw it away.
|
||||
next if (not($redirectStderr) && ($fh == $childErr));
|
||||
|
||||
$output .= $line;
|
||||
print STDOUT $line if ($printOutputImmediately);
|
||||
print LOGFILE $line if (defined($logfile));
|
||||
}
|
||||
|
||||
if (!$childReaped && (waitpid($childPid, WNOHANG) > 0)) {
|
||||
alarm(0);
|
||||
$childEndedTime = time();
|
||||
$exitValue = WEXITSTATUS($?);
|
||||
$signalNum = WIFSIGNALED($?) && WTERMSIG($?);
|
||||
$dumpedCore = WIFSIGNALED($?) && ($? & 128);
|
||||
$childReaped = 1;
|
||||
}
|
||||
}
|
||||
|
||||
die('ASSERT: RunShellCommand(): stdout handle not empty')
|
||||
if ($childOut->sysread(undef, $EXEC_IO_READINCR) != 0);
|
||||
die('ASSERT: RunShellCommand(): stderr handle not empty')
|
||||
if ($childErr->sysread(undef, $EXEC_IO_READINCR) != 0);
|
||||
};
|
||||
|
||||
if (defined($logfile)) {
|
||||
close(LOGFILE) or die("Could not close logfile $logfile: $!");
|
||||
}
|
||||
|
||||
if ($@) {
|
||||
if ($@ eq "alarm\n") {
|
||||
$timedOut = 1;
|
||||
if ($childReaped) {
|
||||
die('ASSERT: RunShellCommand(): timed out, but child already '.
|
||||
'reaped?');
|
||||
}
|
||||
|
||||
if (kill('KILL', $childPid) != 1) {
|
||||
warn("SIGKILL to timed-out child $childPid failed: $!\n");
|
||||
}
|
||||
|
||||
# Processes get 10 seconds to obey.
|
||||
eval {
|
||||
local $SIG{'ALRM'} = sub { die("alarm\n") };
|
||||
alarm($EXEC_REAP_TIMEOUT);
|
||||
my $waitRv = waitpid($childPid, 0);
|
||||
alarm(0);
|
||||
# Don't fill in these values if they're bogus.
|
||||
if ($waitRv > 0) {
|
||||
$exitValue = WEXITSTATUS($?);
|
||||
$signalNum = WIFSIGNALED($?) && WTERMSIG($?);
|
||||
$dumpedCore = WIFSIGNALED($?) && ($? & 128);
|
||||
}
|
||||
};
|
||||
} else {
|
||||
warn "Error running $shellCommand: $@\n";
|
||||
$output = $@;
|
||||
}
|
||||
}
|
||||
|
||||
# Restore path (if necessary)
|
||||
if ($ENV{'PATH'} ne $original_path) {
|
||||
$ENV{'PATH'} = $original_path;
|
||||
}
|
||||
|
||||
# Restore external state
|
||||
chdir($cwd) if (defined($changeToDir));
|
||||
if ($printOutputImmediately) {
|
||||
my $prevFd = select(STDOUT);
|
||||
$| = $prevStdoutBufferingSetting;
|
||||
select($prevFd);
|
||||
}
|
||||
|
||||
return { startTime => $childStartedTime,
|
||||
endTime => $childEndedTime,
|
||||
timedOut => $timedOut,
|
||||
exitValue => $exitValue,
|
||||
sigNum => $signalNum,
|
||||
output => $output,
|
||||
dumpedCore => $dumpedCore
|
||||
};
|
||||
}
|
||||
|
||||
## Allows the path to be (temporarily) augmented on either end. It's expected
|
||||
## that the caller will keep track of the original path if it needs to be
|
||||
## reverted.
|
||||
##
|
||||
## NOTE: we don't actually set the path here, just return the augmented path
|
||||
## string for use by the caller.
|
||||
|
||||
sub AugmentPath {
|
||||
my %args = @_;
|
||||
|
||||
my $prependToPath = $args{'prependToPath'};
|
||||
my $appendToPath = $args{'appendToPath'};
|
||||
|
||||
my $current_path = $ENV{'PATH'};
|
||||
if ($prependToPath and $prependToPath ne '') {
|
||||
if ($current_path and $current_path ne '') {
|
||||
$current_path = $prependToPath . ":" . $current_path;
|
||||
} else {
|
||||
$current_path = $prependToPath;
|
||||
}
|
||||
}
|
||||
if ($appendToPath and $appendToPath ne '') {
|
||||
if ($current_path and $current_path ne '') {
|
||||
$current_path .= ":" . $appendToPath;
|
||||
} else {
|
||||
$current_path = $appendToPath;
|
||||
}
|
||||
}
|
||||
return $current_path;
|
||||
}
|
||||
|
||||
## This is a wrapper function to get easy true/false return values from a
|
||||
## mkpath()-like function. mkpath() *actually* returns the list of directories
|
||||
## it created in the pursuit of your request, and keeps its actual success
|
||||
## status in $@.
|
||||
|
||||
sub MkdirWithPath {
|
||||
my %args = @_;
|
||||
|
||||
my $dirToCreate = $args{'dir'};
|
||||
my $printProgress = $args{'printProgress'};
|
||||
my $dirMask = undef;
|
||||
|
||||
# Renamed this argument, since "mask" makes more sense; it takes
|
||||
# precedence over the older argument name.
|
||||
if (exists($args{'mask'})) {
|
||||
$dirMask = $args{'mask'};
|
||||
} elsif (exists($args{'dirMask'})) {
|
||||
$dirMask = $args{'dirMask'};
|
||||
}
|
||||
|
||||
die("ASSERT: MkdirWithPath() needs an arg") if not defined($dirToCreate);
|
||||
|
||||
## Defaults based on what mkpath does...
|
||||
$printProgress = defined($printProgress) ? $printProgress : 0;
|
||||
$dirMask = defined($dirMask) ? $dirMask : 0777;
|
||||
|
||||
eval { mkpath($dirToCreate, $printProgress, $dirMask) };
|
||||
return ($@ eq '');
|
||||
}
|
||||
|
||||
sub HashFile {
|
||||
my %args = @_;
|
||||
die "ASSERT: HashFile(): null file\n" if (not defined($args{'file'}));
|
||||
|
||||
my $fileToHash = $args{'file'};
|
||||
my $hashFunction = lc($args{'type'}) || 'sha512';
|
||||
my $dumpOutput = $args{'output'} || 0;
|
||||
my $ignoreErrors = $args{'ignoreErrors'} || 0;
|
||||
|
||||
die 'ASSERT: HashFile(): invalid hashFunction; use md5/sha1/sha256/sha384/sha512: ' .
|
||||
"$hashFunction\n" if ($hashFunction !~ '^(md5|sha1|sha256|sha384|sha512)$');
|
||||
|
||||
if (not(-f $fileToHash) || not(-r $fileToHash)) {
|
||||
if ($ignoreErrors) {
|
||||
return '';
|
||||
} else {
|
||||
die "ASSERT: HashFile(): unusable/unreadable file to hash\n";
|
||||
}
|
||||
}
|
||||
|
||||
# We use openssl because that's pretty much guaranteed to be on all the
|
||||
# platforms we want; md5sum and sha1sum aren't.
|
||||
my $rv = RunShellCommand(command => 'openssl',
|
||||
args => ['dgst', "-$hashFunction",
|
||||
$fileToHash, ],
|
||||
output => $dumpOutput);
|
||||
|
||||
if ($rv->{'timedOut'} || $rv->{'exitValue'} != 0) {
|
||||
if ($ignoreErrors) {
|
||||
return '';
|
||||
} else {
|
||||
die("MozUtil::HashFile(): hash call failed: $rv->{'exitValue'}\n");
|
||||
}
|
||||
}
|
||||
|
||||
my $hashValue = $rv->{'output'};
|
||||
chomp($hashValue);
|
||||
|
||||
# Expects input like MD5(mozconfig)= d7433cc4204b4f3c65d836fe483fa575
|
||||
# Removes everything up to and including the "= "
|
||||
$hashValue =~ s/^.+\s+(\w+)$/$1/;
|
||||
return $hashValue;
|
||||
}
|
||||
|
||||
sub Email {
|
||||
my %args = @_;
|
||||
|
||||
my $from = $args{'from'};
|
||||
my $to = $args{'to'};
|
||||
my $ccList = $args{'cc'} ? $args{'cc'} : undef;
|
||||
my $subject = $args{'subject'};
|
||||
my $message = $args{'message'};
|
||||
my $sendmail = $args{'sendmail'};
|
||||
my $blat = $args{'blat'};
|
||||
|
||||
if (not defined($from)) {
|
||||
die("ASSERT: MozBuild::Utils::Email(): from is required");
|
||||
} elsif (not defined($to)) {
|
||||
die("ASSERT: MozBuild::Utils::Email(): to is required");
|
||||
} elsif (not defined($subject)) {
|
||||
die("ASSERT: MozBuild::Utils::Email(): subject is required");
|
||||
} elsif (not defined($message)) {
|
||||
die("ASSERT: MozBuild::Utils::Email(): subject is required");
|
||||
}
|
||||
|
||||
if (defined($ccList) and ref($ccList) ne 'ARRAY') {
|
||||
die("ASSERT: MozBuild::Utils::Email(): ccList is not an array ref\n");
|
||||
}
|
||||
|
||||
if (-f $sendmail) {
|
||||
open(SENDMAIL, "|$sendmail -oi -t")
|
||||
or die("MozBuild::Utils::Email(): Can't fork for sendmail: $!\n");
|
||||
print SENDMAIL "From: $from\n";
|
||||
print SENDMAIL "To: $to\n";
|
||||
foreach my $cc (@{$ccList}) {
|
||||
print SENDMAIL "CC: $cc\n";
|
||||
}
|
||||
print SENDMAIL "Subject: $subject\n\n";
|
||||
print SENDMAIL "\n$message";
|
||||
|
||||
close(SENDMAIL);
|
||||
} elsif(-f $blat) {
|
||||
my ($mh, $mailfile) = tempfile(DIR => '.');
|
||||
|
||||
my $toList = $to;
|
||||
foreach my $cc (@{$ccList}) {
|
||||
$toList .= ',';
|
||||
$toList .= $cc;
|
||||
}
|
||||
print $mh "\n$message";
|
||||
close($mh) or die("MozBuild::Utils::Email(): could not close tempmail file $mailfile: $!");
|
||||
|
||||
my $rv = RunShellCommand(command => $blat,
|
||||
args => [$mailfile, '-to', $toList,
|
||||
'-subject', '"' . $subject . '"']);
|
||||
if ($rv->{'timedOut'} || $rv->{'exitValue'} != 0) {
|
||||
die("MozBuild::Utils::Email(): FAILED: $rv->{'exitValue'}," .
|
||||
" output: $rv->{'output'}\n");
|
||||
}
|
||||
|
||||
print "$rv->{'output'}\n";
|
||||
|
||||
} else {
|
||||
die("MozBuild::Utils::Email(): ASSERT: cannot find $sendmail or $blat");
|
||||
}
|
||||
}
|
||||
|
||||
sub DownloadFile {
|
||||
my %args = @_;
|
||||
|
||||
my $sourceUrl = $args{'url'};
|
||||
|
||||
die("ASSERT: DownloadFile() Invalid Source URL: $sourceUrl\n")
|
||||
if (not(defined($sourceUrl)) || $sourceUrl !~ m|^http://|);
|
||||
|
||||
my @wgetArgs = ();
|
||||
|
||||
if (defined($args{'dest'})) {
|
||||
push(@wgetArgs, ('-O', $args{'dest'}));
|
||||
}
|
||||
|
||||
if (defined($args{'user'})) {
|
||||
push(@wgetArgs, ('--http-user', $args{'user'}));
|
||||
}
|
||||
|
||||
if (defined($args{'password'})) {
|
||||
push(@wgetArgs, ('--http-password', $args{'password'}));
|
||||
}
|
||||
|
||||
push(@wgetArgs, ('--progress=dot:mega', $sourceUrl));
|
||||
|
||||
my $rv = RunShellCommand(command => 'wget',
|
||||
args => \@wgetArgs);
|
||||
|
||||
if ($rv->{'timedOut'} || $rv->{'exitValue'} != 0) {
|
||||
die("DownloadFile(): FAILED: $rv->{'exitValue'}," .
|
||||
" output: $rv->{'output'}\n");
|
||||
}
|
||||
}
|
||||
|
||||
##
|
||||
# Unpacks Mozilla installer builds.
|
||||
#
|
||||
# Arguments:
|
||||
# file - file to unpack
|
||||
# unpackDir - dir to unpack into
|
||||
##
|
||||
|
||||
sub UnpackBuild {
|
||||
my %args = @_;
|
||||
|
||||
my $hdiutil = defined($ENV{'HDIUTIL'}) ? $ENV{'HDIUTIL'} : 'hdiutil';
|
||||
my $rsync = defined($ENV{'RSYNC'}) ? $ENV{'RSYNC'} : 'rsync';
|
||||
my $tar = defined($ENV{'TAR'}) ? $ENV{'TAR'} : 'tar';
|
||||
my $sevenzip = defined($ENV{'SEVENZIP'}) ? $ENV{'SEVENZIP'} : '7z';
|
||||
|
||||
my $file = $args{'file'};
|
||||
my $unpackDir = $args{'unpackDir'};
|
||||
|
||||
if (! defined($file) ) {
|
||||
die("ASSERT: UnpackBuild: file is a required argument: $!");
|
||||
}
|
||||
if (! defined($unpackDir) ) {
|
||||
die("ASSERT: UnpackBuild: unpackDir is a required argument: $!");
|
||||
}
|
||||
if (! -f $file) {
|
||||
die("ASSERT: UnpackBuild: $file must exist and be a file: $!");
|
||||
}
|
||||
if (! -d $unpackDir) {
|
||||
mkdir($unpackDir) || die("ASSERT: UnpackBuld: could not create $unpackDir: $!");
|
||||
}
|
||||
|
||||
my ($filename, $directories, $suffix) = fileparse($file, qr/[^.]*/);
|
||||
|
||||
if (! defined($suffix) ) {
|
||||
die("ASSERT: UnpackBuild: no extension found for $filename: $!");
|
||||
}
|
||||
|
||||
if ($suffix eq 'dmg') {
|
||||
my $mntDir = './mnt';
|
||||
if (! -d $mntDir) {
|
||||
mkdir($mntDir) || die("ASSERT: UnpackBuild: cannot create mntdir: $!");
|
||||
}
|
||||
# Note that this uses system() not RunShellCommand() because we need
|
||||
# to echo "y" to hdiutil, to get past the EULA code.
|
||||
system("echo \"y\" | PAGER=\"/bin/cat\" $hdiutil attach -quiet -puppetstrings -noautoopen -mountpoint ./mnt \"$file\"") || die ("UnpackBuild: Cannot unpack $file: $!");
|
||||
my $rv = RunShellCommand(command => $rsync,
|
||||
args => ['-av', $mntDir, $unpackDir]);
|
||||
if ($rv->{'timedOut'} || $rv->{'exitValue'} != 0) {
|
||||
die("UnpackBuild(): FAILED: $rv->{'exitValue'}," .
|
||||
" output: $rv->{'output'}\n");
|
||||
}
|
||||
$rv = RunShellCommand(command => $hdiutil,
|
||||
args => ['detach', $mntDir]);
|
||||
if ($rv->{'timedOut'} || $rv->{'exitValue'} != 0) {
|
||||
die("UnpackBuild(): FAILED: $rv->{'exitValue'}," .
|
||||
" output: $rv->{'output'}\n");
|
||||
}
|
||||
}
|
||||
if ($suffix eq 'gz') {
|
||||
my $rv = RunShellCommand(command => $tar,
|
||||
args => ['-C', $unpackDir, '-zxf', $file]);
|
||||
if ($rv->{'timedOut'} || $rv->{'exitValue'} != 0) {
|
||||
die("UnpackBuild(): FAILED: $rv->{'exitValue'}," .
|
||||
" output: $rv->{'output'}\n");
|
||||
}
|
||||
}
|
||||
if ($suffix eq 'exe') {
|
||||
my $oldpwd = getcwd();
|
||||
chdir($unpackDir);
|
||||
my $rv = RunShellCommand(command => $sevenzip,
|
||||
args => ['x', $file]);
|
||||
if ($rv->{'timedOut'} || $rv->{'exitValue'} != 0) {
|
||||
die("UnpackBuild(): FAILED: $rv->{'exitValue'}," .
|
||||
" output: $rv->{'output'}\n");
|
||||
}
|
||||
chdir($oldpwd);
|
||||
}
|
||||
}
|
||||
|
||||
sub GetBuildIDFromFTP {
|
||||
my %args = @_;
|
||||
|
||||
my $os = $args{'os'};
|
||||
if (! defined($os)) {
|
||||
die("ASSERT: MozBuild::GetBuildIDFromFTP(): os is required argument");
|
||||
}
|
||||
my $releaseDir = $args{'releaseDir'};
|
||||
if (! defined($releaseDir)) {
|
||||
die("ASSERT: MozBuild::GetBuildIDFromFTP(): releaseDir is required argument");
|
||||
}
|
||||
my $stagingServer = $args{'stagingServer'};
|
||||
if (! defined($stagingServer)) {
|
||||
die("ASSERT: MozBuild::GetBuildIDFromFTP(): stagingServer is a required argument");
|
||||
}
|
||||
|
||||
my ($bh, $buildIDTempFile) = tempfile(UNLINK => 1);
|
||||
$bh->close();
|
||||
my $info_url = 'http://' . $stagingServer . '/' . $releaseDir . '/' . $os . '_info.txt';
|
||||
my $rv = RunShellCommand(
|
||||
command => 'wget',
|
||||
args => ['-O', $buildIDTempFile,
|
||||
$info_url]
|
||||
);
|
||||
|
||||
if ($rv->{'timedOut'} || $rv->{'dumpedCore'} || ($rv->{'exitValue'} != 0)) {
|
||||
die("wget of $info_url failed.");
|
||||
}
|
||||
|
||||
my $buildID;
|
||||
open(FILE, "< $buildIDTempFile") ||
|
||||
die("Could not open buildID temp file $buildIDTempFile: $!");
|
||||
while (<FILE>) {
|
||||
my ($var, $value) = split(/\s*=\s*/, $_, 2);
|
||||
if ($var eq 'buildID') {
|
||||
$buildID = $value;
|
||||
}
|
||||
}
|
||||
close(FILE) ||
|
||||
die("Could not close buildID temp file $buildIDTempFile: $!");
|
||||
if (! defined($buildID)) {
|
||||
die("Could not read buildID from temp file $buildIDTempFile: $!");
|
||||
}
|
||||
if (! $buildID =~ /^\d+$/) {
|
||||
die("ASSERT: MozBuild::GetBuildIDFromFTP: $buildID is non-numerical");
|
||||
}
|
||||
chomp($buildID);
|
||||
|
||||
return $buildID;
|
||||
}
|
||||
|
||||
1;
|
||||
@@ -1,76 +0,0 @@
|
||||
Bootstrap Release
|
||||
-----------------
|
||||
|
||||
Bootstrap is a release automation tool.
|
||||
Use "release -h" for help.
|
||||
|
||||
Pre-flight Checklist
|
||||
-----------------
|
||||
There are a number of manual steps that must be performed, so a default
|
||||
end-to-end run will not (yet) work.
|
||||
|
||||
Before any steps:
|
||||
|
||||
* verify shipped-locales
|
||||
* edit bootstrap.cfg
|
||||
* edit tinder-config.pl/mozconfig
|
||||
* version bump
|
||||
|
||||
After Build and Repack steps:
|
||||
|
||||
* rsync builds to candidates dir
|
||||
|
||||
After Update step:
|
||||
|
||||
* edit patcher config
|
||||
* edit mozilla/testing/release/updates/updates.cfg
|
||||
|
||||
After Sign step:
|
||||
|
||||
* create bouncer links
|
||||
* rsync builds to mirrors
|
||||
* wait 12 hours for mirrors to catch up
|
||||
* rsync production AUS config
|
||||
|
||||
Steps are in dependency order. The process may be restarted at any step as
|
||||
long as all previous steps are satisfied.
|
||||
|
||||
PASS/FAIL verification is run after every step.
|
||||
|
||||
Steps
|
||||
-----------------
|
||||
1) Tag
|
||||
2) Build
|
||||
3) Source
|
||||
4) Repack
|
||||
5) Sign
|
||||
6) Updates
|
||||
7) Stage
|
||||
|
||||
Details
|
||||
-----------------
|
||||
Tag
|
||||
_RELEASE and _RCn for mozilla, l10n and talkback
|
||||
Build
|
||||
en-US build from source (based on tag)
|
||||
push to stage
|
||||
announce
|
||||
Source
|
||||
bz2 archive (based on tag)
|
||||
push to stage
|
||||
Repack
|
||||
repack l10n, uses en-US build (based on tag)
|
||||
push to stage
|
||||
announce
|
||||
Sign
|
||||
manual
|
||||
Updates
|
||||
uses patcher
|
||||
generate partials and AUS config ("snippets")
|
||||
push to stage
|
||||
announce
|
||||
Stage
|
||||
uses groom-files
|
||||
create release directory/filename structure
|
||||
merge updates
|
||||
announce
|
||||
@@ -1,69 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
#set -v
|
||||
|
||||
LIVE_SNIPPET_DIR=/opt/aus2/incoming/3
|
||||
BACKUP_DIR=/opt/aus2/snippets/backup
|
||||
STAGING_DIR=/opt/aus2/snippets/staging
|
||||
|
||||
WC=/usr/bin/wc
|
||||
DATE=/bin/date
|
||||
TAR=/bin/tar
|
||||
SED=/bin/sed
|
||||
GREP=/bin/grep
|
||||
|
||||
if test -z $1; then
|
||||
echo Usage: $0 [snippet-directory-to-sync-in from $STAGING_DIR]
|
||||
exit 1
|
||||
fi
|
||||
|
||||
newSnippetDir=`echo $1 | $SED -e 's/\///'g`
|
||||
|
||||
if ! test -d $STAGING_DIR/$newSnippetDir; then
|
||||
echo Usage: $0 [snippet-directory-to-sync-in from $STAGING_DIR]
|
||||
exit 1
|
||||
fi
|
||||
|
||||
currentDate=`$DATE +%Y%m%d`
|
||||
|
||||
## We use the shell's expansion capabilites to get a list of other snippet
|
||||
## directories we may have pushed today... kinda lame, but it works.
|
||||
|
||||
pushd $BACKUP_DIR > /dev/null
|
||||
preDirCount=`echo $currentDate-?-pre-* | $GREP -v \? | $WC -w`
|
||||
popd > /dev/null
|
||||
|
||||
## Increment the count by one, for the new snippet backup directory we're
|
||||
## about to create
|
||||
let nextPreDirCount=$preDirCount+1
|
||||
#echo $nextPreDirCount
|
||||
backupDirName=$currentDate-$nextPreDirCount-pre-$1
|
||||
|
||||
### Find list of directories that change
|
||||
absNewSnippetDir=$STAGING_DIR/$newSnippetDir
|
||||
changedDirs=$(find $absNewSnippetDir -maxdepth 3 -mindepth 3 -type d | $SED s,$absNewSnippetDir/,,g)
|
||||
args=""
|
||||
### Skip directories that don't exist in the live snippets directory
|
||||
### no need to back them up, since they don't exist yet!
|
||||
for d in $changedDirs; do
|
||||
if [ ! -d $LIVE_SNIPPET_DIR/$d ]; then
|
||||
echo Ignoring $d
|
||||
else
|
||||
args="$args $d"
|
||||
fi
|
||||
done
|
||||
|
||||
if [ -z "$args" ]; then
|
||||
echo
|
||||
echo 'Nothing to backup. There could be something wrong, or you could'
|
||||
echo 'be creating new directories (eg test snippets for a major update).'
|
||||
exit 0
|
||||
fi
|
||||
|
||||
pushd $LIVE_SNIPPET_DIR > /dev/null
|
||||
echo Running time $TAR cfvz $BACKUP_DIR/$backupDirName.tar.gz $args
|
||||
time $TAR cfvz $BACKUP_DIR/$backupDirName.tar.gz $args
|
||||
popd > /dev/null
|
||||
|
||||
exit 0
|
||||
@@ -1,34 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
#set -v
|
||||
|
||||
LIVE_SNIPPET_DIR=/opt/aus2/incoming/3
|
||||
BACKUP_DIR=/opt/aus2/snippets/backup
|
||||
|
||||
WC=/usr/bin/wc
|
||||
DATE=/bin/date
|
||||
TAR=/bin/tar
|
||||
SED=/bin/sed
|
||||
GREP=/bin/grep
|
||||
|
||||
currentDate=`$DATE +%Y%m%d`
|
||||
|
||||
## We use the shell's expansion capabilites to get a list of other snippet
|
||||
## directories we may have pushed today... kinda lame, but it works.
|
||||
|
||||
pushd $BACKUP_DIR > /dev/null
|
||||
backupDirCount=`echo $currentDate-nightly-?-* | $GREP -v \? | $WC -w`
|
||||
popd > /dev/null
|
||||
|
||||
## Increment the count by one, for the new snippet backup directory we're
|
||||
## about to create
|
||||
let backupDirCount=$backupDirCount+1
|
||||
backupDirName=$currentDate-nightly-$backupDirCount
|
||||
|
||||
pushd $LIVE_SNIPPET_DIR > /dev/null
|
||||
echo Running time $TAR cfvj $BACKUP_DIR/$backupDirName.tar.bz2 . --exclude 'Firefox/1.5*' --exclude 'Firefox/2.0*' --exclude 'Thunderbird/1.5*'
|
||||
time $TAR cfvj $BACKUP_DIR/$backupDirName.tar.bz2 . --exclude 'Firefox/1.5*' --exclude 'Firefox/2.0*' --exclude 'Thunderbird/1.5*'
|
||||
popd > /dev/null
|
||||
|
||||
exit 0
|
||||
@@ -1,29 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
#set -v
|
||||
|
||||
LIVE_SNIPPET_DIR=/opt/aus2/incoming/3
|
||||
STAGING_DIR=/opt/aus2/snippets/staging
|
||||
|
||||
RSYNC=/usr/bin/rsync
|
||||
SED=/bin/sed
|
||||
|
||||
if test -z $1; then
|
||||
echo Usage: $0 [snippet-directory-to-sync-in from $STAGING_DIR]
|
||||
exit 1
|
||||
fi
|
||||
|
||||
newSnippetDir=`echo $1 | $SED -e 's/\///'g`
|
||||
|
||||
if ! test -d $STAGING_DIR/$newSnippetDir; then
|
||||
echo Usage: $0 [snippet-directory-to-sync-in from $STAGING_DIR]
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# publish the new snippets
|
||||
echo Running $RSYNC -PaO $STAGING_DIR/$1/ $LIVE_SNIPPET_DIR
|
||||
$RSYNC -PaO $STAGING_DIR/$1/ $LIVE_SNIPPET_DIR
|
||||
touch $LIVE_SNIPPET_DIR
|
||||
|
||||
exit 0
|
||||
@@ -1,390 +0,0 @@
|
||||
#!/usr/bin/perl
|
||||
#
|
||||
# TODO - use the file regexes to verify the contents of the directory.
|
||||
#
|
||||
|
||||
use Getopt::Long;
|
||||
use Cwd;
|
||||
|
||||
use strict;
|
||||
|
||||
use vars qw($DEFAULT_LOCALES_MANIFEST
|
||||
@ALL_PLATFORMS
|
||||
@NON_LOCALE_XPIS );
|
||||
|
||||
$DEFAULT_LOCALES_MANIFEST = 'shipped-locales';
|
||||
@ALL_PLATFORMS = qw(win32 linux osx osxppc); # Bouncer platforms
|
||||
@NON_LOCALE_XPIS = qw(browser talkback xpcom adt);
|
||||
|
||||
sub LoadLocaleManifest {
|
||||
my %args = @_;
|
||||
|
||||
die "ASSERT: LoadLocaleManifest(): needs a HASH ref" if
|
||||
(not exists($args{'localeHashRef'}) or
|
||||
ref($args{'localeHashRef'}) ne 'HASH');
|
||||
|
||||
my $localeHash = $args{'localeHashRef'};
|
||||
my $manifestFile = $args{'manifest'};
|
||||
|
||||
if (not -e $manifestFile) {
|
||||
print STDERR "Can't find locale manifest $manifestFile; bailing...\n";
|
||||
PrintUsage(1);
|
||||
}
|
||||
|
||||
open(MANIFEST, "$manifestFile") or return 0;
|
||||
my @manifestLines = <MANIFEST>;
|
||||
close(MANIFEST);
|
||||
|
||||
foreach my $line (@manifestLines) {
|
||||
my @elements = split(/\s+/, $line);
|
||||
# Grab the locale; we do it this way, so we can use the rest of the
|
||||
# array as a platform list, if we need it...
|
||||
my $locale = shift(@elements);
|
||||
|
||||
# We don't add a $ on the end, because of things like ja-JP-mac
|
||||
if ($locale !~ /^[a-z]{2}(\-[A-Z]{2})?/) {
|
||||
die "ASSERT: invalid locale in manifest file: $locale";
|
||||
}
|
||||
|
||||
# So this is kinda weird; if the locales are followed by a platform,
|
||||
# then they don't exist for all the platforms; if they're all by their
|
||||
# lonesome, then they exist for all platforms. So, since we shifted off
|
||||
# the locale above, if there's anything left in the array, it's the
|
||||
# platforms that are valid for this locale; if there isn't, then that
|
||||
# platform is valid for all locales.
|
||||
$localeHash->{$locale} = scalar(@elements) ? \@elements : \@ALL_PLATFORMS;
|
||||
|
||||
foreach my $platform (@{$localeHash->{$locale}}) {
|
||||
die "ASSERT: invalid platform: $platform" if
|
||||
(not grep($platform eq $_, @ALL_PLATFORMS));
|
||||
}
|
||||
}
|
||||
|
||||
# Add en-US, which isn't in shipped-locales, because it's assumed that
|
||||
# we always need en-US, for all platforms, to ship.
|
||||
$localeHash->{'en-US'} = \@ALL_PLATFORMS;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
sub VerifyLinuxLocales {
|
||||
my %args = @_;
|
||||
my $locales = $args{'locales'};
|
||||
my $directory = $args{'dir'};
|
||||
my $extension = $args{'extension'};
|
||||
my $product = lc($args{'product'});
|
||||
|
||||
if (not -d $directory) {
|
||||
print STDERR "Can't find Linux directory!\n";
|
||||
return 0;
|
||||
}
|
||||
|
||||
my $fileRegex = '^' . $product . '\-[\d\.]+((a|b|rc)\d+)?\.tar\.' . $extension .
|
||||
'(\.asc)?$';
|
||||
|
||||
return VerifyDirectory(locales => $locales,
|
||||
dir => $directory,
|
||||
platform => 'linux',
|
||||
fileRegex => $fileRegex);
|
||||
}
|
||||
|
||||
sub VerifyWin32Locales {
|
||||
my %args = @_;
|
||||
my $locales = $args{'locales'};
|
||||
my $directory = $args{'dir'};
|
||||
my $product = ucfirst($args{'product'});
|
||||
|
||||
if (not -d $directory) {
|
||||
print STDERR "Can't find Win32 directory!\n";
|
||||
return 0;
|
||||
}
|
||||
|
||||
my $fileRegex = '^' . $product .
|
||||
'\ Setup\ [\d\.]+(\ (Alpha|Beta|RC)\ \d+)?\.exe(\.asc)?$';
|
||||
|
||||
return VerifyDirectory(locales => $locales,
|
||||
dir => $directory,
|
||||
platform => 'win32',
|
||||
fileRegex => $fileRegex);
|
||||
}
|
||||
|
||||
sub VerifyMacLocales {
|
||||
my %args = @_;
|
||||
my $locales = $args{'locales'};
|
||||
my $directory = $args{'dir'};
|
||||
my $product = ucfirst($args{'product'});
|
||||
|
||||
if (not -d $directory) {
|
||||
print STDERR "Can't find Mac directory!\n";
|
||||
return 0;
|
||||
}
|
||||
|
||||
my $fileRegex = '^' . $product . '\ [\d\.]+(\ (Alpha|Beta|RC)\ \d+)?\.dmg(\.asc)?$';
|
||||
|
||||
return VerifyDirectory(locales => $locales,
|
||||
dir => $directory,
|
||||
platform => 'osx',
|
||||
fileRegex => $fileRegex);
|
||||
}
|
||||
|
||||
sub VerifyDirectory {
|
||||
my %args = @_;
|
||||
my $locales = $args{'locales'};
|
||||
my $directory = $args{'dir'};
|
||||
my $fileRegex = $args{'fileRegex'};
|
||||
my $platform = $args{'platform'};
|
||||
|
||||
|
||||
my $localeDirStatus = VerifyLocaleDirectories(%args);
|
||||
my $xpiDirStatus = VerifyXPIDirectory(%args);
|
||||
|
||||
return ($localeDirStatus and $xpiDirStatus);
|
||||
}
|
||||
|
||||
|
||||
sub VerifyLocaleDirectories {
|
||||
my %args = @_;
|
||||
my $locales = $args{'locales'};
|
||||
my $directory = $args{'dir'};
|
||||
my $fileRegex = $args{'fileRegex'};
|
||||
my $platform = $args{'platform'};
|
||||
my $status = 1;
|
||||
|
||||
my $rv = opendir(DIR, $directory);
|
||||
if (not $rv) {
|
||||
print STDERR "opendir() on $directory FAILED: $!\n";
|
||||
return 0;
|
||||
}
|
||||
my @dirEntries = grep(!/^\.\.?$/, readdir(DIR));
|
||||
closedir(DIR);
|
||||
|
||||
my %localesDirCheckCopy = %{$locales};
|
||||
|
||||
foreach my $dirEnt (@dirEntries) {
|
||||
if (not -d "$directory/$dirEnt") {
|
||||
print STDERR "Non-directory entry found: $directory/$dirEnt\n";
|
||||
$status = 0;
|
||||
next;
|
||||
}
|
||||
|
||||
# The xpi directory is obviously not a locale, but all of the directories
|
||||
# should have one; verification of the xpi dir is VerifyXPIDirectory's job
|
||||
next if ($dirEnt eq 'xpi');
|
||||
|
||||
if (not(exists($localesDirCheckCopy{$dirEnt}))) {
|
||||
print STDERR "Invalid (extra) locale present: $dirEnt\n";
|
||||
$status = 0;
|
||||
next;
|
||||
}
|
||||
|
||||
my $platformList = $localesDirCheckCopy{$dirEnt};
|
||||
|
||||
if (not grep($platform eq $_, @{$platformList})) {
|
||||
print STDERR "Invalid (extra) locale for platform '$platform': $dirEnt\n";
|
||||
$status = 0;
|
||||
} else {
|
||||
delete($localesDirCheckCopy{$dirEnt});
|
||||
}
|
||||
|
||||
# We verified this is a directory above...
|
||||
my $rv = opendir(DIR, "$directory/$dirEnt");
|
||||
if (not $rv) {
|
||||
print STDERR "opendir() on $directory/$dirEnt FAILED: $!\n";
|
||||
next;
|
||||
}
|
||||
my @installerFileEntries = grep(!/^\.\.?$/, readdir(DIR));
|
||||
closedir(DIR);
|
||||
|
||||
# The directory should not be empty...
|
||||
if (not scalar(@installerFileEntries)) {
|
||||
print STDERR "Empty locale directory: $directory/$dirEnt";
|
||||
$status = 0;
|
||||
next;
|
||||
}
|
||||
|
||||
foreach my $pkg (@installerFileEntries) {
|
||||
if (not -f "$directory/$dirEnt/$pkg") {
|
||||
print STDERR "Unexpected, non-file in $directory/$dirEnt: $pkg\n";
|
||||
$status = 0;
|
||||
next;
|
||||
}
|
||||
|
||||
if ($pkg !~ /$fileRegex/) {
|
||||
print STDERR "Unknown file in $directory/$dirEnt: $pkg\n";
|
||||
$status = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
foreach my $locale (keys(%localesDirCheckCopy)) {
|
||||
if (grep($platform eq $_, @{$localesDirCheckCopy{$locale}})) {
|
||||
print STDERR "Missing locale for platform '$platform': $locale\n";
|
||||
$status = 0;
|
||||
}
|
||||
}
|
||||
|
||||
return $status;
|
||||
}
|
||||
|
||||
|
||||
sub VerifyXPIDirectory {
|
||||
my %args = @_;
|
||||
my $locales = $args{'locales'};
|
||||
my $directory = "$args{'dir'}/xpi";
|
||||
my $fileRegex = $args{'fileRegex'};
|
||||
my $platform = $args{'platform'};
|
||||
my $status = 1;
|
||||
|
||||
my $rv = opendir(XPIDIR, $directory);
|
||||
|
||||
if (not $rv) {
|
||||
print STDERR "Couldn't opendir() $directory: $!\n";
|
||||
return 0;
|
||||
}
|
||||
|
||||
my @xpiDirEntries = grep(!/^\.\.?$/, readdir(XPIDIR));
|
||||
closedir(XPIDIR);
|
||||
|
||||
my %localesDirCheckCopy = %{$locales};
|
||||
|
||||
# we last shipped an en-US.xpi for Firefox 1.5.0.4
|
||||
delete($localesDirCheckCopy{'en-US'});
|
||||
|
||||
foreach my $file (@xpiDirEntries) {
|
||||
if ($file !~ /\.xpi$/) {
|
||||
print STDERR "Non-xpi file found in $directory: $file\n";
|
||||
$status = 0;
|
||||
next;
|
||||
}
|
||||
|
||||
my $locale = $file;
|
||||
$locale =~ s/\.xpi//;
|
||||
|
||||
# Ignore browser.xpi, talkback.xpi, etc.
|
||||
next if (grep($locale eq $_, @NON_LOCALE_XPIS));
|
||||
|
||||
my $platformList = $localesDirCheckCopy{$locale};
|
||||
|
||||
if (not grep($platform eq $_, @{$platformList})) {
|
||||
print STDERR "Invalid (extra) locale XPI for platform '$platform': $locale\n";
|
||||
$status = 0;
|
||||
} else {
|
||||
delete($localesDirCheckCopy{$locale});
|
||||
}
|
||||
}
|
||||
|
||||
foreach my $locale (keys(%localesDirCheckCopy)) {
|
||||
if (grep($platform eq $_, @{$localesDirCheckCopy{$locale}})) {
|
||||
print STDERR "Missing XPI locale for platform '$platform': $locale\n";
|
||||
$status = 0;
|
||||
}
|
||||
}
|
||||
|
||||
# we stopped shipping these at Firefox 1.5.0.4
|
||||
foreach my $nonLocaleXpi (@NON_LOCALE_XPIS) {
|
||||
if (-e "$directory/$nonLocaleXpi.xpi") {
|
||||
print STDERR "Invalid (extra) non-locale XPI: $directory/$nonLocaleXpi\n";
|
||||
$status = 0;
|
||||
}
|
||||
}
|
||||
|
||||
return $status;
|
||||
}
|
||||
|
||||
sub PrintUsage {
|
||||
my $exitCode = shift;
|
||||
|
||||
print<<__END_USAGE__;
|
||||
|
||||
Using the shipped-locales file from CVS, verify in an FTP staging directory
|
||||
structure that all the various locales that are to be shipped exist for every
|
||||
platform, and that no extra locales for any platform are being shipped.
|
||||
|
||||
Usage:
|
||||
|
||||
$0 [ -m <locale manifest> ]
|
||||
|
||||
-m,--locale-manifest The 'shipped-locales' file, from CVS.
|
||||
Defaults to 'shipped-locales' in the cwd.
|
||||
|
||||
-d,--check-directory The directory to verify.
|
||||
Should have the default FTP directory structure.
|
||||
Defaults to the current working directory.
|
||||
-l,--linux-extension The file extension used for Linux
|
||||
packages. This must be either 'gz' or 'bz2'.
|
||||
__END_USAGE__
|
||||
|
||||
exit($exitCode) if (defined($exitCode));
|
||||
}
|
||||
|
||||
sub main {
|
||||
my $showHelp = 0;
|
||||
my $localeManifest = $DEFAULT_LOCALES_MANIFEST;
|
||||
my $shellReturnVal = 0;
|
||||
my $checkDir = getcwd();
|
||||
my $linuxExtension = '';
|
||||
my $product = '';
|
||||
|
||||
Getopt::Long::GetOptions('h|help|?' => \$showHelp,
|
||||
'm|locale-manifest=s' => \$localeManifest,
|
||||
'd|check-directory=s' => \$checkDir,
|
||||
'l|linux-extension=s' => \$linuxExtension,
|
||||
'p|product=s' => \$product)
|
||||
or PrintUsage(1);
|
||||
|
||||
# Fullpath $checkDir...
|
||||
$checkDir = getcwd() . '/' . $checkDir if ($checkDir !~ m:^/:);
|
||||
# And strip any trailing /'s...
|
||||
$checkDir =~ s:/+$::;
|
||||
|
||||
if (not -d $checkDir || not -r $checkDir || not -x $checkDir) {
|
||||
print STDERR "Can't find/access directory to validate: $checkDir\n";
|
||||
PrintUsage(1);
|
||||
}
|
||||
|
||||
if ($linuxExtension ne 'gz' && $linuxExtension ne 'bz2') {
|
||||
print STDERR "--linux-extension must be 'gz' or 'bz2'\n";
|
||||
PrintUsage(1);
|
||||
}
|
||||
|
||||
if (length($product) < 1) {
|
||||
print STDERR "--product/-p is a required option.\n";
|
||||
PrintUsage(1);
|
||||
}
|
||||
|
||||
PrintUsage(0) if ($showHelp);
|
||||
|
||||
my $locales = {};
|
||||
my $success = LoadLocaleManifest(localeHashRef => $locales,
|
||||
manifest => $localeManifest);
|
||||
|
||||
die "Failed to load locale manifest" if (not $success);
|
||||
die "ASSERT: checkDir needs to be full-pathed at this point: $checkDir"
|
||||
if ($checkDir !~ m:^/:);
|
||||
|
||||
$shellReturnVal = (
|
||||
VerifyLinuxLocales(locales => $locales, dir => "$checkDir/linux-i686",
|
||||
extension => $linuxExtension, product => $product) &
|
||||
VerifyWin32Locales(locales => $locales, dir => "$checkDir/win32",
|
||||
product => $product) &
|
||||
VerifyMacLocales(locales => $locales, dir => "$checkDir/mac",
|
||||
product => $product)
|
||||
);
|
||||
|
||||
# TODO - VerifyUpdateLocales(locales => $locales, dir => 'update');
|
||||
|
||||
if ($shellReturnVal) {
|
||||
print STDERR "PASS: all files present, no extras\n";
|
||||
} else {
|
||||
print STDERR "FAIL: errors occurred\n";
|
||||
}
|
||||
|
||||
# Unix truth values... 0 for success, etc., etc., etc.; so, all the
|
||||
# Verify* functions return true/false and are ANDed together; if
|
||||
# there's a single failure, the AND is false, so return true...
|
||||
# intuitive, eh?
|
||||
return not $shellReturnVal;
|
||||
}
|
||||
|
||||
# call the code & propagate the error status to the outside world
|
||||
exit main();
|
||||
@@ -1,64 +0,0 @@
|
||||
version = 2.0.0.4
|
||||
milestone = 1.8.1.4
|
||||
# _RCn and _RELEASE will be appended as-needed
|
||||
productTag = FIREFOX_2_0_0_4
|
||||
# Branch name and pull dates to use for base tag
|
||||
branchTag = MOZILLA_1_8_BRANCH
|
||||
pullDate = 2007-04-17 00:00:00 PDT
|
||||
l10n_pullDate = 2007-04-17 00:00:00 PDT
|
||||
rc = 1
|
||||
# oldVersion and oldRc refer to the previous release
|
||||
oldVersion = 2.0.0.3
|
||||
oldRc = 1
|
||||
appName = browser
|
||||
product = firefox
|
||||
# Absolute path to tinderbox build directory
|
||||
linux_buildDir = /builds/tinderbox/Fx-Mozilla1.8-Release
|
||||
mac_buildDir = /builds/tinderbox/Fx-Mozilla1.8-Release
|
||||
win32_buildDir = /cygdrive/c/builds/tinderbox/Fx-Mozilla1.8-Release
|
||||
linux_l10n_buildDir = /builds/tinderbox/Fx-Mozilla1.8-l10n-Release
|
||||
mac_l10n_buildDir = /builds/tinderbox/Fx-Mozilla1.8-l10n-Release
|
||||
win32_l10n_buildDir = /cygdrive/c/builds/tinderbox/Fx-Mozilla1.8-l10n-Release
|
||||
# Absolute path to store bootstrap's logs
|
||||
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
|
||||
sourceDir = /builds/source
|
||||
updateDir = /builds/updates
|
||||
verifyDir = /builds/verify
|
||||
tagDir = /builds/tags
|
||||
configBumpDir = /builds/config
|
||||
# Build platform, as specified by tinderbox
|
||||
linux_buildPlatform = Linux_2.6.9-42.ELsmp_Depend
|
||||
macosx_buildPlatform = Darwin_8.7.0_Depend
|
||||
win32_buildPlatform = WINNT_5.2_Depend
|
||||
linux_l10n_buildPlatform = Linux_2.6.9-42.ELsmp_Depend
|
||||
macosx_l10n_buildPlatform = Darwin_8.7.0_Depend
|
||||
win32_l10n_buildPlatform = WINNT_5.2_Depend
|
||||
from = bootstrap@example.com
|
||||
to = test@example.com
|
||||
cc = other@example.com
|
||||
patcherConfig = moz18-branch-patcher2.cfg
|
||||
# Tag to use for building MAR/MBSDIFF and other update tools
|
||||
patcherToolsRev = MOZILLA_1_9a2_RELEASE
|
||||
verifyConfig = moz18-firefox-linux.cfg
|
||||
blat = /cygdrive/d/moztools/bin/blat.exe
|
||||
sendmail = /usr/lib/sendmail
|
||||
# dump Log output to stdout
|
||||
dumpLogs = 1
|
||||
# username and server to push update snippets to
|
||||
ausUser = cltbld
|
||||
ausServer = localhost
|
||||
# Tinderbox server tree that clients should report to
|
||||
buildTree = MozillaTest
|
||||
# where QA updates/builds go
|
||||
stagingUser = cltbld
|
||||
stagingServer = stage.mozilla.org
|
||||
# where beta updates/builds go
|
||||
ftpServer = ftp.mozilla.org
|
||||
# where release updates/builds go
|
||||
bouncerServer = download.mozilla.org
|
||||
@@ -1,90 +0,0 @@
|
||||
version = 2.0.0.20
|
||||
milestone = 1.8.1.20
|
||||
# _BUILDn and _RELEASE will be appended as-needed
|
||||
productTag = FIREFOX_2_0_0_20
|
||||
# Branch name and pull dates to use for base tag
|
||||
branchTag = MOZILLA_1_8_BRANCH
|
||||
#RelbranchOverride = GECKO181_20081202_RELBRANCH
|
||||
# these are not used when build > 1
|
||||
pullDate = 2008-12-02 20:33 PST
|
||||
l10n_pullDate = 2008-12-02 20:33 PST
|
||||
build = 1
|
||||
# oldVersion and oldRc refer to the previous release
|
||||
oldVersion = 2.0.0.19
|
||||
oldBuild = 2
|
||||
appName = browser
|
||||
product = firefox
|
||||
# Absolute path to tinderbox build directory
|
||||
linux_buildDir = /builds/tinderbox/Fx-Mozilla1.8-Release
|
||||
macosx_buildDir = /builds/tinderbox/Fx-Mozilla1.8-Release
|
||||
win32_buildDir = /cygdrive/c/builds/tinderbox/Fx-Mozilla1.8-Release
|
||||
linux_l10n_buildDir = /builds/tinderbox/Fx-Mozilla1.8-l10n-Release
|
||||
macosx_l10n_buildDir = /builds/tinderbox/Fx-Mozilla1.8-l10n-Release
|
||||
win32_l10n_buildDir = /cygdrive/c/builds/tinderbox/Fx-Mozilla1.8-l10n-Release
|
||||
# Absolute path to store bootstrap's logs
|
||||
linux_logDir = /builds/logs
|
||||
macosx_logDir = /builds/logs
|
||||
win32_logDir = /builds/logs
|
||||
mozillaCvsroot = cltbld@cvs.mozilla.org:/cvsroot
|
||||
l10nCvsroot = cltbld@cvs.mozilla.org:/l10n
|
||||
mofoCvsroot = cltbld@cvs.mozilla.org:/mofo
|
||||
anonCvsroot = :pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot
|
||||
# private staging area
|
||||
stageHome = /data/cltbld
|
||||
sourceDir = /builds/source
|
||||
updateDir = /builds/updates
|
||||
verifyDir = /builds/verify
|
||||
tagDir = /builds/tags
|
||||
configBumpDir = /builds/config
|
||||
symbolDir = /builds/symbols
|
||||
# Build platform, as specified by tinderbox
|
||||
linux_buildPlatform = Linux_2.4.21-53.EL_Depend
|
||||
macosx_buildPlatform = Darwin_8.7.0_Depend
|
||||
win32_buildPlatform = WINNT_5.2_Depend
|
||||
linux_l10n_buildPlatform = Linux_2.4.21-53.EL_Depend
|
||||
macosx_l10n_buildPlatform = Darwin_8.7.0_Depend
|
||||
win32_l10n_buildPlatform = WINNT_5.2_Depend
|
||||
from = bootstrap@mozilla.org
|
||||
to = build@mozilla.org
|
||||
cc = nobody@mozilla.org
|
||||
patcherConfig = moz18-branch-patcher2.cfg
|
||||
# Tag to use for building MAR/MBSDIFF and other update tools
|
||||
patcherToolsRev = UPDATE_PACKAGING_R4
|
||||
linux_verifyConfig = moz18-firefox-linux.cfg
|
||||
win32_verifyConfig = moz18-firefox-win32.cfg
|
||||
macosx_verifyConfig = moz18-firefox-mac.cfg
|
||||
blat = /cygdrive/c/moztools/bin/blat.exe
|
||||
sendmail = /usr/sbin/sendmail
|
||||
# dump Log output to stdout
|
||||
dumpLogs = 1
|
||||
# username and server to push update snippets to
|
||||
ausUser = cltbld
|
||||
ausServer = aus2-staging.mozilla.org
|
||||
ausServerUrl = https://aus2.mozilla.org
|
||||
# Tinderbox server tree that clients should report to
|
||||
buildTree = MozillaRelease
|
||||
# where QA updates/builds go
|
||||
stagingUser = cltbld
|
||||
stagingServer = stage-old.mozilla.org
|
||||
# where beta updates/builds go
|
||||
ftpServer = ftp.mozilla.org
|
||||
# where release updates/builds go
|
||||
bouncerServer = download.mozilla.org
|
||||
# username and server to push builds
|
||||
sshUser = cltbld
|
||||
sshServer = stage-old.mozilla.org
|
||||
# force 1.8 specific behavior
|
||||
useTalkback = 0
|
||||
symbolServer = stage-old.mozilla.org
|
||||
symbolServerUser = ffxbld
|
||||
symbolServerPath = /mnt/netapp/breakpad/symbols_ffx
|
||||
symbolServerKey = /home/cltbld/.ssh/ffxbld_dsa
|
||||
useTarGz = 1
|
||||
useBetaChannel = 1
|
||||
hgToolsRepo = https://hg.mozilla.org/build/tools
|
||||
hgToolsTag = default
|
||||
hgUsername = ffxbld
|
||||
win32_hgSshKey = /home/cltbld/.ssh/ffxbld_dsa
|
||||
linux_hgSshKey = /home/cltbld/.ssh/ffxbld_dsa
|
||||
macosx_hgSshKey = /Users/cltbld/.ssh/ffxbld_dsa
|
||||
bumpMilestoneTxt = 1
|
||||
@@ -1,90 +0,0 @@
|
||||
version = nightly
|
||||
milestone = nightly
|
||||
# _BUILDn and _RELEASE will be appended as-needed
|
||||
# not used by nightly
|
||||
productTag = FIREFOX_2_0_0_12pre
|
||||
# Branch name and pull dates to use for base tag
|
||||
branchTag = MOZILLA_1_8_BRANCH
|
||||
# manually tagged from GECKO181_20070712_RELBRANCH
|
||||
# RelbranchOverride = GECKO181_20070712_RELBRANCH
|
||||
# not used by nightly
|
||||
pullDate = 2007-08-21 03:07 PDT
|
||||
l10n_pullDate = 2007-08-21 03:07 PDT
|
||||
build = 1
|
||||
# oldVersion and oldRc refer to the previous release
|
||||
# not used by nightly
|
||||
oldVersion = 2.0.0.7
|
||||
oldBuild = 2
|
||||
# app name and product name
|
||||
appName = browser
|
||||
product = firefox
|
||||
# Absolute path to tinderbox build directory
|
||||
linux_buildRoot = /builds/tinderbox
|
||||
macosx_buildRoot = /builds/tinderbox
|
||||
win32_buildRoot = /cygdrive/c/builds/tinderbox
|
||||
linux_buildDir = /builds/tinderbox/Fx-Mozilla1.8-Nightly
|
||||
macosx_buildDir = /builds/tinderbox/Fx-Mozilla1.8-Nightly
|
||||
win32_buildDir = /cygdrive/c/builds/tinderbox/Fx-Mozilla1.8-Nightly
|
||||
linux_l10n_buildDir = /builds/tinderbox/Fx-Mozilla1.8-l10n-Nightly
|
||||
macosx_l10n_buildDir = /builds/tinderbox/Fx-Mozilla1.8-l10n-Nightly
|
||||
win32_l10n_buildDir = /cygdrive/c/builds/tinderbox/Fx-Mozilla1.8-l10n-Nightly
|
||||
# Absolute path to store bootstrap's logs
|
||||
linux_logDir = /builds/logs.nightly
|
||||
macosx_logDir = /builds/logs.nightly
|
||||
win32_logDir = /builds/logs.nightly
|
||||
mozillaCvsroot = :ext:cltbld@cvs.mozilla.org:/cvsroot
|
||||
l10nCvsroot = :ext:cltbld@cvs.mozilla.org:/l10n
|
||||
mofoCvsroot = :ext:cltbld@cvs.mozilla.org:/mofo
|
||||
anonCvsroot = :pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot
|
||||
# private staging area
|
||||
stageHome = /data/cltbld
|
||||
sourceDir = /builds/source
|
||||
updateDir = /builds/updates
|
||||
verifyDir = /builds/verify
|
||||
tagDir = /builds/tags
|
||||
configBumpDir = /builds/config
|
||||
# Build platform, as specified by tinderbox
|
||||
linux_buildPlatform = Linux_2.4.21-27.0.4.EL_Depend
|
||||
macosx_buildPlatform = Darwin_8.7.0_Depend
|
||||
win32_buildPlatform = WINNT_5.2_Depend
|
||||
linux_l10n_buildPlatform = Linux_2.4.21-27.0.4.EL_Depend
|
||||
macosx_l10n_buildPlatform = Darwin_8.7.0_Depend
|
||||
win32_l10n_buildPlatform = WINNT_5.2_Depend
|
||||
from = bootstrap@mozilla.org
|
||||
to = build-announce@mozilla.org
|
||||
cc = nobody@mozilla.org
|
||||
# not used by nightly
|
||||
patcherConfig = moz18-branch-patcher2.cfg
|
||||
# Tag to use for building MAR/MBSDIFF and other update tools
|
||||
patcherToolsRev = UPDATE_PACKAGING_R1
|
||||
linux_verifyConfig = moz18-firefox-linux.cfg
|
||||
win32_verifyConfig = moz18-firefox-win32.cfg
|
||||
macosx_verifyConfig = moz18-firefox-mac.cfg
|
||||
blat = /cygdrive/c/moztools/bin/blat.exe
|
||||
sendmail = /usr/sbin/sendmail
|
||||
# dump Log output to stdout
|
||||
dumpLogs = 1
|
||||
# username and server to push update snippets to
|
||||
ausUser = cltbld
|
||||
ausServer = aus2-staging.mozilla.org
|
||||
buildTree = Mozilla1.8
|
||||
# where QA updates/builds go
|
||||
stagingUser = cltbld
|
||||
stagingServer = stage-old.mozilla.org
|
||||
# where beta updates/builds go
|
||||
ftpServer = ftp.mozilla.org
|
||||
# where release updates/builds go
|
||||
bouncerServer = download.mozilla.org
|
||||
# username and server to push builds
|
||||
sshUser = ffxbld
|
||||
sshServer = stage-old.mozilla.org
|
||||
useTalkback = 0
|
||||
symbolServer = stage-old.mozilla.org
|
||||
symbolServerUser = cltbld
|
||||
symbolServerPath = /data/symbols
|
||||
symbolServerKey = /home/cltbld/.ssh/id_dsa
|
||||
symbolDir = /builds/symbols
|
||||
# turn off tests
|
||||
testsPhoneHome = 1
|
||||
bootstrapTag = RELEASE_AUTOMATION_M7_1
|
||||
useBetaChannel = 0
|
||||
@@ -1,90 +0,0 @@
|
||||
version = nightly
|
||||
milestone = nightly
|
||||
# _BUILDn and _RELEASE will be appended as-needed
|
||||
# not used by nightly
|
||||
productTag = FIREFOX_2_0_0_17pre
|
||||
# Branch name and pull dates to use for base tag
|
||||
branchTag = MOZILLA_1_8_BRANCH
|
||||
# manually tagged from GECKO181_20070712_RELBRANCH
|
||||
# RelbranchOverride = GECKO181_20070712_RELBRANCH
|
||||
# not used by nightly
|
||||
pullDate = 2008-07-30 03:07 PDT
|
||||
l10n_pullDate = 2008-07-30 03:07 PDT
|
||||
build = 1
|
||||
# oldVersion and oldRc refer to the previous release
|
||||
# not used by nightly
|
||||
oldVersion = 2.0.0.16
|
||||
oldBuild = 1
|
||||
# app name and product name
|
||||
appName = browser
|
||||
product = firefox
|
||||
# Absolute path to tinderbox build directory
|
||||
linux_buildRoot = /builds/tinderbox
|
||||
macosx_buildRoot = /builds/tinderbox
|
||||
win32_buildRoot = /cygdrive/c/builds/tinderbox
|
||||
linux_buildDir = /builds/tinderbox/Fx-Mozilla1.8-Nightly
|
||||
macosx_buildDir = /builds/tinderbox/Fx-Mozilla1.8-Nightly
|
||||
win32_buildDir = /cygdrive/c/builds/tinderbox/Fx-Mozilla1.8-Nightly
|
||||
linux_l10n_buildDir = /builds/tinderbox/Fx-Mozilla1.8-l10n-Nightly
|
||||
macosx_l10n_buildDir = /builds/tinderbox/Fx-Mozilla1.8-l10n-Nightly
|
||||
win32_l10n_buildDir = /cygdrive/c/builds/tinderbox/Fx-Mozilla1.8-l10n-Nightly
|
||||
# Absolute path to store bootstrap's logs
|
||||
linux_logDir = /builds/logs.nightly
|
||||
macosx_logDir = /builds/logs.nightly
|
||||
win32_logDir = /builds/logs.nightly
|
||||
mozillaCvsroot = staging-stage.build.mozilla.org:/builds/cvsmirrors/staging-1.8/cvsroot
|
||||
l10nCvsroot = staging-stage.build.mozilla.org:/builds/cvsmirrors/staging-1.8/l10n
|
||||
mofoCvsroot = staging-stage.build.mozilla.org:/builds/cvsmirrors/staging-1.8/mofo
|
||||
anonCvsroot = :pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot
|
||||
# private staging area
|
||||
stageHome = /data/cltbld
|
||||
sourceDir = /builds/source
|
||||
updateDir = /builds/updates
|
||||
verifyDir = /builds/verify
|
||||
tagDir = /builds/tags
|
||||
configBumpDir = /builds/config
|
||||
# Build platform, as specified by tinderbox
|
||||
linux_buildPlatform = Linux_2.4.21-27.0.4.EL_Depend
|
||||
macosx_buildPlatform = Darwin_8.7.0_Depend
|
||||
win32_buildPlatform = WINNT_5.2_Depend
|
||||
linux_l10n_buildPlatform = Linux_2.4.21-27.0.4.EL_Depend
|
||||
macosx_l10n_buildPlatform = Darwin_8.7.0_Depend
|
||||
win32_l10n_buildPlatform = WINNT_5.2_Depend
|
||||
from = staging-bootstrap@mozilla.org
|
||||
to = build-announce@mozilla.org
|
||||
cc = nobody@mozilla.org
|
||||
# not used by nightly
|
||||
patcherConfig = moz18-branch-patcher2.cfg
|
||||
# Tag to use for building MAR/MBSDIFF and other update tools
|
||||
patcherToolsRev = UPDATE_PACKAGING_R4
|
||||
linux_verifyConfig = moz18-firefox-linux.cfg
|
||||
win32_verifyConfig = moz18-firefox-win32.cfg
|
||||
macosx_verifyConfig = moz18-firefox-mac.cfg
|
||||
blat = /cygdrive/c/moztools/bin/blat.exe
|
||||
sendmail = /usr/sbin/sendmail
|
||||
# dump Log output to stdout
|
||||
dumpLogs = 1
|
||||
# username and server to push update snippets to
|
||||
ausUser = cltbld
|
||||
ausServer = staging-stgae.build.mozilla.org
|
||||
buildTree = Mozilla1.8-Staging
|
||||
# where QA updates/builds go
|
||||
stagingUser = cltbld
|
||||
stagingServer = staging-prometheus-vm.build.mozilla.org
|
||||
# where beta updates/builds go
|
||||
ftpServer = staging-prometheus-vm.build.mozilla.org
|
||||
# where release updates/builds go
|
||||
bouncerServer = staging-prometheus-vm.build.mozilla.org
|
||||
# username and server to push builds
|
||||
sshUser = cltbld
|
||||
sshServer = staging-prometheus-vm.build.mozilla.org
|
||||
useTalkback = 0
|
||||
symbolServer = staging-stage.mozilla.org
|
||||
symbolServerUser = cltbld
|
||||
symbolServerPath = /data/symbols
|
||||
symbolServerKey = /home/cltbld/.ssh/id_dsa
|
||||
symbolDir = /builds/symbols
|
||||
# turn off tests
|
||||
testsPhoneHome = 0
|
||||
bootstrapTag = RELEASE_AUTOMATION_M10
|
||||
useBetaChannel = 0
|
||||
@@ -1,89 +0,0 @@
|
||||
version = 2.0.0.17
|
||||
milestone = 1.8.1.17
|
||||
# _BUILDn and _RELEASE will be appended as-needed
|
||||
productTag = FIREFOX_2_0_0_17
|
||||
# Branch name and pull dates to use for base tag
|
||||
branchTag = MOZILLA_1_8_BRANCH
|
||||
#RelbranchOverride = GECKO181_20071115_RELBRANCH
|
||||
pullDate = 2008-07-30 10:30 PDT
|
||||
l10n_pullDate = 2008-07-30 10:30 PDT
|
||||
build = 1
|
||||
# oldVersion and oldRc refer to the previous release
|
||||
oldVersion = 2.0.0.16
|
||||
oldBuild = 1
|
||||
appName = browser
|
||||
product = firefox
|
||||
# Absolute path to tinderbox build directory
|
||||
linux_buildDir = /builds/tinderbox/Fx-Mozilla1.8-Release
|
||||
macosx_buildDir = /builds/tinderbox/Fx-Mozilla1.8-Release
|
||||
win32_buildDir = /cygdrive/c/builds/tinderbox/Fx-Mozilla1.8-Release
|
||||
linux_l10n_buildDir = /builds/tinderbox/Fx-Mozilla1.8-l10n-Release
|
||||
macosx_l10n_buildDir = /builds/tinderbox/Fx-Mozilla1.8-l10n-Release
|
||||
win32_l10n_buildDir = /cygdrive/c/builds/tinderbox/Fx-Mozilla1.8-l10n-Release
|
||||
# Absolute path to store bootstrap's logs
|
||||
linux_logDir = /builds/logs
|
||||
macosx_logDir = /builds/logs
|
||||
win32_logDir = /builds/logs
|
||||
mozillaCvsroot = staging-stage.build.mozilla.org:/builds/cvsmirrors/staging-1.8/cvsroot
|
||||
l10nCvsroot = staging-stage.build.mozilla.org:/builds/cvsmirrors/staging-1.8/l10n
|
||||
mofoCvsroot = staging-stage.build.mozilla.org:/builds/cvsmirrors/staging-1.8/mofo
|
||||
anonCvsroot = :pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot
|
||||
# private staging area
|
||||
stageHome = /data/cltbld
|
||||
sourceDir = /builds/source
|
||||
updateDir = /builds/updates
|
||||
verifyDir = /builds/verify
|
||||
tagDir = /builds/tags
|
||||
configBumpDir = /builds/config
|
||||
symbolDir = /builds/symbols
|
||||
# Build platform, as specified by tinderbox
|
||||
linux_buildPlatform = Linux_2.4.21-27.0.4.EL_Depend
|
||||
macosx_buildPlatform = Darwin_8.7.0_Depend
|
||||
win32_buildPlatform = WINNT_5.2_Depend
|
||||
linux_l10n_buildPlatform = Linux_2.4.21-27.0.4.EL_Depend
|
||||
macosx_l10n_buildPlatform = Darwin_8.7.0_Depend
|
||||
win32_l10n_buildPlatform = WINNT_5.2_Depend
|
||||
from = staging-bootstrap@mozilla.org
|
||||
to = build-announce@mozilla.org
|
||||
cc = nobody@mozilla.org
|
||||
patcherConfig = moz18-branch-patcher2.cfg
|
||||
# Tag to use for building MAR/MBSDIFF and other update tools
|
||||
patcherToolsRev = UPDATE_PACKAGING_R4
|
||||
linux_verifyConfig = moz18-firefox-linux.cfg
|
||||
win32_verifyConfig = moz18-firefox-win32.cfg
|
||||
macosx_verifyConfig = moz18-firefox-mac.cfg
|
||||
blat = /cygdrive/c/moztools/bin/blat.exe
|
||||
sendmail = /usr/sbin/sendmail
|
||||
# dump Log output to stdout
|
||||
dumpLogs = 1
|
||||
# username and server to push update snippets to
|
||||
ausUser = cltbld
|
||||
ausServer = staging-stage.build.mozilla.org
|
||||
ausServerUrl = http://staging-stage.build.mozilla.org
|
||||
# Tinderbox server tree that clients should report to
|
||||
buildTree = MozillaTest
|
||||
# where QA updates/builds go
|
||||
stagingUser = cltbld
|
||||
stagingServer = staging-prometheus-vm.build.mozilla.org
|
||||
# where beta updates/builds go
|
||||
ftpServer = staging-prometheus-vm.build.mozilla.org
|
||||
# where release updates/builds go
|
||||
bouncerServer = staging-prometheus-vm.build.mozilla.org
|
||||
# username and server to push builds
|
||||
sshUser = cltbld
|
||||
sshServer = staging-prometheus-vm.build.mozilla.org
|
||||
# force 1.8 specific behavior
|
||||
useTalkback = 0
|
||||
symbolServer = staging-stage.build.mozilla.org
|
||||
symbolServerUser = cltbld
|
||||
symbolServerPath = /data/symbols
|
||||
symbolServerKey = /home/cltbld/.ssh/id_rsa
|
||||
useTarGz = 1
|
||||
useBetaChannel = 1
|
||||
hgToolsRepo = https://hg.mozilla.org/users/stage-ffxbld/tools
|
||||
hgToolsTag = default
|
||||
hgUsername = stage-ffxbld
|
||||
win32_hgSshKey = /home/cltbld/.ssh/ffxbld_dsa
|
||||
linux_hgSshKey = /home/cltbld/.ssh/ffxbld_dsa
|
||||
macosx_hgSshKey = /Users/cltbld/.ssh/ffxbld_dsa
|
||||
bumpMilestoneTxt = 1
|
||||
@@ -1,64 +0,0 @@
|
||||
version = 1.5.0.12
|
||||
milestone = 1.8.0.12
|
||||
# _BUILDn and _RELEASE will be appended as-needed
|
||||
productTag = FIREFOX_1_5_0_12
|
||||
# Branch name and pull dates to use for base tag
|
||||
branchTag = MOZILLA_1_8_0_BRANCH
|
||||
# GECKO180_20070501_RELBRANCH created manually from this pull date
|
||||
pullDate = 2007-05-01 01:30 PDT
|
||||
l10n_pullDate =
|
||||
build = 2
|
||||
# oldVersion and oldRc refer to the previous release
|
||||
oldVersion = 1.5.0.11
|
||||
oldBuild = 1
|
||||
appName = browser
|
||||
product = firefox
|
||||
# Absolute path to tinderbox build directory
|
||||
linux_buildDir = /builds/tinderbox/Fx-Mozilla1.8.0-Release
|
||||
macosx_buildDir = /builds/tinderbox/Fx-Mozilla1.8.0-Release
|
||||
win32_buildDir = /cygdrive/c/builds/tinderbox/Fx-Mozilla1.8.0-Release
|
||||
linux_l10n_buildDir = /builds/tinderbox/Fx-Mozilla1.8.0-l10n-Release
|
||||
macosx_l10n_buildDir = /builds/tinderbox/Fx-Mozilla1.8.0-l10n-Release
|
||||
win32_l10n_buildDir = /cygdrive/c/builds/tinderbox/Fx-Mozilla1.8.0-l10n-Release
|
||||
# Absolute path to store bootstrap's logs
|
||||
logDir = /builds/release/logs
|
||||
win32_logDir = /cygdrive/c/builds/release/logs
|
||||
mozillaCvsroot = :ext:cltbld@cvs.mozilla.org:/cvsroot
|
||||
l10nCvsroot = :ext:cltbld@cvs.mozilla.org:/l10n
|
||||
mofoCvsroot = :ext:cltbld@cvs.mozilla.org:/mofo
|
||||
# private staging area
|
||||
stageHome = /data/cltbld
|
||||
updateDir = /builds/updates
|
||||
verifyDir = /builds/verify
|
||||
tagDir = /builds/tags
|
||||
configBumpDir = /builds/config
|
||||
# Build platform, as specified by tinderbox
|
||||
linux_buildPlatform = Linux_2.4.21-37.EL_Depend
|
||||
macosx_buildPlatform = Darwin_8.7.0_Depend
|
||||
win32_buildPlatform = WINNT_5.2_Depend
|
||||
linux_l10n_buildPlatform = Linux_2.4.21-37.EL_Depend
|
||||
macosx_l10n_buildPlatform = Darwin_8.7.0_Depend
|
||||
win32_l10n_buildPlatform = WINNT_5.2_Depend
|
||||
from = build@mozilla.org
|
||||
to = nrthomas@gmail.com
|
||||
# cc = other@example.com
|
||||
patcherConfig = moz180-branch-patcher2.cfg
|
||||
# Tag to use for building MAR/MBSDIFF and other update tools
|
||||
patcherToolsRev = UPDATE_PACKAGING_R1
|
||||
linux_verifyConfig = moz180-firefox-linux.cfg
|
||||
macosx_verifyConfig = moz180-firefox-mac.cfg
|
||||
win32_verifyConfig = moz180-firefox-win32.cfg
|
||||
blat = /cygdrive/c/moztools/bin/blat.exe
|
||||
sendmail = /usr/lib/sendmail
|
||||
# dump Log output to stdout
|
||||
dumpLogs = 1
|
||||
# username and server to push builds
|
||||
sshUser = cltbld
|
||||
sshServer = stage.mozilla.org
|
||||
# username and server to push update snippets
|
||||
ausUser = cltbld
|
||||
ausServer = aus2-staging.mozilla.org
|
||||
ausServerUrl = https://aus2.mozilla.org
|
||||
# force 1.8 specific behavior
|
||||
useTalkback = 1
|
||||
useTarGz = 1
|
||||
@@ -1,98 +0,0 @@
|
||||
version = 3.0.19
|
||||
appVersion = 3.0.19
|
||||
milestone = 1.9.0.19
|
||||
# _BUILDn and _RELEASE will be appended as-needed
|
||||
productTag = FIREFOX_3_0_19
|
||||
# Branch name and pull dates to use for base tag
|
||||
branchTag = HEAD
|
||||
#RelbranchOverride = GECKO190_20091130_RELBRANCH
|
||||
pullDate = 2010-03-10 13:13 PST
|
||||
l10n_pullDate = 2009-09-22 05:34 PDT
|
||||
build = 1
|
||||
# oldVersion and oldBuild refer to the previous release
|
||||
oldVersion = 3.0.18
|
||||
oldAppVersion = 3.0.18
|
||||
oldBuild = 1
|
||||
appName = browser
|
||||
product = firefox
|
||||
# Absolute path to tinderbox build directory
|
||||
# The win32 ones are kept short because of a long path issue detailed in
|
||||
# bug# 400846
|
||||
linux_buildDir = /builds/tinderbox/Fx-Mozilla1.9-Release
|
||||
macosx_buildDir = /builds/tinderbox/Fx-Mozilla1.9-Release
|
||||
win32_buildDir = /e/fx19rel
|
||||
linux_l10n_buildDir = /builds/tinderbox/Fx-Mozilla1.9-l10n-Release
|
||||
macosx_l10n_buildDir = /builds/tinderbox/Fx-Mozilla1.9-l10n-Release
|
||||
win32_l10n_buildDir = /e/fx19l10nrel
|
||||
# Absolute path to store bootstrap's logs
|
||||
linux_logDir = /builds/logs
|
||||
macosx_logDir = /builds/logs
|
||||
win32_logDir = /builds/logs
|
||||
mozillaCvsroot = cltbld@cvs.mozilla.org:/cvsroot
|
||||
l10nCvsroot = cltbld@cvs.mozilla.org:/l10n
|
||||
mofoCvsroot = cltbld@cvs.mozilla.org:/mofo
|
||||
anonCvsroot = :pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot
|
||||
# private staging area
|
||||
stageHome = /data/cltbld
|
||||
sourceDir = /builds/source
|
||||
updateDir = /builds/updates
|
||||
verifyDir = /builds/verify
|
||||
tagDir = /builds/tags
|
||||
configBumpDir = /builds/config
|
||||
# Build platform, as specified by tinderbox
|
||||
linux_buildPlatform = Linux_2.6.18-53.1.13.el5_Depend
|
||||
macosx_buildPlatform = Darwin_8.8.4_Depend
|
||||
win32_buildPlatform = WINNT_5.2_Depend
|
||||
linux_l10n_buildPlatform = Linux_2.6.18-53.1.13.el5_Depend
|
||||
macosx_l10n_buildPlatform = Darwin_8.8.4_Depend
|
||||
win32_l10n_buildPlatform = WINNT_5.2_Depend
|
||||
from = bootstrap@mozilla.org
|
||||
to = release@mozilla.com
|
||||
cc = nobody@mozilla.org
|
||||
patcherConfig = moz19-branch-patcher2.cfg
|
||||
# Tag to use for building MAR/MBSDIFF and other update tools
|
||||
patcherToolsRev = UPDATE_PACKAGING_R9
|
||||
linux_verifyConfig = moz19-firefox-linux.cfg
|
||||
win32_verifyConfig = moz19-firefox-win32.cfg
|
||||
macosx_verifyConfig = moz19-firefox-mac.cfg
|
||||
blat = /d/mozilla-build/blat261/full/blat.exe
|
||||
sendmail = /usr/sbin/sendmail
|
||||
# dump Log output to stdout
|
||||
dumpLogs = 1
|
||||
# symbol server variables
|
||||
symbolServer = dm-symbolpush01.mozilla.org
|
||||
symbolServerUser = ffxbld
|
||||
symbolServerPath = /mnt/netapp/breakpad/symbols_ffx
|
||||
win32_symbolServerKey = /c/Documents and Settings/cltbld/.ssh/ffxbld_dsa
|
||||
linux_symbolServerKey = /home/cltbld/.ssh/ffxbld_dsa
|
||||
macosx_symbolServerKey = /Users/cltbld/.ssh/ffxbld_dsa
|
||||
# username and server to push update snippets to
|
||||
ausUser = cltbld
|
||||
ausServer = aus2-staging.mozilla.org
|
||||
ausServerUrl = https://aus2.mozilla.org
|
||||
buildTree = MozillaRelease
|
||||
# where QA updates/builds go
|
||||
stagingUser = cltbld
|
||||
stagingServer = stage-old.mozilla.org
|
||||
# where beta updates/builds go
|
||||
ftpServer = ftp.mozilla.org
|
||||
# where release updates/builds go
|
||||
bouncerServer = download.mozilla.org
|
||||
# username and server to push builds
|
||||
sshUser = cltbld
|
||||
sshServer = stage-old.mozilla.org
|
||||
useTalkback = 0
|
||||
useCvsCompression = 1
|
||||
useBetaChannel = 1
|
||||
hgToolsRepo = https://hg.mozilla.org/build/tools
|
||||
hgToolsTag = default
|
||||
hgUsername = ffxbld
|
||||
win32_hgSshKey = /c/Documents and Settings/cltbld/.ssh/ffxbld_dsa
|
||||
linux_hgSshKey = /home/cltbld/.ssh/ffxbld_dsa
|
||||
macosx_hgSshKey = /Users/cltbld/.ssh/ffxbld_dsa
|
||||
bumpMilestoneTxt = 1
|
||||
hgPartnersRepo = https://hg.mozilla.org/build/partner-repacks
|
||||
hgPartnersTag = default
|
||||
partnerRepackDir = /builds/partners
|
||||
remoteRepackDir = /home/ftp/pub/mozilla.org/firefox/nightly/latest-mozilla1.9.0-partner-repacks
|
||||
partnerRepackCC = kev@mozilla.com,cbook@mozilla.com
|
||||
@@ -1,92 +0,0 @@
|
||||
version = nightly
|
||||
milestone = nightly
|
||||
# _BUILDn and _RELEASE will be appended as-needed
|
||||
# not used by nightly
|
||||
productTag = FIREFOX_3_0b5pre
|
||||
# Branch name and pull dates to use for base tag
|
||||
branchTag = test
|
||||
#RelbranchOverride = GECKO190_20071207_RELBRANCH
|
||||
# not used by nightly
|
||||
pullDate = 2008-01-08 18:00 PST
|
||||
l10n_pullDate = 2008-01-08 18:00 PST
|
||||
build = 1
|
||||
# oldVersion and oldRc refer to the previous release
|
||||
# not used by nightly
|
||||
oldVersion = 3.0b1
|
||||
oldBuild = 3
|
||||
# app name and product name
|
||||
appName = browser
|
||||
product = firefox
|
||||
# Absolute path to tinderbox build directory
|
||||
# The win32 ones are kept short because of a long path issue detailed in
|
||||
# bug# 400846
|
||||
linux_buildDir = /builds/tinderbox/Fx-Mozilla1.9-Nightly
|
||||
macosx_buildDir = /builds/tinderbox/Fx-Mozilla1.9-Nightly
|
||||
win32_buildDir = /e/fx19nit
|
||||
linux_l10n_buildDir = /builds/tinderbox/Fx-Mozilla1.9-l10n-Nightly
|
||||
macosx_l10n_buildDir = /builds/tinderbox/Fx-Mozilla1.9-l10n-Nightly
|
||||
win32_l10n_buildDir = /e/fx19l10nit
|
||||
# Absolute path to store bootstrap's logs
|
||||
linux_logDir = /builds/logs.nightly
|
||||
macosx_logDir = /builds/logs.nightly
|
||||
win32_logDir = /builds/logs.nightly
|
||||
mozillaCvsroot = :ext:cltbld@cvs.mozilla.org:/cvsroot
|
||||
l10nCvsroot = :ext:cltbld@cvs.mozilla.org:/l10n
|
||||
mofoCvsroot = :ext:cltbld@cvs.mozilla.org:/mofo
|
||||
anonCvsroot = :pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot
|
||||
# private staging area
|
||||
stageHome = /data/cltbld
|
||||
sourceDir = /builds/source
|
||||
updateDir = /builds/updates
|
||||
verifyDir = /builds/verify
|
||||
tagDir = /builds/tags
|
||||
configBumpDir = /builds/config
|
||||
# Build platform, as specified by tinderbox
|
||||
linux_buildPlatform = Linux_2.6.18-53.1.13.el5_Depend
|
||||
macosx_buildPlatform = Darwin_8.8.4_Depend
|
||||
win32_buildPlatform = WINNT_5.2_Depend
|
||||
linux_l10n_buildPlatform = Linux_2.6.18-53.1.13.el5_Depend
|
||||
macosx_l10n_buildPlatform = Darwin_8.8.4_Depend
|
||||
win32_l10n_buildPlatform = WINNT_5.2_Depend
|
||||
from = bootstrap@mozilla.org
|
||||
to = build-announce@mozilla.org
|
||||
cc = nobody@mozilla.org
|
||||
# not used by nightly
|
||||
patcherConfig = moz19-patcher2.cfg
|
||||
# Tag to use for building MAR/MBSDIFF and other update tools
|
||||
patcherToolsRev = UPDATE_PACKAGING_R1
|
||||
linux_verifyConfig = moz19-firefox-linux.cfg
|
||||
win32_verifyConfig = moz19-firefox-win32.cfg
|
||||
macosx_verifyConfig = moz19-firefox-mac.cfg
|
||||
blat = /d/mozilla-build/blat261/full/blat.exe
|
||||
sendmail = /usr/sbin/sendmail
|
||||
# dump Log output to stdout
|
||||
dumpLogs = 1
|
||||
# username and server to push update snippets to
|
||||
ausUser = cltbld
|
||||
ausServer = aus2-staging.mozilla.org
|
||||
ausServerUrl = https://aus2.mozilla.org
|
||||
buildTree = MozillaTest
|
||||
# where QA updates/builds go
|
||||
stagingUser = cltbld
|
||||
stagingServer = stage-old.mozilla.org
|
||||
# where beta updates/builds go
|
||||
ftpServer = ftp.mozilla.org
|
||||
# where release updates/builds go
|
||||
bouncerServer = download.mozilla.org
|
||||
# username and server to push builds
|
||||
sshUser = ffxbld
|
||||
sshServer = stage-old.mozilla.org
|
||||
useTalkback = 0
|
||||
# symbol server variables
|
||||
symbolServer = dm-symbolpush01.mozilla.org
|
||||
symbolServerUser = ffxbld
|
||||
symbolServerPath = /mnt/netapp/breakpad/symbols_ffx
|
||||
win32_symbolServerKey = /c/Documents and Settings/cltbld/.ssh/ffxbld_dsa
|
||||
linux_symbolServerKey = /home/cltbld/.ssh/ffxbld_dsa
|
||||
macosx_symbolServerKey = /Users/cltbld/.ssh/ffxbld_dsa
|
||||
useCvsCompression = 1
|
||||
testsPhoneHome = 0
|
||||
runMozillaTests = 1
|
||||
bootstrapTag = RELEASE_AUTOMATION_M8
|
||||
useBetaChannel = 0
|
||||
@@ -1,93 +0,0 @@
|
||||
version = nightly
|
||||
milestone = nightly
|
||||
# _BUILDn and _RELEASE will be appended as-needed
|
||||
# not used by nightly
|
||||
productTag = FIREFOX_3_0b2pre
|
||||
# Branch name and pull dates to use for base tag
|
||||
branchTag = HEAD
|
||||
#RelbranchOverride = GECKO190_20071207_RELBRANCH
|
||||
# not used by nightly
|
||||
pullDate = 2008-01-08 18:00 PST
|
||||
l10n_pullDate = 2008-01-08 18:00 PST
|
||||
build = 1
|
||||
# oldVersion and oldRc refer to the previous release
|
||||
# not used by nightly
|
||||
oldVersion = 3.0b1
|
||||
oldBuild = 3
|
||||
# app name and product name
|
||||
appName = browser
|
||||
product = firefox
|
||||
# Absolute path to tinderbox build directory
|
||||
# The win32 ones are kept short because of a long path issue detailed in
|
||||
# bug# 400846
|
||||
linux_buildDir = /builds/tinderbox/Fx-Mozilla1.9-Nightly
|
||||
macosx_buildDir = /builds/tinderbox/Fx-Mozilla1.9-Nightly
|
||||
win32_buildDir = /e/fx19nit
|
||||
linux_l10n_buildDir = /builds/tinderbox/Fx-Mozilla1.9-l10n-Nightly
|
||||
macosx_l10n_buildDir = /builds/tinderbox/Fx-Mozilla1.9-l10n-Nightly
|
||||
win32_l10n_buildDir = /e/fx19l10nit
|
||||
# Absolute path to store bootstrap's logs
|
||||
linux_logDir = /builds/logs.nightly
|
||||
macosx_logDir = /builds/logs.nightly
|
||||
win32_logDir = /builds/logs.nightly
|
||||
mozillaCvsroot = staging-1.9-master.build.mozilla.org:/builds/cvsmirror/cvsroot
|
||||
l10nCvsroot = staging-1.9-master.build.mozilla.org:/builds/cvsmirror/l10n
|
||||
mofoCvsroot = staging-1.9-master.build.mozilla.org:/builds/cvsmirror/mofo
|
||||
anonCvsroot = staging-1.9-master.build.mozilla.org:/builds/cvsmirror/cvsroot
|
||||
# private staging area
|
||||
stageHome = /data/cltbld
|
||||
sourceDir = /builds/source
|
||||
updateDir = /builds/updates
|
||||
verifyDir = /builds/verify
|
||||
tagDir = /builds/tags
|
||||
configBumpDir = /builds/config
|
||||
# Build platform, as specified by tinderbox
|
||||
linux_buildPlatform = Linux_2.6.18-53.1.13.el5_Depend
|
||||
macosx_buildPlatform = Darwin_8.8.4_Depend
|
||||
win32_buildPlatform = WINNT_5.2_Depend
|
||||
linux_l10n_buildPlatform = Linux_2.6.18-53.1.13.el5_Depend
|
||||
macosx_l10n_buildPlatform = Darwin_8.8.4_Depend
|
||||
win32_l10n_buildPlatform = WINNT_5.2_Depend
|
||||
from = staging-bootstrap@mozilla.org
|
||||
to = build-announce@mozilla.org
|
||||
cc = nobody@mozilla.org
|
||||
# not used by nightly
|
||||
patcherConfig = moz19-patcher2.cfg
|
||||
# Tag to use for building MAR/MBSDIFF and other update tools
|
||||
patcherToolsRev = UPDATE_PACKAGING_R1
|
||||
linux_verifyConfig = moz19-firefox-linux.cfg
|
||||
win32_verifyConfig = moz19-firefox-win32.cfg
|
||||
macosx_verifyConfig = moz19-firefox-mac.cfg
|
||||
blat = /d/mozilla-build/blat261/full/blat.exe
|
||||
sendmail = /usr/sbin/sendmail
|
||||
# dump Log output to stdout
|
||||
dumpLogs = 1
|
||||
# username and server to push update snippets to
|
||||
ausUser = cltbld
|
||||
ausServer = staging-1.9-master.build.mozilla.org
|
||||
ausServerUrl = http://staging-1.9-master.build.mozilla.org
|
||||
buildTree = Firefox-Staging
|
||||
# where QA updates/builds go
|
||||
stagingUser = cltbld
|
||||
stagingServer = fx-linux-1.9-slave1.build.mozilla.org
|
||||
# where beta updates/builds go
|
||||
ftpServer = fx-linux-1.9-slave1.build.mozilla.org
|
||||
# where release updates/builds go
|
||||
bouncerServer = fx-linux-1.9-slave1.build.mozilla.org
|
||||
# username and server to push builds
|
||||
sshUser = cltbld
|
||||
sshServer = fx-linux-1.9-slave1.build.mozilla.org
|
||||
useTalkback = 0
|
||||
# symbol server variables
|
||||
symbolServer = staging-1.9-master.build.mozilla.org
|
||||
symbolServerUser = cltbld
|
||||
symbolServerPath = /data/symbols
|
||||
win32_symbolServerKey = /c/Documents and Settings/cltbld/.ssh/ffxbld_dsa
|
||||
linux_symbolServerKey = /home/cltbld/.ssh/ffxbld_dsa
|
||||
macosx_symbolServerKey = /Users/cltbld/.ssh/ffxbld_dsa
|
||||
useCvsCompression = 1
|
||||
# turn off tests
|
||||
testsPhoneHome = 0
|
||||
bootstrapTag = RELEASE_AUTOMATION_M8
|
||||
runMozillaTests = 1
|
||||
useBetaChannel = 0
|
||||
@@ -1,98 +0,0 @@
|
||||
version = 3.0.11
|
||||
appVersion = 3.0.11
|
||||
milestone = 1.9.0.11
|
||||
# _BUILDn and _RELEASE will be appended as-needed
|
||||
productTag = FIREFOX_3_0_11
|
||||
# Branch name and pull dates to use for base tag
|
||||
branchTag = HEAD
|
||||
RelbranchOverride = GECKO190_20090519_RELBRANCH
|
||||
pullDate = 2009-05-18 15:48 PDT
|
||||
l10n_pullDate = 2009-05-01 06:33 PDT
|
||||
build = 2
|
||||
# oldVersion and oldBuild refer to the previous release
|
||||
oldVersion = 3.0.10
|
||||
oldAppVersion = 3.0.10
|
||||
oldBuild = 1
|
||||
appName = browser
|
||||
product = firefox
|
||||
# Absolute path to tinderbox build directory
|
||||
# The win32 ones are kept short because of a long path issue detailed in
|
||||
# bug# 400846
|
||||
linux_buildDir = /builds/tinderbox/Fx-Mozilla1.9-Release
|
||||
macosx_buildDir = /builds/tinderbox/Fx-Mozilla1.9-Release
|
||||
win32_buildDir = /e/fx19rel
|
||||
linux_l10n_buildDir = /builds/tinderbox/Fx-Mozilla1.9-l10n-Release
|
||||
macosx_l10n_buildDir = /builds/tinderbox/Fx-Mozilla1.9-l10n-Release
|
||||
win32_l10n_buildDir = /e/fx19l10nrel
|
||||
# Absolute path to store bootstrap's logs
|
||||
linux_logDir = /builds/logs
|
||||
macosx_logDir = /builds/logs
|
||||
win32_logDir = /builds/logs
|
||||
mozillaCvsroot = staging-1.9-master.build.mozilla.org:/builds/cvsmirror/cvsroot
|
||||
l10nCvsroot = staging-1.9-master.build.mozilla.org:/builds/cvsmirror/l10n
|
||||
mofoCvsroot = staging-1.9-master.build.mozilla.org:/builds/cvsmirror/mofo
|
||||
anonCvsroot = staging-1.9-master.build.mozilla.org:/builds/cvsmirror/cvsroot
|
||||
# private staging area
|
||||
stageHome = /data/cltbld
|
||||
sourceDir = /builds/source
|
||||
updateDir = /builds/updates
|
||||
verifyDir = /builds/verify
|
||||
tagDir = /builds/tags
|
||||
configBumpDir = /builds/config
|
||||
# Build platform, as specified by tinderbox
|
||||
linux_buildPlatform = Linux_2.6.18-53.1.14.el5_Depend
|
||||
macosx_buildPlatform = Darwin_8.8.4_Depend
|
||||
win32_buildPlatform = WINNT_5.2_Depend
|
||||
linux_l10n_buildPlatform = Linux_2.6.18-53.1.14.el5_Depend
|
||||
macosx_l10n_buildPlatform = Darwin_8.8.4_Depend
|
||||
win32_l10n_buildPlatform = WINNT_5.2_Depend
|
||||
from = staging-bootstrap@mozilla.org
|
||||
to = build-announce@mozilla.org
|
||||
cc = nobody@mozilla.org
|
||||
patcherConfig = moz19-branch-patcher2.cfg
|
||||
# Tag to use for building MAR/MBSDIFF and other update tools
|
||||
patcherToolsRev = UPDATE_PACKAGING_R8
|
||||
linux_verifyConfig = moz19-firefox-linux.cfg
|
||||
win32_verifyConfig = moz19-firefox-win32.cfg
|
||||
macosx_verifyConfig = moz19-firefox-mac.cfg
|
||||
blat = /d/mozilla-build/blat261/full/blat.exe
|
||||
sendmail = /usr/sbin/sendmail
|
||||
# dump Log output to stdout
|
||||
dumpLogs = 1
|
||||
# symbol server variables
|
||||
symbolServer = staging-1.9-master.build.mozilla.org
|
||||
symbolServerUser = cltbld
|
||||
symbolServerPath = /data/symbols
|
||||
win32_symbolServerKey = /c/Documents and Settings/cltbld/.ssh/ffxbld_dsa
|
||||
linux_symbolServerKey = /home/cltbld/.ssh/ffxbld_dsa
|
||||
macosx_symbolServerKey = /Users/cltbld/.ssh/ffxbld_dsa
|
||||
# username and server to push update snippets to
|
||||
ausUser = cltbld
|
||||
ausServer = staging-1.9-master.build.mozilla.org
|
||||
ausServerUrl = http://staging-1.9-master.build.mozilla.org
|
||||
buildTree = MozillaTest
|
||||
# where QA updates/builds go
|
||||
stagingUser = cltbld
|
||||
stagingServer = fx-linux-1.9-slave1.build.mozilla.org
|
||||
# where beta updates/builds go
|
||||
ftpServer = fx-linux-1.9-slave1.build.mozilla.org
|
||||
# where release updates/builds go
|
||||
bouncerServer = fx-linux-1.9-slave1.build.mozilla.org
|
||||
# username and server to push builds
|
||||
sshUser = cltbld
|
||||
sshServer = fx-linux-1.9-slave1.build.mozilla.org
|
||||
useTalkback = 0
|
||||
useCvsCompression = 1
|
||||
useBetaChannel = 1
|
||||
hgToolsRepo = https://hg.mozilla.org/users/stage-ffxbld/tools
|
||||
hgToolsTag = default
|
||||
hgUsername = stage-ffxbld
|
||||
win32_hgSshKey = /c/Documents and Settings/cltbld/.ssh/ffxbld_dsa
|
||||
linux_hgSshKey = /home/cltbld/.ssh/ffxbld_dsa
|
||||
macosx_hgSshKey = /Users/cltbld/.ssh/ffxbld_dsa
|
||||
bumpMilestoneTxt = 1
|
||||
hgPartnersRepo = https://hg.mozilla.org/build/partner-repacks
|
||||
hgPartnersTag = default
|
||||
partnerRepackDir = /builds/partners
|
||||
remoteRepackDir = /home/ftp/pub/mozilla.org/firefox/nightly/latest-mozilla1.9.0-partner-repacks
|
||||
partnerRepackCC = ccooper@deadsquid.com
|
||||
@@ -1,82 +0,0 @@
|
||||
branchTag = MOZILLA_1_8_BRANCH
|
||||
# this won't actually be used, it's a record-keeping placeholder
|
||||
pullDate = 2010-02-26 08:40 PST
|
||||
l10n_pullDate = 2009-08-12 08:29 PDT
|
||||
# RelbranchOverride = GECKO181_20080603_RELBRANCH
|
||||
milestone = 1.8.1.24
|
||||
version = 2.0.0.24
|
||||
build = 1
|
||||
# _BUILDn and _RELEASE will be appended as-needed
|
||||
productTag = THUNDERBIRD_2_0_0_24
|
||||
oldVersion = 2.0.0.23
|
||||
oldBuild = 1
|
||||
appName = mail
|
||||
product = thunderbird
|
||||
linux_buildDir = /builds/tinderbox/Tb-Mozilla1.8-Release
|
||||
linux_l10n_buildDir = /builds/tinderbox/Tb-Mozilla1.8-l10n-Release
|
||||
macosx_buildDir = /builds/tinderbox/Tb-Mozilla1.8-Release
|
||||
macosx_l10n_buildDir = /builds/tinderbox/Tb-Mozilla1.8-l10n-Release
|
||||
win32_buildDir = /cygdrive/e/builds/tinderbox/Tb-Mozilla1.8-Release
|
||||
win32_l10n_buildDir = /cygdrive/e/builds/tinderbox/Tb-Mozilla1.8-l10n-Release
|
||||
logDir = /builds/release/logs
|
||||
# NB this will need to be changed locally on the l10n box
|
||||
win32_logDir = /builds/release/logs
|
||||
mozillaCvsroot = :ext:cltbld@cvs.mozilla.org:/cvsroot
|
||||
l10nCvsroot = :ext:cltbld@cvs.mozilla.org:/l10n
|
||||
mofoCvsroot = :ext:cltbld@cvs.mozilla.org:/mofo
|
||||
anonCvsroot = :pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot
|
||||
stageHome = /data/cltbld
|
||||
sourceDir = /builds/source
|
||||
updateDir = /builds/updates
|
||||
verifyDir = /builds/verify
|
||||
tagDir = /builds/tags
|
||||
symbolDir = /builds/symbols
|
||||
configBumpDir = /builds/config
|
||||
linux_buildPlatform = Linux_2.4.18-14_Depend
|
||||
macosx_buildPlatform = Darwin_8.7.0_Depend
|
||||
win32_buildPlatform = WINNT_5.0_Depend
|
||||
linux_l10n_buildPlatform = Linux_2.4.18-14_Depend
|
||||
macosx_l10n_buildPlatform = Darwin_8.7.0_Depend
|
||||
win32_l10n_buildPlatform = WINNT_5.0_Depend
|
||||
from = bootstrap@mozilla.org
|
||||
to = release@mozilla.com
|
||||
cc = nobody@mozilla.org
|
||||
patcherConfig = moz18-branch-patcher2.cfg
|
||||
patcherToolsRev = UPDATE_PACKAGING_R7
|
||||
linux_verifyConfig = moz18-thunderbird-linux.cfg
|
||||
macosx_verifyConfig = moz18-thunderbird-mac.cfg
|
||||
win32_verifyConfig = moz18-thunderbird-win32.cfg
|
||||
blat = /cygdrive/c/moztools/bin/blat.exe
|
||||
sendmail = /usr/sbin/sendmail
|
||||
dumpLogs = 1
|
||||
# username and server to push update snippets to
|
||||
ausUser = cltbld
|
||||
ausServer = aus2-staging.mozilla.org
|
||||
ausServerUrl = https://aus2.mozilla.org
|
||||
# Tinderbox server tree that clients should report to
|
||||
buildTree = MozillaRelease
|
||||
# where QA updates/builds go
|
||||
stagingUser = cltbld
|
||||
stagingServer = stage-old.mozilla.org
|
||||
# where beta updates/builds go
|
||||
ftpServer = ftp.mozilla.org
|
||||
# where release updates/builds go
|
||||
bouncerServer = download.mozilla.org
|
||||
# username and server to push builds
|
||||
sshUser = cltbld
|
||||
sshServer = stage-old.mozilla.org
|
||||
# force 1.8 specific behavior
|
||||
useTalkback = 0
|
||||
symbolServer = stage-old.mozilla.org
|
||||
symbolServerUser = tbirdbld
|
||||
symbolServerPath = /mnt/breakpad_symbols/symbols_tbrd
|
||||
symbolServerKey = /home/cltbld/.ssh/tbirdbld_dsa
|
||||
useTarGz = 1
|
||||
useBetaChannel = 1
|
||||
hgToolsRepo = https://hg.mozilla.org/build/tools
|
||||
hgToolsTag = default
|
||||
hgUsername = ffxbld
|
||||
win32_hgSshKey = /home/cltbld/.ssh/ffxbld_dsa
|
||||
linux_hgSshKey = /home/cltbld/.ssh/ffxbld_dsa
|
||||
macosx_hgSshKey = /Users/cltbld/.ssh/ffxbld_dsa
|
||||
bumpMilestoneTxt = 1
|
||||
@@ -1,82 +0,0 @@
|
||||
branchTag = MOZILLA_1_8_BRANCH
|
||||
# these two won't actually be used for nightly builds
|
||||
pullDate = 2009-06-03 11:32 PDT
|
||||
l10n_pullDate = 2009-06-03 11:32 PDT
|
||||
# RelbranchOverride = GECKO181_20080603_RELBRANCH
|
||||
milestone = nightly
|
||||
version = nightly
|
||||
build = 1
|
||||
# _BUILDn and _RELEASE will be appended as-needed
|
||||
productTag = THUNDERBIRD_2_0_0_22
|
||||
oldVersion = 2.0.0.21
|
||||
oldBuild = 1
|
||||
appName = mail
|
||||
product = thunderbird
|
||||
linux_buildDir = /builds/tinderbox/Tb-Mozilla1.8-Nightly
|
||||
linux_l10n_buildDir = /builds/tinderbox/Tb-Mozilla1.8-l10n-Nightly
|
||||
macosx_buildDir = /builds/tinderbox/Tb-Mozilla1.8-Nightly
|
||||
macosx_l10n_buildDir = /builds/tinderbox/Tb-Mozilla1.8-l10n-Nightly
|
||||
win32_buildDir = /cygdrive/e/builds/tinderbox/Tb-Mozilla1.8-Nightly
|
||||
win32_l10n_buildDir = /cygdrive/e/builds/tinderbox/Tb-Mozilla1.8-l10n-Nightly
|
||||
logDir = /builds/logs.nightly
|
||||
# NB this will need to be changed locally on the l10n box
|
||||
win32_logDir = /builds/logs.nightly
|
||||
mozillaCvsroot = :ext:cltbld@cvs.mozilla.org:/cvsroot
|
||||
l10nCvsroot = :ext:cltbld@cvs.mozilla.org:/l10n
|
||||
mofoCvsroot = :ext:cltbld@cvs.mozilla.org:/mofo
|
||||
anonCvsroot = :pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot
|
||||
stageHome = /data/cltbld
|
||||
sourceDir = /builds/source
|
||||
updateDir = /builds/updates
|
||||
verifyDir = /builds/verify
|
||||
tagDir = /builds/tags
|
||||
symbolDir = /builds/symbols
|
||||
configBumpDir = /builds/config
|
||||
linux_buildPlatform = Linux_2.4.18-14_Depend
|
||||
macosx_buildPlatform = Darwin_8.7.0_Depend
|
||||
win32_buildPlatform = WINNT_5.0_Depend
|
||||
linux_l10n_buildPlatform = Linux_2.4.18-14_Depend
|
||||
macosx_l10n_buildPlatform = Darwin_8.7.0_Depend
|
||||
win32_l10n_buildPlatform = WINNT_5.0_Depend
|
||||
from = bootstrap@mozilla.org
|
||||
to = build-announce@mozilla.org
|
||||
cc = nobody@mozilla.org
|
||||
patcherConfig = moz18-branch-patcher2.cfg
|
||||
patcherToolsRev = UPDATE_PACKAGING_R8
|
||||
linux_verifyConfig = moz18-thunderbird-linux.cfg
|
||||
macosx_verifyConfig = moz18-thunderbird-mac.cfg
|
||||
win32_verifyConfig = moz18-thunderbird-win32.cfg
|
||||
blat = /cygdrive/c/moztools/bin/blat.exe
|
||||
sendmail = /usr/sbin/sendmail
|
||||
dumpLogs = 1
|
||||
# username and server to push update snippets to
|
||||
ausUser = cltbld
|
||||
ausServer = aus2-staging.mozilla.org
|
||||
ausServerUrl = https://aus2.mozilla.org
|
||||
# Tinderbox server tree that clients should report to
|
||||
buildTree = Mozilla1.8
|
||||
# where QA updates/builds go
|
||||
stagingUser = cltbld
|
||||
stagingServer = stage-old.mozilla.org
|
||||
# where beta updates/builds go
|
||||
ftpServer = ftp.mozilla.org
|
||||
# where release updates/builds go
|
||||
bouncerServer = download.mozilla.org
|
||||
# username and server to push builds
|
||||
sshUser = tbirdbld
|
||||
sshServer = stage-old.mozilla.org
|
||||
# force 1.8 specific behavior
|
||||
useTalkback = 0
|
||||
symbolServer = stage-old.mozilla.org
|
||||
symbolServerUser = tbirdbld
|
||||
symbolServerPath = /mnt/netapp/breakpad/symbols_tbrd
|
||||
symbolServerKey = /home/cltbld/.ssh/tbirdbld_dsa
|
||||
useTarGz = 1
|
||||
useBetaChannel = 1
|
||||
hgToolsRepo = https://hg.mozilla.org/build/tools
|
||||
hgToolsTag = default
|
||||
hgUsername = ffxbld
|
||||
win32_hgSshKey = /home/cltbld/.ssh/ffxbld_dsa
|
||||
linux_hgSshKey = /home/cltbld/.ssh/ffxbld_dsa
|
||||
macosx_hgSshKey = /Users/cltbld/.ssh/ffxbld_dsa
|
||||
bumpMilestoneTxt = 1
|
||||
@@ -1,89 +0,0 @@
|
||||
version = 2.0.0.21
|
||||
milestone = 1.8.1.21
|
||||
# _BUILDn and _RELEASE will be appended as-needed
|
||||
productTag = THUNDERBIRD_2_0_0_21
|
||||
# Branch name and pull dates to use for base tag
|
||||
branchTag = MOZILLA_1_8_BRANCH
|
||||
#RelbranchOverride = GECKO181_20071115_RELBRANCH
|
||||
pullDate = 2009-03-01 16:14 PST
|
||||
l10n_pullDate = 2009-03-01 16:14 PST
|
||||
build = 1
|
||||
# oldVersion and oldRc refer to the previous release
|
||||
oldVersion = 2.0.0.19
|
||||
oldBuild = 1
|
||||
appName = mail
|
||||
product = thunderbird
|
||||
# Absolute path to tinderbox build directory
|
||||
linux_buildDir = /builds/tinderbox/Tb-Mozilla1.8-Release
|
||||
macosx_buildDir = /builds/tinderbox/Tb-Mozilla1.8-Release
|
||||
win32_buildDir = /cygdrive/e/builds/tinderbox/Tb-Mozilla1.8-Release
|
||||
linux_l10n_buildDir = /builds/tinderbox/Tb-Mozilla1.8-l10n-Release
|
||||
macosx_l10n_buildDir = /builds/tinderbox/Tb-Mozilla1.8-l10n-Release
|
||||
win32_l10n_buildDir = /cygdrive/e/builds/tinderbox/Tb-Mozilla1.8-l10n-Release
|
||||
# Absolute path to store bootstrap's logs
|
||||
linux_logDir = /builds/logs
|
||||
macosx_logDir = /builds/logs
|
||||
win32_logDir = /builds/logs
|
||||
mozillaCvsroot = staging-stage.build.mozilla.org:/builds/cvsmirrors/staging-1.8/cvsroot
|
||||
l10nCvsroot = staging-stage.build.mozilla.org:/builds/cvsmirrors/staging-1.8/l10n
|
||||
mofoCvsroot = staging-stage.build.mozilla.org:/builds/cvsmirrors/staging-1.8/mofo
|
||||
anonCvsroot = :pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot
|
||||
# private staging area
|
||||
stageHome = /data/cltbld
|
||||
sourceDir = /builds/source
|
||||
updateDir = /builds/updates
|
||||
verifyDir = /builds/verify
|
||||
tagDir = /builds/tags
|
||||
configBumpDir = /builds/config
|
||||
symbolDir = /builds/symbols
|
||||
# Build platform, as specified by tinderbox
|
||||
linux_buildPlatform = Linux_2.4.18-14_Depend
|
||||
macosx_buildPlatform = Darwin_8.7.0_Depend
|
||||
win32_buildPlatform = WINNT_5.0_Depend
|
||||
linux_l10n_buildPlatform = Linux_2.4.18-14_Depend
|
||||
macosx_l10n_buildPlatform = Darwin_8.7.0_Depend
|
||||
win32_l10n_buildPlatform = WINNT_5.0_Depend
|
||||
from = staging-bootstrap@mozilla.org
|
||||
to = nrthomas@gmail.com
|
||||
cc = nobody@mozilla.org
|
||||
patcherConfig = moz18-branch-patcher2.cfg
|
||||
# Tag to use for building MAR/MBSDIFF and other update tools
|
||||
patcherToolsRev = UPDATE_PACKAGING_R7
|
||||
linux_verifyConfig = moz18-thunderbird-linux.cfg
|
||||
win32_verifyConfig = moz18-thunderbird-win32.cfg
|
||||
macosx_verifyConfig = moz18-thunderbird-mac.cfg
|
||||
blat = /cygdrive/c/moztools/bin/blat.exe
|
||||
sendmail = /usr/sbin/sendmail
|
||||
# dump Log output to stdout
|
||||
dumpLogs = 1
|
||||
# username and server to push update snippets to
|
||||
ausUser = cltbld
|
||||
ausServer = staging-stage.build.mozilla.org
|
||||
ausServerUrl = http://staging-stage.build.mozilla.org
|
||||
# Tinderbox server tree that clients should report to
|
||||
buildTree = MozillaTest
|
||||
# where QA updates/builds go
|
||||
stagingUser = cltbld
|
||||
stagingServer = staging-prometheus-vm.build.mozilla.org
|
||||
# where beta updates/builds go
|
||||
ftpServer = staging-prometheus-vm.build.mozilla.org
|
||||
# where release updates/builds go
|
||||
bouncerServer = staging-prometheus-vm.build.mozilla.org
|
||||
# username and server to push builds
|
||||
sshUser = cltbld
|
||||
sshServer = staging-prometheus-vm.build.mozilla.org
|
||||
# force 1.8 specific behavior
|
||||
useTalkback = 0
|
||||
symbolServer = staging-stage.build.mozilla.org
|
||||
symbolServerUser = cltbld
|
||||
symbolServerPath = /data/symbols
|
||||
symbolServerKey = /home/cltbld/.ssh/id_rsa
|
||||
useTarGz = 1
|
||||
useBetaChannel = 1
|
||||
hgToolsRepo = https://hg.mozilla.org/users/stage-ffxbld/tools
|
||||
hgToolsTag = default
|
||||
hgUsername = stage-ffxbld
|
||||
win32_hgSshKey = /home/cltbld/.ssh/ffxbld_dsa
|
||||
linux_hgSshKey = /home/cltbld/.ssh/ffxbld_dsa
|
||||
macosx_hgSshKey = /Users/cltbld/.ssh/ffxbld_dsa
|
||||
bumpMilestoneTxt = 1
|
||||
@@ -1,74 +0,0 @@
|
||||
version = 1.5.0.14
|
||||
milestone = 1.8.0.14
|
||||
# _BUILDn and _RELEASE will be appended as-needed
|
||||
productTag = THUNDERBIRD_1_5_0_14
|
||||
# Branch name and pull dates to use for base tag
|
||||
branchTag = MOZILLA_1_8_0_BRANCH
|
||||
pullDate = 2007-12-07 11:34 PST
|
||||
l10n_pullDate = 2007-12-07 11:34 PST
|
||||
build = 1
|
||||
# oldVersion and oldRc refer to the previous release
|
||||
oldVersion = 1.5.0.13
|
||||
oldBuild = 1
|
||||
appName = mail
|
||||
product = thunderbird
|
||||
# Absolute path to tinderbox build directory
|
||||
linux_buildDir = /builds/tinderbox/Tb-Mozilla1.8.0-Release
|
||||
macosx_buildDir = /builds/tinderbox/Tb-Mozilla1.8.0-Release
|
||||
win32_buildDir = /cygdrive/c/builds/tinderbox/Tb-Mozilla1.8.0-Release
|
||||
linux_l10n_buildDir = /builds/tinderbox/Tb-Mozilla1.8.0-l10n-Release
|
||||
macosx_l10n_buildDir = /builds/tinderbox/Tb-Mozilla1.8.0-l10n-Release
|
||||
win32_l10n_buildDir = /cygdrive/c/builds/tinderbox/Tb-Mozilla1.8.0-l10n-Release
|
||||
# Absolute path to store bootstrap's logs
|
||||
logDir = /builds/release/logs
|
||||
win32_logDir = /cygdrive/c/builds/release/logs
|
||||
mozillaCvsroot = :ext:cltbld@cvs.mozilla.org:/cvsroot
|
||||
l10nCvsroot = :ext:cltbld@cvs.mozilla.org:/l10n
|
||||
mofoCvsroot = :ext:cltbld@cvs.mozilla.org:/mofo
|
||||
anonCvsroot = :pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot
|
||||
# private staging area
|
||||
stageHome = /data/cltbld
|
||||
sourceDir = /builds/source
|
||||
updateDir = /builds/updates
|
||||
verifyDir = /builds/verify
|
||||
tagDir = /builds/tags
|
||||
configBumpDir = /builds/config
|
||||
# Build platform, as specified by tinderbox
|
||||
linux_buildPlatform = Linux_2.4.18-14_Depend
|
||||
macosx_buildPlatform = Darwin_8.7.0_Depend
|
||||
win32_buildPlatform = WINNT_5.2_Depend
|
||||
linux_l10n_buildPlatform = Linux_2.4.18-14_Depend
|
||||
macosx_l10n_buildPlatform = Darwin_8.7.0_Depend
|
||||
win32_l10n_buildPlatform = WINNT_5.2_Depend
|
||||
from = build@mozilla.org
|
||||
to = nrthomas@gmail.com
|
||||
# cc = other@example.com
|
||||
patcherConfig = moz180-branch-patcher2.cfg
|
||||
# Tag to use for building MAR/MBSDIFF and other update tools
|
||||
patcherToolsRev = UPDATE_PACKAGING_R1
|
||||
linux_verifyConfig = moz180-thunderbird-linux.cfg
|
||||
macosx_verifyConfig = moz180-thunderbird-mac.cfg
|
||||
win32_verifyConfig = moz180-thunderbird-win32.cfg
|
||||
blat = /cygdrive/c/moztools/bin/blat.exe
|
||||
sendmail = /usr/lib/sendmail
|
||||
# dump Log output to stdout
|
||||
dumpLogs = 1
|
||||
# username and server to push update snippets to
|
||||
ausUser = cltbld
|
||||
ausServer = aus2-staging.mozilla.org
|
||||
ausServerUrl = https://aus2.mozilla.org
|
||||
# Tinderbox server tree that clients should report to
|
||||
buildTree = MozillaRelease
|
||||
# where QA updates/builds go
|
||||
stagingUser = cltbld
|
||||
stagingServer = stage-old.build.mozilla.org
|
||||
# where beta updates/builds go
|
||||
ftpServer = ftp.mozilla.org
|
||||
# where release updates/builds go
|
||||
bouncerServer = download.mozilla.org
|
||||
# username and server to push builds
|
||||
sshUser = cltbld
|
||||
sshServer = stage-old.build.mozilla.org
|
||||
# force 1.8 specific behavior
|
||||
useTalkback = 1
|
||||
useTarGz = 1
|
||||
@@ -1,92 +0,0 @@
|
||||
version = 3.0a2
|
||||
# not really, we just need the first three digits and dots for
|
||||
# creating the relbranch name
|
||||
milestone = 1.9.0.1
|
||||
# _BUILDn and _RELEASE will be appended as-needed
|
||||
productTag = THUNDERBIRD_3_0a2
|
||||
# Branch name and pull dates to use for base tag
|
||||
branchTag = HEAD
|
||||
#RelbranchOverride = GECKO19b5_20080326_RELBRANCH
|
||||
pullDate = 2008-07-14 12:00 PDT
|
||||
l10n_pullDate = 2008-07-14 12:00 PDT
|
||||
build = 1
|
||||
# oldVersion and oldBuild refer to the previous release
|
||||
oldVersion = 3.0a1
|
||||
oldBuild = 1
|
||||
appName = mail
|
||||
product = thunderbird
|
||||
# Absolute path to tinderbox build directory
|
||||
# The win32 ones are kept short because of a long path issue detailed in
|
||||
# bug# 400846
|
||||
linux_buildDir = /builds/tinderbox/Tb-Mozilla1.9-Release
|
||||
macosx_buildDir = /builds/tinderbox/Tb-Mozilla1.9-Release
|
||||
win32_buildDir = /e/tb19rel
|
||||
linux_l10n_buildDir = /builds/tinderbox/Tb-Mozilla1.9-l10n-Release
|
||||
macosx_l10n_buildDir = /builds/tinderbox/Tb-Mozilla1.9-l10n-Release
|
||||
win32_l10n_buildDir = /e/tb19l10nrel
|
||||
# Absolute path to store bootstrap's logs
|
||||
linux_logDir = /builds/logs
|
||||
macosx_logDir = /builds/logs
|
||||
win32_logDir = /builds/logs
|
||||
mozillaCvsroot = cltbld@cvs.mozilla.org:/cvsroot
|
||||
l10nCvsroot = cltbld@cvs.mozilla.org:/l10n
|
||||
mofoCvsroot = cltbld@cvs.mozilla.org:/mofo
|
||||
anonCvsroot = :pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot
|
||||
# private staging area
|
||||
stageHome = /data/cltbld
|
||||
sourceDir = /builds/source
|
||||
updateDir = /builds/updates
|
||||
verifyDir = /builds/verify
|
||||
tagDir = /builds/tags
|
||||
configBumpDir = /builds/config
|
||||
# Build platform, as specified by tinderbox
|
||||
linux_buildPlatform = Linux_2.6.18-53.1.13.el5_Depend
|
||||
macosx_buildPlatform = Darwin_8.8.4_Depend
|
||||
win32_buildPlatform = WINNT_5.2_Depend
|
||||
linux_l10n_buildPlatform = Linux_2.6.18-53.1.13.el5_Depend
|
||||
macosx_l10n_buildPlatform = Darwin_8.8.4_Depend
|
||||
win32_l10n_buildPlatform = WINNT_5.2_Depend
|
||||
from = bootstrap@mozilla.org
|
||||
to = nrthomas@gmail.com
|
||||
cc = gozer@mozillamessaging.com
|
||||
patcherConfig = moz19-branch-patcher2.cfg
|
||||
# Tag to use for building MAR/MBSDIFF and other update tools
|
||||
patcherToolsRev = UPDATE_PACKAGING_R4
|
||||
linux_verifyConfig = moz19-thunderbird-linux.cfg
|
||||
win32_verifyConfig = moz19-thunderbird-win32.cfg
|
||||
macosx_verifyConfig = moz19-thunderbird-mac.cfg
|
||||
blat = /d/mozilla-build/blat261/full/blat.exe
|
||||
sendmail = /usr/sbin/sendmail
|
||||
# dump Log output to stdout
|
||||
dumpLogs = 1
|
||||
# symbol server variables
|
||||
symbolServer = dm-symbolpush01.mozilla.org
|
||||
symbolServerUser = tbirdbld
|
||||
symbolServerPath = /mnt/netapp/breakpad/symbols_tbrd
|
||||
win32_symbolServerKey = /c/Documents and Settings/cltbld/.ssh/tbirdbld_dsa
|
||||
linux_symbolServerKey = /home/cltbld/.ssh/tbirdbld_dsa
|
||||
macosx_symbolServerKey = /Users/cltbld/.ssh/tbirdbld_dsa
|
||||
# username and server to push update snippets to
|
||||
ausUser = cltbld
|
||||
ausServer = aus2-staging.mozilla.org
|
||||
ausServerUrl = https://aus2.mozilla.org
|
||||
buildTree = MozillaRelease
|
||||
# where QA updates/builds go
|
||||
stagingUser = cltbld
|
||||
stagingServer = stage-old.mozilla.org
|
||||
# where beta updates/builds go
|
||||
ftpServer = ftp.mozilla.org
|
||||
# where release updates/builds go
|
||||
bouncerServer = download.mozilla.org
|
||||
# username and server to push builds
|
||||
sshUser = cltbld
|
||||
sshServer = stage-old.mozilla.org
|
||||
useTalkback = 0
|
||||
useCvsCompression = 1
|
||||
useBetaChannel = 0
|
||||
hgToolsRepo = https://hg.mozilla.org/build/tools
|
||||
hgToolsTag = default
|
||||
hgUsername = ffxbld
|
||||
win32_hgSshKey = /c/Documents and Settings/cltbld/.ssh/ffxbld_dsa
|
||||
linux_hgSshKey = /home/cltbld/.ssh/ffxbld_dsa
|
||||
macosx_hgSshKey = /Users/cltbld/.ssh/ffxbld_dsa
|
||||
@@ -1,90 +0,0 @@
|
||||
version = 3.0a2
|
||||
milestone = 1.9.0.1pre
|
||||
# _BUILDn and _RELEASE will be appended as-needed
|
||||
productTag = THUNDERBIRD_3_0a2
|
||||
# Branch name and pull dates to use for base tag
|
||||
branchTag = HEAD
|
||||
#RelbranchOverride = GECKO190_20071207_RELBRANCH
|
||||
pullDate = 2008-06-26 09:40 PDT
|
||||
l10n_pullDate = 2008-06-26 09:40 PDT
|
||||
build = 1
|
||||
# oldVersion and oldRc refer to the previous release
|
||||
oldVersion = 3.0a1
|
||||
oldBuild = 1
|
||||
appName = mail
|
||||
product = thunderbird
|
||||
# Absolute path to tinderbox build directory
|
||||
# The win32 ones are kept short because of a long path issue detailed in
|
||||
# bug# 400846
|
||||
linux_buildDir = /builds/tinderbox/Tb-Mozilla1.9-Release
|
||||
macosx_buildDir = /builds/tinderbox/Tb-Mozilla1.9-Release
|
||||
win32_buildDir = /e/tb19rel
|
||||
linux_l10n_buildDir = /builds/tinderbox/Tb-Mozilla1.9-l10n-Release
|
||||
macosx_l10n_buildDir = /builds/tinderbox/Tb-Mozilla1.9-l10n-Release
|
||||
win32_l10n_buildDir = /e/tb19l10nrel
|
||||
# Absolute path to store bootstrap's logs
|
||||
linux_logDir = /builds/logs
|
||||
macosx_logDir = /builds/logs
|
||||
win32_logDir = /builds/logs
|
||||
mozillaCvsroot = staging-1.9-master.build.mozilla.org:/builds/cvsmirror/cvsroot
|
||||
l10nCvsroot = staging-1.9-master.build.mozilla.org:/builds/cvsmirror/l10n
|
||||
mofoCvsroot = staging-1.9-master.build.mozilla.org:/builds/cvsmirror/mofo
|
||||
anonCvsroot = staging-1.9-master.build.mozilla.org:/builds/cvsmirror/cvsroot
|
||||
# private staging area
|
||||
stageHome = /data/cltbld
|
||||
sourceDir = /builds/source
|
||||
updateDir = /builds/updates
|
||||
verifyDir = /builds/verify
|
||||
tagDir = /builds/tags
|
||||
configBumpDir = /builds/config
|
||||
# Build platform, as specified by tinderbox
|
||||
linux_buildPlatform = Linux_2.6.18-53.1.14.el5_Depend
|
||||
macosx_buildPlatform = Darwin_8.8.4_Depend
|
||||
win32_buildPlatform = WINNT_5.2_Depend
|
||||
linux_l10n_buildPlatform = Linux_2.6.18-53.1.14.el5_Depend
|
||||
macosx_l10n_buildPlatform = Darwin_8.8.4_Depend
|
||||
win32_l10n_buildPlatform = WINNT_5.2_Depend
|
||||
from = staging-bootstrap@mozilla.org
|
||||
to = build-announce@mozilla.org
|
||||
cc = nobody@mozilla.org
|
||||
patcherConfig = moz19-branch-patcher2.cfg
|
||||
# Tag to use for building MAR/MBSDIFF and other update tools
|
||||
patcherToolsRev = UPDATE_PACKAGING_R4
|
||||
linux_verifyConfig = moz19-thunderbird-linux.cfg
|
||||
win32_verifyConfig = moz19-thunderbird-win32.cfg
|
||||
macosx_verifyConfig = moz19-thunderbird-mac.cfg
|
||||
blat = /d/mozilla-build/blat261/full/blat.exe
|
||||
sendmail = /usr/sbin/sendmail
|
||||
# dump Log output to stdout
|
||||
dumpLogs = 1
|
||||
# symbol server variables
|
||||
symbolServer = staging-1.9-master.build.mozilla.org
|
||||
symbolServerUser = cltbld
|
||||
symbolServerPath = /data/symbols
|
||||
win32_symbolServerKey = /c/Documents and Settings/cltbld/.ssh/tbirdbld_dsa
|
||||
linux_symbolServerKey = /home/cltbld/.ssh/tbirdbld_dsa
|
||||
macosx_symbolServerKey = /Users/cltbld/.ssh/tbirdbld_dsa
|
||||
# username and server to push update snippets to
|
||||
ausUser = cltbld
|
||||
ausServer = staging-1.9-master.build.mozilla.org
|
||||
ausServerUrl = http://staging-1.9-master.build.mozilla.org
|
||||
buildTree = MozillaTest
|
||||
# where QA updates/builds go
|
||||
stagingUser = cltbld
|
||||
stagingServer = fx-linux-1.9-slave1.build.mozilla.org
|
||||
# where beta updates/builds go
|
||||
ftpServer = fx-linux-1.9-slave1.build.mozilla.org
|
||||
# where release updates/builds go
|
||||
bouncerServer = fx-linux-1.9-slave1.build.mozilla.org
|
||||
# username and server to push builds
|
||||
sshUser = cltbld
|
||||
sshServer = fx-linux-1.9-slave1.build.mozilla.org
|
||||
useTalkback = 0
|
||||
useCvsCompression = 1
|
||||
useBetaChannel = 0
|
||||
hgToolsRepo = https://hg.mozilla.org/users/stage-ffxbld/tools
|
||||
hgToolsTag = default
|
||||
hgUsername = stage-ffxbld
|
||||
win32_hgSshKey = /c/Documents and Settings/cltbld/.ssh/ffxbld_dsa
|
||||
linux_hgSshKey = /home/cltbld/.ssh/ffxbld_dsa
|
||||
macosx_hgSshKey = /Users/cltbld/.ssh/ffxbld_dsa
|
||||
@@ -1,84 +0,0 @@
|
||||
version = 1.9.0.19
|
||||
milestone = 1.9.0.19
|
||||
# _BUILDn and _RELEASE will be appended as-needed
|
||||
productTag = FIREFOX_3_0_19
|
||||
# Branch name and pull dates to use for base tag
|
||||
branchTag = HEAD
|
||||
#RelbranchOverride = GECKO190_20091130_RELBRANCH
|
||||
pullDate = 2010-03-10 13:13 PST
|
||||
l10n_pullDate = 2009-09-22 05:34 PDT
|
||||
build = 1
|
||||
# oldVersion and oldRc refer to the previous release
|
||||
oldVersion = 1.9.0.18
|
||||
oldBuild = 1
|
||||
appName = xulrunner
|
||||
product = xulrunner
|
||||
# Absolute path to tinderbox build directory
|
||||
# The win32 ones are kept short because of a long path issue detailed in
|
||||
# bug# 400846
|
||||
linux_buildDir = /builds/tinderbox/Xr-Mozilla1.9-Release
|
||||
macosx_buildDir = /builds/tinderbox/Xr-Mozilla1.9-Release
|
||||
win32_buildDir = /e/xr19rel
|
||||
linux_l10n_buildDir = /builds/tinderbox/Xr-Mozilla1.9-l10n-Release
|
||||
macosx_l10n_buildDir = /builds/tinderbox/Xr-Mozilla1.9-l10n-Release
|
||||
win32_l10n_buildDir = /e/xr19l10nrel
|
||||
# Absolute path to store bootstrap's logs
|
||||
linux_logDir = /builds/logs
|
||||
macosx_logDir = /builds/logs
|
||||
win32_logDir = /builds/logs
|
||||
mozillaCvsroot = cltbld@cvs.mozilla.org:/cvsroot
|
||||
l10nCvsroot = cltbld@cvs.mozilla.org:/l10n
|
||||
mofoCvsroot = cltbld@cvs.mozilla.org:/mofo
|
||||
anonCvsroot = :pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot
|
||||
# private staging area
|
||||
stageHome = /data/cltbld
|
||||
sourceDir = /builds/source
|
||||
updateDir = /builds/updates
|
||||
verifyDir = /builds/verify
|
||||
tagDir = /builds/tags
|
||||
configBumpDir = /builds/config
|
||||
# Build platform, as specified by tinderbox
|
||||
linux_buildPlatform = Linux_2.6.18-53.1.13.el5_Depend
|
||||
macosx_buildPlatform = Darwin_8.8.4_Depend
|
||||
win32_buildPlatform = WINNT_5.2_Depend
|
||||
linux_l10n_buildPlatform = Linux_2.6.18-53.1.13.el5_Depend
|
||||
macosx_l10n_buildPlatform = Darwin_8.8.4_Depend
|
||||
win32_l10n_buildPlatform = WINNT_5.2_Depend
|
||||
from = bootstrap@mozilla.org
|
||||
to = release@mozilla.com
|
||||
cc = bhearsum@mozilla.com
|
||||
patcherConfig = moz19-branch-patcher2.cfg
|
||||
# Tag to use for building MAR/MBSDIFF and other update tools
|
||||
patcherToolsRev = UPDATE_PACKAGING_R1
|
||||
linux_verifyConfig = moz19-xulrunner-linux.cfg
|
||||
win32_verifyConfig = moz19-xulrunner-win32.cfg
|
||||
macosx_verifyConfig = moz19-xulrunner-mac.cfg
|
||||
blat = /d/mozilla-build/blat261/full/blat.exe
|
||||
sendmail = /usr/sbin/sendmail
|
||||
# dump Log output to stdout
|
||||
dumpLogs = 1
|
||||
# symbol server variables
|
||||
symbolServer = stage-old.mozilla.org
|
||||
symbolServerUser = xrbld
|
||||
symbolServerPath = /mnt/netapp/breakpad/symbols_xr
|
||||
win32_symbolServerKey = /c/Documents and Settings/cltbld/.ssh/xrbld_dsa
|
||||
linux_symbolServerKey = /home/cltbld/.ssh/xrbld_dsa
|
||||
macosx_symbolServerKey = /Users/cltbld/.ssh/xrbld_dsa
|
||||
# username and server to push update snippets to
|
||||
ausUser = cltbld
|
||||
ausServer = aus2-staging.mozilla.org
|
||||
ausServerUrl = https://aus2.mozilla.org
|
||||
buildTree = MozillaRelease
|
||||
# where QA updates/builds go
|
||||
stagingUser = cltbld
|
||||
stagingServer = stage-old.mozilla.org
|
||||
# where beta updates/builds go
|
||||
ftpServer = ftp.mozilla.org
|
||||
# where release updates/builds go
|
||||
bouncerServer = download.mozilla.org
|
||||
# username and server to push builds
|
||||
sshUser = cltbld
|
||||
sshServer = stage-old.mozilla.org
|
||||
useTalkback = 0
|
||||
useCvsCompression = 1
|
||||
useBetaChannel = 0
|
||||
@@ -1,85 +0,0 @@
|
||||
version = 1.9rc2
|
||||
prettyAusVersion = XULRunner 3
|
||||
milestone = 1.9rc2
|
||||
# _BUILDn and _RELEASE will be appended as-needed
|
||||
productTag = FIREFOX_3_0rc2
|
||||
# Branch name and pull dates to use for base tag
|
||||
branchTag = HEAD
|
||||
#RelbranchOverride = GECKO190_20071207_RELBRANCH
|
||||
pullDate = 2008-05-28 17:00 PDT
|
||||
l10n_pullDate = 2008-05-28 13:37 PDT
|
||||
build = 1
|
||||
# oldVersion and oldRc refer to the previous release
|
||||
oldVersion = 1.9b4
|
||||
oldBuild = 1
|
||||
appName = xulrunner
|
||||
product = xulrunner
|
||||
# Absolute path to tinderbox build directory
|
||||
# The win32 ones are kept short because of a long path issue detailed in
|
||||
# bug# 400846
|
||||
linux_buildDir = /builds/tinderbox/Xr-Mozilla1.9-Release
|
||||
macosx_buildDir = /builds/tinderbox/Xr-Mozilla1.9-Release
|
||||
win32_buildDir = /e/xr19rel
|
||||
linux_l10n_buildDir = /builds/tinderbox/Xr-Mozilla1.9-l10n-Release
|
||||
macosx_l10n_buildDir = /builds/tinderbox/Xr-Mozilla1.9-l10n-Release
|
||||
win32_l10n_buildDir = /e/xr19l10nrel
|
||||
# Absolute path to store bootstrap's logs
|
||||
linux_logDir = /builds/logs
|
||||
macosx_logDir = /builds/logs
|
||||
win32_logDir = /builds/logs
|
||||
mozillaCvsroot = staging-1.9-master.build.mozilla.org:/builds/cvsmirror/cvsroot
|
||||
l10nCvsroot = staging-1.9-master.build.mozilla.org:/builds/cvsmirror/l10n
|
||||
mofoCvsroot = staging-1.9-master.build.mozilla.org:/builds/cvsmirror/mofo
|
||||
anonCvsroot = staging-1.9-master.build.mozilla.org:/builds/cvsmirror/cvsroot
|
||||
# private staging area
|
||||
stageHome = /data/cltbld
|
||||
sourceDir = /builds/source
|
||||
updateDir = /builds/updates
|
||||
verifyDir = /builds/verify
|
||||
tagDir = /builds/tags
|
||||
configBumpDir = /builds/config
|
||||
# Build platform, as specified by tinderbox
|
||||
linux_buildPlatform = Linux_2.6.18-53.1.13.el5_Depend
|
||||
macosx_buildPlatform = Darwin_8.8.4_Depend
|
||||
win32_buildPlatform = WINNT_5.2_Depend
|
||||
linux_l10n_buildPlatform = Linux_2.6.18-53.1.13.el5_Depend
|
||||
macosx_l10n_buildPlatform = Darwin_8.8.4_Depend
|
||||
win32_l10n_buildPlatform = WINNT_5.2_Depend
|
||||
from = staging-bootstrap@mozilla.org
|
||||
to = build-announce@mozilla.org
|
||||
cc = nobody@mozilla.org
|
||||
patcherConfig = moz19-branch-patcher2.cfg
|
||||
# Tag to use for building MAR/MBSDIFF and other update tools
|
||||
patcherToolsRev = UPDATE_PACKAGING_R1
|
||||
linux_verifyConfig = moz19-xulrunner-linux.cfg
|
||||
win32_verifyConfig = moz19-xulrunner-win32.cfg
|
||||
macosx_verifyConfig = moz19-xulrunner-mac.cfg
|
||||
blat = /d/mozilla-build/blat261/full/blat.exe
|
||||
sendmail = /usr/sbin/sendmail
|
||||
# dump Log output to stdout
|
||||
dumpLogs = 1
|
||||
# symbol server variables
|
||||
symbolServer = staging-1.9-master.build.mozilla.org
|
||||
symbolServerUser = cltbld
|
||||
symbolServerPath = /data/symbols
|
||||
win32_symbolServerKey = /c/Documents and Settings/cltbld/.ssh/xrbld_dsa
|
||||
linux_symbolServerKey = /home/cltbld/.ssh/xrbld_dsa
|
||||
macosx_symbolServerKey = /Users/cltbld/.ssh/xrbld_dsa
|
||||
# username and server to push update snippets to
|
||||
ausUser = cltbld
|
||||
ausServer = staging-1.9-master.build.mozilla.org
|
||||
ausServerUrl = http://staging-1.9-master.build.mozilla.org
|
||||
buildTree = MozillaTest
|
||||
# where QA updates/builds go
|
||||
stagingUser = cltbld
|
||||
stagingServer = fx-linux-1.9-slave1.build.mozilla.org
|
||||
# where beta updates/builds go
|
||||
ftpServer = fx-linux-1.9-slave1.build.mozilla.org
|
||||
# where release updates/builds go
|
||||
bouncerServer = fx-linux-1.9-slave1.build.mozilla.org
|
||||
# username and server to push builds
|
||||
sshUser = cltbld
|
||||
sshServer = fx-linux-1.9-slave1.build.mozilla.org
|
||||
useTalkback = 0
|
||||
useCvsCompression = 1
|
||||
useBetaChannel = 0
|
||||
@@ -1,171 +0,0 @@
|
||||
#!/usr/bin/perl -w
|
||||
use strict;
|
||||
|
||||
use Getopt::Long;
|
||||
|
||||
use MozBuild::Util qw(Email);
|
||||
|
||||
use Bootstrap::Step::Tag;
|
||||
use Bootstrap::Step::TinderConfig;
|
||||
use Bootstrap::Step::Build;
|
||||
use Bootstrap::Step::Source;
|
||||
use Bootstrap::Step::Repack;
|
||||
use Bootstrap::Step::PartnerRepack;
|
||||
use Bootstrap::Step::PatcherConfig;
|
||||
use Bootstrap::Step::Updates;
|
||||
use Bootstrap::Step::Stage;
|
||||
use Bootstrap::Step::Sign;
|
||||
use Bootstrap::Step::PartnerRepack;
|
||||
|
||||
my @allSteps = (
|
||||
'Tag',
|
||||
'TinderConfig',
|
||||
'Build',
|
||||
'Source',
|
||||
'Repack',
|
||||
'Sign',
|
||||
'PartnerRepack',
|
||||
'PatcherConfig',
|
||||
'Updates',
|
||||
'Stage',
|
||||
'PartnerRepack'
|
||||
);
|
||||
|
||||
my %config;
|
||||
|
||||
sub main {
|
||||
ProcessArgs();
|
||||
DetermineSteps();
|
||||
}
|
||||
|
||||
sub ProcessArgs {
|
||||
GetOptions(
|
||||
\%config,
|
||||
"step|s=s", "only|o=s", "list|l", "help|h", "execute|e", "verify|v",
|
||||
"push|p", "announce|a"
|
||||
);
|
||||
|
||||
if ($config{'list'}) {
|
||||
print "Bootstrap listing all steps.\n";
|
||||
for my $step (@allSteps) {
|
||||
print "$step\n";
|
||||
}
|
||||
exit(0);
|
||||
}
|
||||
|
||||
if ($config{'help'}) {
|
||||
print "Usage: release [-l] [-s Step] [-o Step] [-e | -v | -p | -a] [-h]\n";
|
||||
print " -l list all Steps\n";
|
||||
print " -s start at Step\n";
|
||||
print " -o only run one Step\n";
|
||||
print " -e only run Execute\n";
|
||||
print " -v only run Verify\n";
|
||||
print " -p only run Push\n";
|
||||
print " -a only run Announce\n";
|
||||
print " -h this usage message\n";
|
||||
exit(0);
|
||||
}
|
||||
}
|
||||
|
||||
sub DetermineSteps() {
|
||||
my $desiredStep;
|
||||
|
||||
if (defined($config{'step'})) {
|
||||
$desiredStep = $config{'step'};
|
||||
print "Bootstrap skip to step: $desiredStep\n";
|
||||
}
|
||||
if (defined($config{'only'})) {
|
||||
$desiredStep = $config{'only'};
|
||||
print "Bootstrap only run step: $desiredStep\n";
|
||||
}
|
||||
|
||||
my $currentStep = -1;
|
||||
if (defined($desiredStep)) {
|
||||
if (not grep(/^$desiredStep$/, @allSteps)) {
|
||||
die("ASSERT: $desiredStep is not a valid step name.");
|
||||
}
|
||||
for (my $i=0; $i < scalar(@allSteps); $i++) {
|
||||
if ($allSteps[$i] eq "$desiredStep") {
|
||||
$currentStep = $i;
|
||||
}
|
||||
}
|
||||
if ($currentStep == -1) {
|
||||
die("Step $desiredStep not found!\n");
|
||||
}
|
||||
} else {
|
||||
print "Bootstrap running default steps.\n";
|
||||
$currentStep = 0;
|
||||
}
|
||||
|
||||
while ($currentStep < scalar(@allSteps)) {
|
||||
my $stepName = $allSteps[$currentStep];
|
||||
PerformStep( stepName => $stepName );
|
||||
$currentStep += 1;
|
||||
if (defined($config{'only'})) {
|
||||
if ($config{'only'} eq $stepName) {
|
||||
exit(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
print "Bootstrap finished all steps.\n";
|
||||
}
|
||||
|
||||
|
||||
sub PerformStep {
|
||||
my %args = @_;
|
||||
my $stepName = $args{'stepName'};
|
||||
print "Bootstrap running $stepName\n";
|
||||
my $step = "Bootstrap::Step::$stepName"->new();
|
||||
eval {
|
||||
if (defined($config{'execute'})) {
|
||||
print "Bootstrap only running Execute\n";
|
||||
$step->Execute();
|
||||
} elsif (defined($config{'verify'})) {
|
||||
print "Bootstrap only running Verify\n";
|
||||
$step->Verify();
|
||||
} elsif (defined($config{'push'})) {
|
||||
print "Bootstrap only running Push\n";
|
||||
$step->Push();
|
||||
} elsif (defined($config{'announce'})) {
|
||||
print "Bootstrap only running Announce\n";
|
||||
$step->Announce();
|
||||
} else {
|
||||
$step->Execute();
|
||||
$step->Verify();
|
||||
$step->Push();
|
||||
$step->Announce();
|
||||
}
|
||||
};
|
||||
if ($@) {
|
||||
my $error = $@;
|
||||
print "Step $stepName died: $error";
|
||||
my $conf = new Bootstrap::Config();
|
||||
my $from = $conf->Get(var => 'from');
|
||||
my $to = $conf->Get(var => 'to');
|
||||
my @ccList = $conf->Exists(var => 'cc') ? split(/[,\s]+/,
|
||||
$conf->Get(var => 'cc')) : ();
|
||||
my $blat = $conf->Get(var => 'blat');
|
||||
my $sendmail = $conf->Get(var => 'sendmail');
|
||||
my $hostname = $conf->SystemInfo(var => 'hostname');
|
||||
|
||||
eval {
|
||||
Email(
|
||||
blat => $blat,
|
||||
sendmail => $sendmail,
|
||||
from => $from,
|
||||
to => $to,
|
||||
cc => \@ccList,
|
||||
subject => "$hostname - Step $stepName died: $error",
|
||||
message => "$hostname - Step $stepName died: $error",
|
||||
);
|
||||
exit(1);
|
||||
};
|
||||
if ($@) {
|
||||
print "Unable to email failure message to $to: $@";
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
main();
|
||||
@@ -1,74 +0,0 @@
|
||||
package t::Bootstrap::Step::Dummy;
|
||||
use Bootstrap::Step;
|
||||
use Bootstrap::Config;
|
||||
@ISA = ("Bootstrap::Step");
|
||||
|
||||
sub Execute {
|
||||
my $this = shift;
|
||||
|
||||
my $config = new Bootstrap::Config();
|
||||
my $productTag = $config->Get(var => 'productTag');
|
||||
|
||||
if (not $productTag) {
|
||||
print("testfailed, could not get productTag var from Config: $!\n");
|
||||
}
|
||||
|
||||
eval {
|
||||
$this->Shell(cmd => 'echo',
|
||||
cmdArgs => ['success'],
|
||||
logFile => 't/test.log'
|
||||
);
|
||||
};
|
||||
if ($@) {
|
||||
print("testfailed, shell call to echo success to test log should not throw exception: $!\n");
|
||||
}
|
||||
|
||||
eval {
|
||||
$this->CheckLog(
|
||||
log => './t/test.log',
|
||||
checkForOnly => '^success',
|
||||
);
|
||||
};
|
||||
|
||||
if ($@) {
|
||||
print("testfailed, should not throw exception, log contains only success: $!\n");
|
||||
}
|
||||
|
||||
|
||||
eval {
|
||||
$this->Shell( cmd => 'true', logFile => 't/test.log' );
|
||||
};
|
||||
|
||||
if ($@) {
|
||||
print("testfailed, shell call to true should not throw exception: $!\n");
|
||||
}
|
||||
|
||||
eval {
|
||||
$this->Shell( cmd => 'false', logFile => 't/test.log' );
|
||||
};
|
||||
|
||||
if (not $@) {
|
||||
print("testfailed, shell call to false should throw exception: $!\n");
|
||||
}
|
||||
|
||||
eval {
|
||||
$this->CheckLog(
|
||||
log => './t/test.log',
|
||||
checkFor => '^success',
|
||||
);
|
||||
};
|
||||
|
||||
if ($@) {
|
||||
print("testfailed, should throw exception, log contains success: $!\n");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
sub Verify {
|
||||
my $this = shift;
|
||||
$this->Shell(
|
||||
cmd => 'echo', cmdArgs => ['Verify', 'tag'], logFile => 't/test.log');
|
||||
$this->Log(msg => 'finished');
|
||||
}
|
||||
|
||||
1;
|
||||
@@ -1,35 +0,0 @@
|
||||
#!/usr/bin/perl -w
|
||||
use strict;
|
||||
use Bootstrap::Step;
|
||||
use Bootstrap::Config;
|
||||
use t::Bootstrap::Step::Dummy;
|
||||
use MozBuild::Util;
|
||||
|
||||
my $config = new Bootstrap::Config();
|
||||
unless ($config->Exists(sysvar => 'buildDir')) {
|
||||
print "FAIL: buildDir should exist\n";
|
||||
}
|
||||
unless ($config->Get(sysvar => 'buildDir')) {
|
||||
print "FAIL: buildDir should be retrievable\n";
|
||||
}
|
||||
my $sysname = $config->SystemInfo(var => 'sysname');
|
||||
unless ($sysname) {
|
||||
print "FAIL: sysname should exist\n";
|
||||
}
|
||||
|
||||
my $step = t::Bootstrap::Step::Dummy->new();
|
||||
|
||||
$step->Execute();
|
||||
$step->Verify();
|
||||
$step->Push();
|
||||
$step->Announce();
|
||||
|
||||
eval {
|
||||
$config->Bump(
|
||||
configFile => 't/tinder-config.pl',
|
||||
);
|
||||
};
|
||||
|
||||
if ($@) {
|
||||
print("FAIL: should not have died, all matches\n");
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
# CONFIG: bar %mozillaCvsroot%
|
||||
bar
|
||||
# CONFIG: bar %tagDir%%verifyDir%
|
||||
baz
|
||||
# CONFIG: bar %tagDir%_%verifyDir%
|
||||
bla
|
||||
39
mozilla/xpinstall/Makefile.in
Normal file
39
mozilla/xpinstall/Makefile.in
Normal file
@@ -0,0 +1,39 @@
|
||||
#!gmake
|
||||
#
|
||||
# The contents of this file are subject to the Netscape Public License
|
||||
# Version 1.0 (the "License"); you may not use this file except in
|
||||
# compliance with the License. You may obtain a copy of the License at
|
||||
# http://www.mozilla.org/NPL/
|
||||
#
|
||||
# Software distributed under the License is distributed on an "AS IS" basis,
|
||||
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
# for the specific language governing rights and limitations under the
|
||||
# License.
|
||||
#
|
||||
# The Original Code is Mozilla Communicator client code,
|
||||
# released March 31, 1998.
|
||||
#
|
||||
# The Initial Developer of the Original Code is Netscape Communications
|
||||
# Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
# Reserved.
|
||||
#
|
||||
# Contributors:
|
||||
# Daniel Veditz <dveditz@netscape.com>
|
||||
# Douglas Turner <dougt@netscape.com>
|
||||
|
||||
|
||||
DEPTH = ..
|
||||
topsrcdir = @top_srcdir@
|
||||
srcdir = @srcdir@
|
||||
VPATH = @srcdir@
|
||||
|
||||
include $(DEPTH)/config/autoconf.mk
|
||||
|
||||
DIRS = public
|
||||
|
||||
include $(topsrcdir)/config/config.mk
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
|
||||
|
||||
BIN
mozilla/xpinstall/macbuild/xpinstall.mcp
Normal file
BIN
mozilla/xpinstall/macbuild/xpinstall.mcp
Normal file
Binary file not shown.
BIN
mozilla/xpinstall/macbuild/xpinstallIDL.mcp
Normal file
BIN
mozilla/xpinstall/macbuild/xpinstallIDL.mcp
Normal file
Binary file not shown.
30
mozilla/xpinstall/makefile.win
Normal file
30
mozilla/xpinstall/makefile.win
Normal file
@@ -0,0 +1,30 @@
|
||||
#!nmake
|
||||
#
|
||||
# The contents of this file are subject to the Netscape Public License
|
||||
# Version 1.0 (the "License"); you may not use this file except in
|
||||
# compliance with the License. You may obtain a copy of the License at
|
||||
# http://www.mozilla.org/NPL/
|
||||
#
|
||||
# Software distributed under the License is distributed on an "AS IS" basis,
|
||||
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
# for the specific language governing rights and limitations under the
|
||||
# License.
|
||||
#
|
||||
# The Original Code is Mozilla Communicator client code,
|
||||
# released March 31, 1998.
|
||||
#
|
||||
# The Initial Developer of the Original Code is Netscape Communications
|
||||
# Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
# Reserved.
|
||||
#
|
||||
# Contributors:
|
||||
# Daniel Veditz <dveditz@netscape.com>
|
||||
# Douglas Turner <dougt@netscape.com>
|
||||
|
||||
|
||||
DEPTH=..
|
||||
|
||||
DIRS= public res src
|
||||
|
||||
include <$(DEPTH)\config\rules.mak>
|
||||
33
mozilla/xpinstall/notifier/SoftwareUpdate-Source-1.rdf
Normal file
33
mozilla/xpinstall/notifier/SoftwareUpdate-Source-1.rdf
Normal file
@@ -0,0 +1,33 @@
|
||||
<RDF:RDF xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:NC="http://home.netscape.com/NC-rdf#">
|
||||
|
||||
<RDF:Bag ID="NC:SoftwareUpdateRoot">
|
||||
<RDF:li>
|
||||
<RDF:Bag ID="NC:NewSoftwareToday" NC:title="New Software">
|
||||
|
||||
<RDF:li>
|
||||
<RDF:Description ID="AimUpdate344">
|
||||
<NC:type resource="http://home.netscape.com/NC-rdf#SoftwarePackage" />
|
||||
<NC:title>AOL AIM</NC:title>
|
||||
<NC:description>An Instant Message Client</NC:description>
|
||||
<NC:version>3.4.1.12</NC:version>
|
||||
<NC:registryKey>/AOL/AIM/</NC:registryKey>
|
||||
<NC:url>http://home.netscape.com/index.html</NC:url>
|
||||
</RDF:Description>
|
||||
</RDF:li>
|
||||
|
||||
<RDF:li>
|
||||
<RDF:Description ID="PGPPlugin345">
|
||||
<NC:type resource="http://home.netscape.com/NC-rdf#SoftwarePackage" />
|
||||
<NC:title>PGP Plugin For Mozilla</NC:title>
|
||||
<NC:description>A high grade encryption plugin</NC:description>
|
||||
<NC:version>1.1.2.0</NC:version>
|
||||
<NC:registryKey>/PGP/ROCKS/</NC:registryKey>
|
||||
<NC:url>http://home.netscape.com/index.html</NC:url>
|
||||
</RDF:Description>
|
||||
</RDF:li>
|
||||
|
||||
</RDF:Bag>
|
||||
</RDF:li>
|
||||
</RDF:Bag>
|
||||
</RDF:RDF>
|
||||
57
mozilla/xpinstall/notifier/SoftwareUpdate.css
Normal file
57
mozilla/xpinstall/notifier/SoftwareUpdate.css
Normal file
@@ -0,0 +1,57 @@
|
||||
window {
|
||||
display: block;
|
||||
}
|
||||
|
||||
tree {
|
||||
display: table;
|
||||
background-color: #FFFFFF;
|
||||
border: none;
|
||||
border-spacing: 0px;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
treecol {
|
||||
display: table-column;
|
||||
width: 200px;
|
||||
}
|
||||
|
||||
treeitem {
|
||||
display: table-row;
|
||||
}
|
||||
|
||||
treehead {
|
||||
display: table-header-group;
|
||||
}
|
||||
|
||||
treebody {
|
||||
display: table-row-group;
|
||||
}
|
||||
|
||||
treecell {
|
||||
display: table-cell;
|
||||
font-family: Verdana, Sans-Serif;
|
||||
font-size: 8pt;
|
||||
}
|
||||
|
||||
treecell[selectedcell] {
|
||||
background-color: yellow;
|
||||
}
|
||||
|
||||
|
||||
treehead treeitem treecell {
|
||||
background-color: #c0c0c0;
|
||||
border: outset 1px;
|
||||
border-color: white #707070 #707070 white;
|
||||
padding-left: 4px;
|
||||
}
|
||||
|
||||
treeitem[type="http://home.netscape.com/NC-rdf#SoftwarePackage"] > treecell > titledbutton {
|
||||
list-style-image: url("resource:/res/rdf/SoftwareUpdatePackage.gif");
|
||||
}
|
||||
|
||||
treeitem[type="http://home.netscape.com/NC-rdf#Folder"] > treecell > titledbutton {
|
||||
list-style-image: url("resource:/res/rdf/bookmark-folder-closed.gif");
|
||||
|
||||
treeitem[type="http://home.netscape.com/NC-rdf#Folder"][open="true"] > treecell > titledbutton {
|
||||
list-style-image: url("resource:/res/rdf/bookmark-folder-open.gif");
|
||||
}
|
||||
123
mozilla/xpinstall/notifier/SoftwareUpdate.js
Normal file
123
mozilla/xpinstall/notifier/SoftwareUpdate.js
Normal file
@@ -0,0 +1,123 @@
|
||||
// the rdf service
|
||||
var RDF = Components.classes['component://netscape/rdf/rdf-service'].getService();
|
||||
RDF = RDF.QueryInterface(Components.interfaces.nsIRDFService);
|
||||
|
||||
function getAttr(registry,service,attr_name)
|
||||
{
|
||||
var attr = registry.GetTarget(service,
|
||||
RDF.GetResource('http://home.netscape.com/NC-rdf#' + attr_name),
|
||||
true);
|
||||
if (attr)
|
||||
attr = attr.QueryInterface(Components.interfaces.nsIRDFLiteral);
|
||||
|
||||
if (attr)
|
||||
attr = attr.Value;
|
||||
|
||||
return attr;
|
||||
}
|
||||
|
||||
function Init()
|
||||
{
|
||||
// this is the main rdf file.
|
||||
|
||||
var mainRegistry = RDF.GetDataSource('resource://res/rdf/SoftwareUpdates.rdf');
|
||||
|
||||
var mainContainer = Components.classes['component://netscape/rdf/container'].createInstance();
|
||||
mainContainer = mainContainer.QueryInterface(Components.interfaces.nsIRDFContainer);
|
||||
|
||||
mainContainer.Init(mainRegistry, RDF.GetResource('NC:SoftwareUpdateDataSources'));
|
||||
|
||||
// Now enumerate all of the softwareupdate datasources.
|
||||
var mainEnumerator = mainContainer.GetElements();
|
||||
while (mainEnumerator.HasMoreElements())
|
||||
{
|
||||
var aDistributor = mainEnumerator.GetNext();
|
||||
aDistributor = aDistributor.QueryInterface(Components.interfaces.nsIRDFResource);
|
||||
|
||||
var distributorContainer = Components.classes['component://netscape/rdf/container'].createInstance();
|
||||
distributorContainer = distributorContainer.QueryInterface(Components.interfaces.nsIRDFContainer);
|
||||
|
||||
var distributorRegistry = RDF.GetDataSource(aDistributor.Value);
|
||||
var distributorResource = RDF.GetResource('NC:SoftwareUpdateRoot');
|
||||
|
||||
distributorContainer.Init(distributorRegistry, distributorResource);
|
||||
|
||||
// Now enumerate all of the distributorContainer's packages.
|
||||
|
||||
var distributorEnumerator = distributorContainer.GetElements();
|
||||
|
||||
while (distributorEnumerator.HasMoreElements())
|
||||
{
|
||||
var aPackage = distributorEnumerator.GetNext();
|
||||
aPackage = aPackage.QueryInterface(Components.interfaces.nsIRDFResource);
|
||||
|
||||
// remove any that we do not want.
|
||||
|
||||
if (getAttr(distributorRegistry, aPackage, 'title') == "AOL AIM")
|
||||
{
|
||||
//distributorContainer.RemoveElement(aPackage, true);
|
||||
}
|
||||
}
|
||||
var tree = document.getElementById('tree');
|
||||
|
||||
// Add it to the tree control's composite datasource.
|
||||
tree.database.AddDataSource(distributorRegistry);
|
||||
|
||||
}
|
||||
|
||||
// Install all of the stylesheets in the softwareupdate Registry into the
|
||||
// panel.
|
||||
|
||||
// TODO
|
||||
|
||||
// XXX hack to force the tree to rebuild
|
||||
var treebody = document.getElementById('NC:SoftwareUpdateRoot');
|
||||
treebody.setAttribute('id', 'NC:SoftwareUpdateRoot');
|
||||
}
|
||||
|
||||
|
||||
function OpenURL(event, node)
|
||||
{
|
||||
if (node.getAttribute('type') == "http://home.netscape.com/NC-rdf#SoftwarePackage")
|
||||
{
|
||||
url = node.getAttribute('url');
|
||||
|
||||
/*window.open(url,'bookmarks');*/
|
||||
|
||||
var toolkitCore = XPAppCoresManager.Find("ToolkitCore");
|
||||
if (!toolkitCore)
|
||||
{
|
||||
toolkitCore = new ToolkitCore();
|
||||
if (toolkitCore)
|
||||
{
|
||||
toolkitCore.Init("ToolkitCore");
|
||||
}
|
||||
}
|
||||
|
||||
if (toolkitCore)
|
||||
{
|
||||
toolkitCore.ShowWindow(url,window);
|
||||
}
|
||||
|
||||
dump("OpenURL(" + url + ")\n");
|
||||
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
// To get around "window.onload" not working in viewer.
|
||||
function Boot()
|
||||
{
|
||||
var tree = document.getElementById('tree');
|
||||
if (tree == null) {
|
||||
setTimeout(Boot, 0);
|
||||
}
|
||||
else {
|
||||
Init();
|
||||
}
|
||||
}
|
||||
|
||||
setTimeout('Boot()', 0);
|
||||
|
||||
30
mozilla/xpinstall/notifier/SoftwareUpdate.xul
Normal file
30
mozilla/xpinstall/notifier/SoftwareUpdate.xul
Normal file
@@ -0,0 +1,30 @@
|
||||
<?xml version="1.0"?>
|
||||
<?xml-stylesheet href="resource:/res/rdf/sidebar.css" type="text/css"?>
|
||||
<?xml-stylesheet href="resource:/res/rdf/SoftwareUpdate.css" type="text/css"?>
|
||||
<window
|
||||
xmlns:html="http://www.w3.org/TR/REC-html40"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
||||
|
||||
<html:script src="SoftwareUpdate.js"/>
|
||||
|
||||
<tree id="tree"
|
||||
flex="100%"
|
||||
datasources="rdf:softwareupdates"
|
||||
ondblclick="return OpenURL(event, event.target.parentNode);">
|
||||
|
||||
<treecol rdf:resource="http://home.netscape.com/NC-rdf#title" />
|
||||
<treecol rdf:resource="http://home.netscape.com/NC-rdf#description" />
|
||||
<treecol rdf:resource="http://home.netscape.com/NC-rdf#version" />
|
||||
|
||||
<treehead>
|
||||
<treeitem>
|
||||
<treecell>Title</treecell>
|
||||
<treecell>Description</treecell>
|
||||
<treecell>Version</treecell>
|
||||
</treeitem>
|
||||
</treehead>
|
||||
|
||||
<treebody id="NC:SoftwareUpdateRoot" rdf:containment="http://home.netscape.com/NC-rdf#child" />
|
||||
</tree>
|
||||
</window>
|
||||
BIN
mozilla/xpinstall/notifier/SoftwareUpdatePackage.gif
Normal file
BIN
mozilla/xpinstall/notifier/SoftwareUpdatePackage.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 201 B |
7
mozilla/xpinstall/notifier/SoftwareUpdates.rdf
Normal file
7
mozilla/xpinstall/notifier/SoftwareUpdates.rdf
Normal file
@@ -0,0 +1,7 @@
|
||||
<RDF:RDF xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:NC="http://home.netscape.com/softwareupdate-schema#">
|
||||
|
||||
<RDF:Bag ID="NC:SoftwareUpdateDataSources">
|
||||
<RDF:li resource="resource:/res/rdf/SoftwareUpdate-Source-1.rdf" />
|
||||
</RDF:Bag>
|
||||
</RDF:RDF>
|
||||
6
mozilla/xpinstall/public/MANIFEST
Normal file
6
mozilla/xpinstall/public/MANIFEST
Normal file
@@ -0,0 +1,6 @@
|
||||
#
|
||||
# This is a list of local files which get copied to the mozilla:dist directory
|
||||
#
|
||||
|
||||
nsISoftwareUpdate.h
|
||||
nsSoftwareUpdateIIDs.h
|
||||
47
mozilla/xpinstall/public/Makefile.in
Normal file
47
mozilla/xpinstall/public/Makefile.in
Normal file
@@ -0,0 +1,47 @@
|
||||
#!gmake
|
||||
#
|
||||
# The contents of this file are subject to the Netscape Public License
|
||||
# Version 1.0 (the "License"); you may not use this file except in
|
||||
# compliance with the License. You may obtain a copy of the License at
|
||||
# http://www.mozilla.org/NPL/
|
||||
#
|
||||
# Software distributed under the License is distributed on an "AS IS" basis,
|
||||
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
# for the specific language governing rights and limitations under the
|
||||
# License.
|
||||
#
|
||||
# The Original Code is Mozilla Communicator client code,
|
||||
# released March 31, 1998.
|
||||
#
|
||||
# The Initial Developer of the Original Code is Netscape Communications
|
||||
# Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
# Reserved.
|
||||
#
|
||||
# Contributors:
|
||||
# Daniel Veditz <dveditz@netscape.com>
|
||||
# Douglas Turner <dougt@netscape.com>
|
||||
|
||||
DEPTH = ../..
|
||||
topsrcdir = @top_srcdir@
|
||||
srcdir = @srcdir@
|
||||
VPATH = @srcdir@
|
||||
|
||||
include $(DEPTH)/config/autoconf.mk
|
||||
|
||||
MODULE = xpinstall
|
||||
|
||||
XPIDLSRCS = nsIXPInstallProgress.idl
|
||||
|
||||
EXPORTS = \
|
||||
nsIDOMInstallTriggerGlobal.h \
|
||||
nsIDOMInstallVersion.h \
|
||||
nsSoftwareUpdateIIDs.h \
|
||||
nsISoftwareUpdate.h \
|
||||
$(NULL)
|
||||
|
||||
EXPORTS := $(addprefix $(srcdir)/, $(EXPORTS))
|
||||
|
||||
include $(topsrcdir)/config/config.mk
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
113
mozilla/xpinstall/public/idl/Install.idl
Normal file
113
mozilla/xpinstall/public/idl/Install.idl
Normal file
@@ -0,0 +1,113 @@
|
||||
interface Install
|
||||
{
|
||||
/* IID: { 0x18c2f988, 0xb09f, 0x11d2, \
|
||||
{0xbc, 0xde, 0x00, 0x80, 0x5f, 0x0e, 0x13, 0x53}} */
|
||||
|
||||
const int BAD_PACKAGE_NAME = -200;
|
||||
const int UNEXPECTED_ERROR = -201;
|
||||
const int ACCESS_DENIED = -202;
|
||||
const int TOO_MANY_CERTIFICATES = -203; /* Installer file must have 1 certificate */
|
||||
const int NO_INSTALLER_CERTIFICATE = -204; /* Installer file must have a certificate */
|
||||
const int NO_CERTIFICATE = -205; /* Extracted file is not signed */
|
||||
const int NO_MATCHING_CERTIFICATE = -206; /* Extracted file does not match installer certificate */
|
||||
const int UNKNOWN_JAR_FILE = -207; /* JAR file has not been opened */
|
||||
const int INVALID_ARGUMENTS = -208; /* Bad arguments to a function */
|
||||
const int ILLEGAL_RELATIVE_PATH = -209; /* Illegal relative path */
|
||||
const int USER_CANCELLED = -210; /* User cancelled */
|
||||
const int INSTALL_NOT_STARTED = -211;
|
||||
const int SILENT_MODE_DENIED = -212;
|
||||
const int NO_SUCH_COMPONENT = -213; /* no such component in the registry. */
|
||||
const int FILE_DOES_NOT_EXIST = -214; /* File cannot be deleted as it does not exist */
|
||||
const int FILE_READ_ONLY = -215; /* File cannot be deleted as it is read only. */
|
||||
const int FILE_IS_DIRECTORY = -216; /* File cannot be deleted as it is a directory */
|
||||
const int NETWORK_FILE_IS_IN_USE = -217; /* File on the network is in-use */
|
||||
const int APPLE_SINGLE_ERR = -218; /* error in AppleSingle unpacking */
|
||||
const int INVALID_PATH_ERR = -219; /* GetFolder() did not like the folderID */
|
||||
const int PATCH_BAD_DIFF = -220; /* error in GDIFF patch */
|
||||
const int PATCH_BAD_CHECKSUM_TARGET = -221; /* source file doesn't checksum */
|
||||
const int PATCH_BAD_CHECKSUM_RESULT = -222; /* final patched file fails checksum */
|
||||
const int UNINSTALL_FAILED = -223; /* error while uninstalling a package */
|
||||
const int GESTALT_UNKNOWN_ERR = -5550;
|
||||
const int GESTALT_INVALID_ARGUMENT = -5551;
|
||||
|
||||
const int SUCCESS = 0;
|
||||
const int REBOOT_NEEDED = 999;
|
||||
|
||||
/* install types */
|
||||
const int LIMITED_INSTALL = 0;
|
||||
const int FULL_INSTALL = 1;
|
||||
const int NO_STATUS_DLG = 2;
|
||||
const int NO_FINALIZE_DLG = 4;
|
||||
|
||||
// these should not be public...
|
||||
/* message IDs*/
|
||||
const int SU_INSTALL_FILE_UNEXPECTED_MSG_ID = 0;
|
||||
const int SU_DETAILS_REPLACE_FILE_MSG_ID = 1;
|
||||
const int SU_DETAILS_INSTALL_FILE_MSG_ID = 2;
|
||||
//////////////////////////
|
||||
|
||||
readonly attribute wstring UserPackageName;
|
||||
readonly attribute wstring RegPackageName;
|
||||
|
||||
void Install();
|
||||
|
||||
void AbortInstall();
|
||||
|
||||
long AddDirectory( in wstring regName,
|
||||
in wstring version,
|
||||
in wstring jarSource,
|
||||
in InstallFolder folder,
|
||||
in wstring subdir,
|
||||
in boolean forceMode );
|
||||
|
||||
|
||||
long AddSubcomponent( in wstring regName,
|
||||
in wstring version,
|
||||
in wstring jarSource,
|
||||
in InstallFolder folder,
|
||||
in wstring targetName,
|
||||
in boolean forceMode );
|
||||
|
||||
long DeleteComponent( in wstring registryName);
|
||||
|
||||
long DeleteFile( in InstallFolder folder,
|
||||
in wstring relativeFileName );
|
||||
|
||||
long DiskSpaceAvailable( in InstallFolder folder );
|
||||
|
||||
long Execute(in wstring jarSource, in wstring args);
|
||||
|
||||
long FinalizeInstall();
|
||||
|
||||
long Gestalt (in wstring selector);
|
||||
|
||||
InstallFolder GetComponentFolder( in wstring regName,
|
||||
in wstring subdirectory);
|
||||
|
||||
InstallFolder GetFolder(in wstring targetFolder,
|
||||
in wstring subdirectory);
|
||||
|
||||
long GetLastError();
|
||||
|
||||
long GetWinProfile(in InstallFolder folder, in wstring file);
|
||||
|
||||
long GetWinRegistry();
|
||||
|
||||
long Patch( in wstring regName,
|
||||
in wstring version,
|
||||
in wstring jarSource,
|
||||
in InstallFolder folder,
|
||||
in wstring targetName );
|
||||
|
||||
void ResetError();
|
||||
|
||||
void SetPackageFolder( in InstallFolder folder );
|
||||
|
||||
long StartInstall( in wstring userPackageName,
|
||||
in wstring packageName,
|
||||
in wstring version,
|
||||
in long flags );
|
||||
|
||||
long Uninstall( in wstring packageName);
|
||||
|
||||
};
|
||||
24
mozilla/xpinstall/public/idl/InstallTrigger.idl
Normal file
24
mozilla/xpinstall/public/idl/InstallTrigger.idl
Normal file
@@ -0,0 +1,24 @@
|
||||
interface InstallTriggerGlobal
|
||||
{
|
||||
/* IID: { 0x18c2f987, 0xb09f, 0x11d2, \
|
||||
{0xbc, 0xde, 0x00, 0x80, 0x5f, 0x0e, 0x13, 0x53}} */
|
||||
|
||||
const int MAJOR_DIFF = 4;
|
||||
const int MINOR_DIFF = 3;
|
||||
const int REL_DIFF = 2;
|
||||
const int BLD_DIFF = 1;
|
||||
const int EQUAL = 0;
|
||||
|
||||
boolean UpdateEnabled ();
|
||||
|
||||
long StartSoftwareUpdate(in wstring URL);
|
||||
|
||||
long ConditionalSoftwareUpdate( in wstring URL,
|
||||
in wstring regName,
|
||||
in long diffLevel,
|
||||
in wstring version,
|
||||
in long mode);
|
||||
|
||||
long CompareVersion( in wstring regName, in wstring version );
|
||||
|
||||
};
|
||||
34
mozilla/xpinstall/public/idl/InstallVersion.idl
Normal file
34
mozilla/xpinstall/public/idl/InstallVersion.idl
Normal file
@@ -0,0 +1,34 @@
|
||||
interface InstallVersion
|
||||
{
|
||||
/* IID: { 0x18c2f986, 0xb09f, 0x11d2, \
|
||||
{0xbc, 0xde, 0x00, 0x80, 0x5f, 0x0e, 0x13, 0x53}} */
|
||||
|
||||
const int EQUAL = 0;
|
||||
const int BLD_DIFF = 1;
|
||||
const int BLD_DIFF_MINUS = -1;
|
||||
const int REL_DIFF = 2;
|
||||
const int REL_DIFF_MINUS = -2;
|
||||
const int MINOR_DIFF = 3;
|
||||
const int MINOR_DIFF_MINUS = -3;
|
||||
const int MAJOR_DIFF = 4;
|
||||
const int MAJOR_DIFF_MINUS = -4;
|
||||
|
||||
attribute int major;
|
||||
attribute int minor;
|
||||
attribute int release;
|
||||
attribute int build;
|
||||
|
||||
void InstallVersion();
|
||||
|
||||
void init(in wstring versionString);
|
||||
/*
|
||||
void init(in int major, in int minor, in int release, in int build);
|
||||
*/
|
||||
wstring toString();
|
||||
|
||||
/* int compareTo(in wstring version);
|
||||
int compareTo(in int major, in int minor, in int release, in int build);
|
||||
*/
|
||||
int compareTo(in InstallVersion versionObject);
|
||||
|
||||
};
|
||||
36
mozilla/xpinstall/public/makefile.win
Normal file
36
mozilla/xpinstall/public/makefile.win
Normal file
@@ -0,0 +1,36 @@
|
||||
#!nmake
|
||||
#
|
||||
# The contents of this file are subject to the Netscape Public License
|
||||
# Version 1.0 (the "License"); you may not use this file except in
|
||||
# compliance with the License. You may obtain a copy of the License at
|
||||
# http://www.mozilla.org/NPL/
|
||||
#
|
||||
# Software distributed under the License is distributed on an "AS IS" basis,
|
||||
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
# for the specific language governing rights and limitations under the
|
||||
# License.
|
||||
#
|
||||
# The Original Code is Mozilla Communicator client code,
|
||||
# released March 31, 1998.
|
||||
#
|
||||
# The Initial Developer of the Original Code is Netscape Communications
|
||||
# Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
# Reserved.
|
||||
#
|
||||
# Contributors:
|
||||
# Daniel Veditz <dveditz@netscape.com>
|
||||
# Douglas Turner <dougt@netscape.com>
|
||||
|
||||
MODULE=xpinstall
|
||||
DEPTH=..\..
|
||||
|
||||
EXPORTS= nsIDOMInstallTriggerGlobal.h \
|
||||
nsIDOMInstallVersion.h \
|
||||
nsSoftwareUpdateIIDs.h \
|
||||
nsISoftwareUpdate.h
|
||||
|
||||
XPIDLSRCS = .\nsIXPInstallProgress.idl
|
||||
|
||||
include <$(DEPTH)\config\config.mak>
|
||||
include <$(DEPTH)\config\rules.mak>
|
||||
1
mozilla/xpinstall/public/nsIDOMInstall.h
Normal file
1
mozilla/xpinstall/public/nsIDOMInstall.h
Normal file
@@ -0,0 +1 @@
|
||||
#error
|
||||
96
mozilla/xpinstall/public/nsIDOMInstallTriggerGlobal.h
Normal file
96
mozilla/xpinstall/public/nsIDOMInstallTriggerGlobal.h
Normal file
@@ -0,0 +1,96 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
/* AUTO-GENERATED. DO NOT EDIT!!! */
|
||||
|
||||
#ifndef nsIDOMInstallTriggerGlobal_h__
|
||||
#define nsIDOMInstallTriggerGlobal_h__
|
||||
|
||||
#include "nsISupports.h"
|
||||
#include "nsString.h"
|
||||
#include "nsIScriptContext.h"
|
||||
|
||||
|
||||
#define NS_IDOMINSTALLTRIGGERGLOBAL_IID \
|
||||
{ 0x18c2f987, 0xb09f, 0x11d2, \
|
||||
{0xbc, 0xde, 0x00, 0x80, 0x5f, 0x0e, 0x13, 0x53}}
|
||||
|
||||
class nsIDOMInstallTriggerGlobal : public nsISupports {
|
||||
public:
|
||||
static const nsIID& IID() { static nsIID iid = NS_IDOMINSTALLTRIGGERGLOBAL_IID; return iid; }
|
||||
enum {
|
||||
MAJOR_DIFF = 4,
|
||||
MINOR_DIFF = 3,
|
||||
REL_DIFF = 2,
|
||||
BLD_DIFF = 1,
|
||||
EQUAL = 0
|
||||
};
|
||||
|
||||
NS_IMETHOD UpdateEnabled(PRBool* aReturn)=0;
|
||||
|
||||
NS_IMETHOD StartSoftwareUpdate(const nsString& aURL, PRInt32* aReturn)=0;
|
||||
NS_IMETHOD StartSoftwareUpdate(const nsString& aURL, PRInt32 aFlags, PRInt32* aReturn)=0;
|
||||
|
||||
NS_IMETHOD ConditionalSoftwareUpdate(const nsString& aURL, const nsString& aRegName, PRInt32 aDiffLevel, const nsString& aVersion, PRInt32 aMode, PRInt32* aReturn)=0;
|
||||
NS_IMETHOD ConditionalSoftwareUpdate(const nsString& aURL, const nsString& aRegName, PRInt32 aDiffLevel, nsIDOMInstallVersion* aVersion, PRInt32 aMode, PRInt32* aReturn)=0;
|
||||
NS_IMETHOD ConditionalSoftwareUpdate(const nsString& aURL, const nsString& aRegName, nsIDOMInstallVersion* aVersion, PRInt32 aMode, PRInt32* aReturn)=0;
|
||||
NS_IMETHOD ConditionalSoftwareUpdate(const nsString& aURL, const nsString& aRegName, const nsString& aVersion, PRInt32 aMode, PRInt32* aReturn)=0;
|
||||
NS_IMETHOD ConditionalSoftwareUpdate(const nsString& aURL, const nsString& aRegName, const nsString& aVersion, PRInt32* aReturn)=0;
|
||||
NS_IMETHOD ConditionalSoftwareUpdate(const nsString& aURL, const nsString& aRegName, nsIDOMInstallVersion* aVersion, PRInt32* aReturn)=0;
|
||||
|
||||
NS_IMETHOD CompareVersion(const nsString& aRegName, PRInt32 aMajor, PRInt32 aMinor, PRInt32 aRelease, PRInt32 aBuild, PRInt32* aReturn)=0;
|
||||
NS_IMETHOD CompareVersion(const nsString& aRegName, const nsString& aVersion, PRInt32* aReturn)=0;
|
||||
NS_IMETHOD CompareVersion(const nsString& aRegName, nsIDOMInstallVersion* aVersion, PRInt32* aReturn)=0;
|
||||
};
|
||||
|
||||
|
||||
#define NS_DECL_IDOMINSTALLTRIGGERGLOBAL \
|
||||
NS_IMETHOD UpdateEnabled(PRBool* aReturn); \
|
||||
NS_IMETHOD StartSoftwareUpdate(const nsString& aURL, PRInt32 aFlags, PRInt32* aReturn); \
|
||||
NS_IMETHOD StartSoftwareUpdate(const nsString& aURL, PRInt32* aReturn); \
|
||||
NS_IMETHOD ConditionalSoftwareUpdate(const nsString& aURL, const nsString& aRegName, PRInt32 aDiffLevel, const nsString& aVersion, PRInt32 aMode, PRInt32* aReturn); \
|
||||
NS_IMETHOD ConditionalSoftwareUpdate(const nsString& aURL, const nsString& aRegName, PRInt32 aDiffLevel, nsIDOMInstallVersion* aVersion, PRInt32 aMode, PRInt32* aReturn); \
|
||||
NS_IMETHOD ConditionalSoftwareUpdate(const nsString& aURL, const nsString& aRegName, nsIDOMInstallVersion* aVersion, PRInt32 aMode, PRInt32* aReturn); \
|
||||
NS_IMETHOD ConditionalSoftwareUpdate(const nsString& aURL, const nsString& aRegName, const nsString& aVersion, PRInt32 aMode, PRInt32* aReturn); \
|
||||
NS_IMETHOD ConditionalSoftwareUpdate(const nsString& aURL, const nsString& aRegName, const nsString& aVersion, PRInt32* aReturn); \
|
||||
NS_IMETHOD ConditionalSoftwareUpdate(const nsString& aURL, const nsString& aRegName, nsIDOMInstallVersion* aVersion, PRInt32* aReturn); \
|
||||
NS_IMETHOD CompareVersion(const nsString& aRegName, PRInt32 aMajor, PRInt32 aMinor, PRInt32 aRelease, PRInt32 aBuild, PRInt32* aReturn); \
|
||||
NS_IMETHOD CompareVersion(const nsString& aRegName, const nsString& aVersion, PRInt32* aReturn); \
|
||||
NS_IMETHOD CompareVersion(const nsString& aRegName, nsIDOMInstallVersion* aVersion, PRInt32* aReturn); \
|
||||
|
||||
|
||||
|
||||
#define NS_FORWARD_IDOMINSTALLTRIGGERGLOBAL(_to) \
|
||||
NS_IMETHOD UpdateEnabled(PRBool* aReturn) { return _to##UpdateEnabled(aReturn); } \
|
||||
NS_IMETHOD StartSoftwareUpdate(const nsString& aURL, PRInt32 aFlags, PRInt32* aReturn) { return _to##StartSoftwareUpdate(aURL, aFlags, aReturn); } \
|
||||
NS_IMETHOD StartSoftwareUpdate(const nsString& aURL, PRInt32* aReturn) { return _to##StartSoftwareUpdate(aURL, aReturn); } \
|
||||
NS_IMETHOD ConditionalSoftwareUpdate(const nsString& aURL, const nsString& aRegName, PRInt32 aDiffLevel, const nsString& aVersion, PRInt32 aMode, PRInt32* aReturn) { return _to##ConditionalSoftwareUpdate(aURL, aRegName, aDiffLevel, aVersion, aMode, aReturn); } \
|
||||
NS_IMETHOD ConditionalSoftwareUpdate(const nsString& aURL, const nsString& aRegName, PRInt32 aDiffLevel, nsIDOMInstallVersion* aVersion, PRInt32 aMode, PRInt32* aReturn) { return _to##ConditionalSoftwareUpdate(aURL, aRegName, aDiffLevel, aVersion, aMode, aReturn); } \
|
||||
NS_IMETHOD ConditionalSoftwareUpdate(const nsString& aURL, nsIDOMInstallVersion* aRegName, const nsString& aVersion, PRInt32 aMode, PRInt32* aReturn) { return _to##ConditionalSoftwareUpdate(aURL, aDiffLevel, aVersion, aMode, aReturn); } \
|
||||
NS_IMETHOD ConditionalSoftwareUpdate(const nsString& aURL, const nsString& aRegName, const nsString& aVersion, PRInt32 aMode, PRInt32* aReturn) { return _to##ConditionalSoftwareUpdate(aURL, aDiffLevel, aVersion, aMode, aReturn); } \
|
||||
NS_IMETHOD ConditionalSoftwareUpdate(const nsString& aURL, const nsString& aRegName, const nsString& aVersion, PRInt32* aReturn) { return _to##ConditionalSoftwareUpdate(aURL, aDiffLevel, aVersion, aReturn); } \
|
||||
NS_IMETHOD ConditionalSoftwareUpdate(const nsString& aURL, const nsString& aRegName, nsIDOMInstallVersion* aVersion, PRInt32* aReturn) { return _to##ConditionalSoftwareUpdate(aURL, aDiffLevel, aVersion, aReturn); } \
|
||||
NS_IMETHOD CompareVersion(const nsString& aRegName, PRInt32 aMajor, PRInt32 aMinor, PRInt32 aRelease, PRInt32 aBuild, PRInt32* aReturn) { return _to##CompareVersion(aRegName, aMajor, aMinor, aRelease, aBuild, aReturn); } \
|
||||
NS_IMETHOD CompareVersion(const nsString& aRegName, const nsString& aVersion, PRInt32* aReturn) { return _to##CompareVersion(aRegName, aVersion, aReturn); } \
|
||||
NS_IMETHOD CompareVersion(const nsString& aRegName, nsIDOMInstallVersion* aVersion, PRInt32* aReturn) { return _to##CompareVersion(aRegName, aVersion, aReturn); } \
|
||||
|
||||
|
||||
extern nsresult NS_InitInstallTriggerGlobalClass(nsIScriptContext *aContext, void **aPrototype);
|
||||
|
||||
extern "C" NS_DOM nsresult NS_NewScriptInstallTriggerGlobal(nsIScriptContext *aContext, nsISupports *aSupports, nsISupports *aParent, void **aReturn);
|
||||
|
||||
#endif // nsIDOMInstallTriggerGlobal_h__
|
||||
107
mozilla/xpinstall/public/nsIDOMInstallVersion.h
Normal file
107
mozilla/xpinstall/public/nsIDOMInstallVersion.h
Normal file
@@ -0,0 +1,107 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
/* AUTO-GENERATED. DO NOT EDIT!!! */
|
||||
|
||||
#ifndef nsIDOMInstallVersion_h__
|
||||
#define nsIDOMInstallVersion_h__
|
||||
|
||||
#include "nsISupports.h"
|
||||
#include "nsString.h"
|
||||
#include "nsIScriptContext.h"
|
||||
|
||||
class nsIDOMInstallVersion;
|
||||
|
||||
#define NS_IDOMINSTALLVERSION_IID \
|
||||
{ 0x18c2f986, 0xb09f, 0x11d2, \
|
||||
{0xbc, 0xde, 0x00, 0x80, 0x5f, 0x0e, 0x13, 0x53}}
|
||||
|
||||
class nsIDOMInstallVersion : public nsISupports {
|
||||
public:
|
||||
static const nsIID& IID() { static nsIID iid = NS_IDOMINSTALLVERSION_IID; return iid; }
|
||||
enum {
|
||||
EQUAL = 0,
|
||||
BLD_DIFF = 1,
|
||||
BLD_DIFF_MINUS = -1,
|
||||
REL_DIFF = 2,
|
||||
REL_DIFF_MINUS = -2,
|
||||
MINOR_DIFF = 3,
|
||||
MINOR_DIFF_MINUS = -3,
|
||||
MAJOR_DIFF = 4,
|
||||
MAJOR_DIFF_MINUS = -4
|
||||
};
|
||||
|
||||
NS_IMETHOD GetMajor(PRInt32* aMajor)=0;
|
||||
NS_IMETHOD SetMajor(PRInt32 aMajor)=0;
|
||||
|
||||
NS_IMETHOD GetMinor(PRInt32* aMinor)=0;
|
||||
NS_IMETHOD SetMinor(PRInt32 aMinor)=0;
|
||||
|
||||
NS_IMETHOD GetRelease(PRInt32* aRelease)=0;
|
||||
NS_IMETHOD SetRelease(PRInt32 aRelease)=0;
|
||||
|
||||
NS_IMETHOD GetBuild(PRInt32* aBuild)=0;
|
||||
NS_IMETHOD SetBuild(PRInt32 aBuild)=0;
|
||||
|
||||
NS_IMETHOD Init(const nsString& aVersionString)=0;
|
||||
|
||||
NS_IMETHOD ToString(nsString& aReturn)=0;
|
||||
|
||||
NS_IMETHOD CompareTo(nsIDOMInstallVersion* aVersionObject, PRInt32* aReturn)=0;
|
||||
NS_IMETHOD CompareTo(const nsString& aString, PRInt32* aReturn)=0;
|
||||
NS_IMETHOD CompareTo(PRInt32 aMajor, PRInt32 aMinor, PRInt32 aRelease, PRInt32 aBuild, PRInt32* aReturn)=0;
|
||||
};
|
||||
|
||||
|
||||
#define NS_DECL_IDOMINSTALLVERSION \
|
||||
NS_IMETHOD GetMajor(PRInt32* aMajor); \
|
||||
NS_IMETHOD SetMajor(PRInt32 aMajor); \
|
||||
NS_IMETHOD GetMinor(PRInt32* aMinor); \
|
||||
NS_IMETHOD SetMinor(PRInt32 aMinor); \
|
||||
NS_IMETHOD GetRelease(PRInt32* aRelease); \
|
||||
NS_IMETHOD SetRelease(PRInt32 aRelease); \
|
||||
NS_IMETHOD GetBuild(PRInt32* aBuild); \
|
||||
NS_IMETHOD SetBuild(PRInt32 aBuild); \
|
||||
NS_IMETHOD Init(const nsString& aVersionString); \
|
||||
NS_IMETHOD ToString(nsString& aReturn); \
|
||||
NS_IMETHOD CompareTo(nsIDOMInstallVersion* aVersionObject, PRInt32* aReturn); \
|
||||
NS_IMETHOD CompareTo(const nsString& aString, PRInt32* aReturn); \
|
||||
NS_IMETHOD CompareTo(PRInt32 aMajor, PRInt32 aMinor, PRInt32 aRelease, PRInt32 aBuild, PRInt32* aReturn); \
|
||||
|
||||
|
||||
|
||||
#define NS_FORWARD_IDOMINSTALLVERSION(_to) \
|
||||
NS_IMETHOD GetMajor(PRInt32* aMajor) { return _to##GetMajor(aMajor); } \
|
||||
NS_IMETHOD SetMajor(PRInt32 aMajor) { return _to##SetMajor(aMajor); } \
|
||||
NS_IMETHOD GetMinor(PRInt32* aMinor) { return _to##GetMinor(aMinor); } \
|
||||
NS_IMETHOD SetMinor(PRInt32 aMinor) { return _to##SetMinor(aMinor); } \
|
||||
NS_IMETHOD GetRelease(PRInt32* aRelease) { return _to##GetRelease(aRelease); } \
|
||||
NS_IMETHOD SetRelease(PRInt32 aRelease) { return _to##SetRelease(aRelease); } \
|
||||
NS_IMETHOD GetBuild(PRInt32* aBuild) { return _to##GetBuild(aBuild); } \
|
||||
NS_IMETHOD SetBuild(PRInt32 aBuild) { return _to##SetBuild(aBuild); } \
|
||||
NS_IMETHOD Init(const nsString& aVersionString) { return _to##Init(aVersionString); } \
|
||||
NS_IMETHOD ToString(nsString& aReturn) { return _to##ToString(aReturn); } \
|
||||
NS_IMETHOD CompareTo(nsIDOMInstallVersion* aVersionObject, PRInt32* aReturn) { return _to##CompareTo(aVersionObject, aReturn); } \
|
||||
NS_IMETHOD CompareTo(const nsString& aString, PRInt32* aReturn) { return _to##CompareTo(aString, aReturn); } \
|
||||
NS_IMETHOD CompareTo(PRInt32 aMajor, PRInt32 aMinor, PRInt32 aRelease, PRInt32 aBuild, PRInt32* aReturn) { return _to##CompareTo(aMajor, aMinor, aRelease, aBuild, aReturn); } \
|
||||
|
||||
|
||||
extern nsresult NS_InitInstallVersionClass(nsIScriptContext *aContext, void **aPrototype);
|
||||
|
||||
extern "C" NS_DOM nsresult NS_NewScriptInstallVersion(nsIScriptContext *aContext, nsISupports *aSupports, nsISupports *aParent, void **aReturn);
|
||||
|
||||
#endif // nsIDOMInstallVersion_h__
|
||||
85
mozilla/xpinstall/public/nsISoftwareUpdate.h
Normal file
85
mozilla/xpinstall/public/nsISoftwareUpdate.h
Normal file
@@ -0,0 +1,85 @@
|
||||
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "License"); you may not use this file except in
|
||||
* compliance with the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is Mozilla Communicator client code,
|
||||
* released March 31, 1998.
|
||||
*
|
||||
* The Initial Developer of the Original Code is Netscape Communications
|
||||
* Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*
|
||||
* Contributors:
|
||||
* Daniel Veditz <dveditz@netscape.com>
|
||||
* Douglas Turner <dougt@netscape.com>
|
||||
*/
|
||||
|
||||
#ifndef nsISoftwareUpdate_h__
|
||||
#define nsISoftwareUpdate_h__
|
||||
|
||||
#include "nsISupports.h"
|
||||
#include "nsIFactory.h"
|
||||
#include "nsString.h"
|
||||
|
||||
#include "nsIXPInstallProgress.h"
|
||||
|
||||
#define NS_IXPINSTALLCOMPONENT_PROGID NS_IAPPSHELLCOMPONENT_PROGID "/xpinstall"
|
||||
#define NS_IXPINSTALLCOMPONENT_CLASSNAME "Mozilla XPInstall Component"
|
||||
|
||||
|
||||
#define NS_ISOFTWAREUPDATE_IID \
|
||||
{ 0x18c2f992, \
|
||||
0xb09f, \
|
||||
0x11d2, \
|
||||
{0xbc, 0xde, 0x00, 0x80, 0x5f, 0x0e, 0x13, 0x53}\
|
||||
}
|
||||
|
||||
|
||||
class nsISoftwareUpdate : public nsISupports
|
||||
{
|
||||
public:
|
||||
NS_DEFINE_STATIC_IID_ACCESSOR(NS_ISOFTWAREUPDATE_IID)
|
||||
|
||||
NS_IMETHOD InstallJar(const nsString& fromURL,
|
||||
const nsString& localFile,
|
||||
long flags) = 0;
|
||||
|
||||
NS_IMETHOD RegisterNotifier(nsIXPInstallProgress *notifier) = 0;
|
||||
|
||||
NS_IMETHOD InstallPending(void) = 0;
|
||||
|
||||
/* FIX: these should be in a private interface */
|
||||
NS_IMETHOD InstallJarCallBack() = 0;
|
||||
NS_IMETHOD GetTopLevelNotifier(nsIXPInstallProgress **notifier) = 0;
|
||||
};
|
||||
|
||||
|
||||
class nsSoftwareUpdateFactory : public nsIFactory
|
||||
{
|
||||
public:
|
||||
|
||||
nsSoftwareUpdateFactory();
|
||||
virtual ~nsSoftwareUpdateFactory();
|
||||
|
||||
NS_DECL_ISUPPORTS
|
||||
|
||||
NS_IMETHOD CreateInstance(nsISupports *aOuter,
|
||||
REFNSIID aIID,
|
||||
void **aResult);
|
||||
|
||||
NS_IMETHOD LockFactory(PRBool aLock);
|
||||
|
||||
};
|
||||
|
||||
|
||||
#endif // nsISoftwareUpdate_h__
|
||||
|
||||
30
mozilla/xpinstall/public/nsIXPInstallProgress.idl
Normal file
30
mozilla/xpinstall/public/nsIXPInstallProgress.idl
Normal file
@@ -0,0 +1,30 @@
|
||||
/* -*- Mode: IDL; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
|
||||
#include "nsISupports.idl"
|
||||
|
||||
[uuid(eea90d40-b059-11d2-915e-c12b696c9333)]
|
||||
interface nsIXPInstallProgress : nsISupports
|
||||
{
|
||||
void BeforeJavascriptEvaluation();
|
||||
void AfterJavascriptEvaluation();
|
||||
void InstallStarted([const] in string UIPackageName);
|
||||
void ItemScheduled([const] in string message );
|
||||
void InstallFinalization([const] in string message, in long itemNum, in long totNum );
|
||||
void InstallAborted();
|
||||
};
|
||||
93
mozilla/xpinstall/public/nsIXPInstallProgressNotifier.h
Normal file
93
mozilla/xpinstall/public/nsIXPInstallProgressNotifier.h
Normal file
@@ -0,0 +1,93 @@
|
||||
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "License"); you may not use this file except in
|
||||
* compliance with the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is Mozilla Communicator client code,
|
||||
* released March 31, 1998.
|
||||
*
|
||||
* The Initial Developer of the Original Code is Netscape Communications
|
||||
* Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*
|
||||
* Contributors:
|
||||
* Douglas Turner <dougt@netscape.com>
|
||||
*/
|
||||
|
||||
|
||||
#ifndef nsIXPInstallProgressNotifier_h__
|
||||
#define nsIXPInstallProgressNotifier_h__
|
||||
|
||||
|
||||
class nsIXPInstallProgressNotifier
|
||||
{
|
||||
public:
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Function name : BeforeJavascriptEvaluation
|
||||
// Description : This will be called when prior to the install script being evaluate
|
||||
// Return type : void
|
||||
// Argument : void
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
virtual void BeforeJavascriptEvaluation(void) = 0;
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Function name : AfterJavascriptEvaluation
|
||||
// Description : This will be called after the install script has being evaluated
|
||||
// Return type : void
|
||||
// Argument : void
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
virtual void AfterJavascriptEvaluation(void) = 0;
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Function name : InstallStarted
|
||||
// Description : This will be called when StartInstall has been called
|
||||
// Return type : void
|
||||
// Argument : char* UIPackageName - User Package Name
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
virtual void InstallStarted(const char* UIPackageName) = 0;
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Function name : ItemScheduled
|
||||
// Description : This will be called when items are being scheduled
|
||||
// Return type : Any value returned other than zero, will be treated as an error and the script will be aborted
|
||||
// Argument : The message that should be displayed to the user
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
virtual long ItemScheduled( const char* message ) = 0;
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Function name : InstallFinalization
|
||||
// Description : This will be called when the installation is in its Finalize stage
|
||||
// Return type : void
|
||||
// Argument : char* message - The message that should be displayed to the user
|
||||
// Argument : long itemNum - This is the current item number
|
||||
// Argument : long totNum - This is the total number of items
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
virtual void InstallFinalization( const char* message, long itemNum, long totNum ) = 0;
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Function name : InstallAborted
|
||||
// Description : This will be called when the install is aborted
|
||||
// Return type : void
|
||||
// Argument : void
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
virtual void InstallAborted(void) = 0;
|
||||
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
64
mozilla/xpinstall/public/nsSoftwareUpdateIIDs.h
Normal file
64
mozilla/xpinstall/public/nsSoftwareUpdateIIDs.h
Normal file
@@ -0,0 +1,64 @@
|
||||
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "License"); you may not use this file except in
|
||||
* compliance with the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is Mozilla Communicator client code,
|
||||
* released March 31, 1998.
|
||||
*
|
||||
* The Initial Developer of the Original Code is Netscape Communications
|
||||
* Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*
|
||||
* Contributors:
|
||||
* Daniel Veditz <dveditz@netscape.com>
|
||||
* Douglas Turner <dougt@netscape.com>
|
||||
*/
|
||||
|
||||
#ifndef nsSoftwareUpdateIIDs_h___
|
||||
#define nsSoftwareUpdateIIDs_h___
|
||||
|
||||
#define NS_SoftwareUpdate_CID \
|
||||
{ /* 18c2f989-b09f-11d2-bcde-00805f0e1353 */ \
|
||||
0x18c2f989, \
|
||||
0xb09f, \
|
||||
0x11d2, \
|
||||
{0xbc, 0xde, 0x00, 0x80, 0x5f, 0x0e, 0x13, 0x53} \
|
||||
}
|
||||
|
||||
#define NS_SoftwareUpdateInstall_CID \
|
||||
{ /* 18c2f98b-b09f-11d2-bcde-00805f0e1353 */ \
|
||||
0x18c2f98b, \
|
||||
0xb09f, \
|
||||
0x11d2, \
|
||||
{0xbc, 0xde, 0x00, 0x80, 0x5f, 0x0e, 0x13, 0x53} \
|
||||
}
|
||||
|
||||
#define NS_SoftwareUpdateInstallTrigger_CID \
|
||||
{ /* 18c2f98d-b09f-11d2-bcde-00805f0e1353 */ \
|
||||
0x18c2f98d, \
|
||||
0xb09f, \
|
||||
0x11d2, \
|
||||
{0xbc, 0xde, 0x00, 0x80, 0x5f, 0x0e, 0x13, 0x53} \
|
||||
}
|
||||
|
||||
#define NS_SoftwareUpdateInstallVersion_CID \
|
||||
{ /* 18c2f98f-b09f-11d2-bcde-00805f0e1353 */ \
|
||||
0x18c2f98f, \
|
||||
0xb09f, \
|
||||
0x11d2, \
|
||||
{0xbc, 0xde, 0x00, 0x80, 0x5f, 0x0e, 0x13, 0x53} \
|
||||
}
|
||||
|
||||
|
||||
|
||||
#endif /* nsSoftwareUpdateIIDs_h___ */
|
||||
|
||||
3
mozilla/xpinstall/res/MANIFEST
Normal file
3
mozilla/xpinstall/res/MANIFEST
Normal file
@@ -0,0 +1,3 @@
|
||||
progress.xul
|
||||
progress.css
|
||||
progress.html
|
||||
34
mozilla/xpinstall/res/Makefile.in
Normal file
34
mozilla/xpinstall/res/Makefile.in
Normal file
@@ -0,0 +1,34 @@
|
||||
#!gmake
|
||||
#
|
||||
# The contents of this file are subject to the Netscape Public License
|
||||
# Version 1.0 (the "NPL"); you may not use this file except in
|
||||
# compliance with the NPL. You may obtain a copy of the NPL at
|
||||
# http://www.mozilla.org/NPL/
|
||||
#
|
||||
# Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
# for the specific language governing rights and limitations under the
|
||||
# NPL.
|
||||
#
|
||||
# The Initial Developer of this code under the NPL is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
# Reserved.
|
||||
|
||||
DEPTH=../..
|
||||
topsrcdir = @top_srcdir@
|
||||
srcdir = @srcdir@
|
||||
VPATH = @srcdir@
|
||||
|
||||
include $(DEPTH)/config/autoconf.mk
|
||||
include $(topsrcdir)/config/config.mk
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
|
||||
EXPORT_RESOURCE_XPINSTALL = \
|
||||
$(srcdir)/progress.xul \
|
||||
$(srcdir)/progress.html \
|
||||
$(srcdir)/progress.css \
|
||||
$(NULL)
|
||||
|
||||
install::
|
||||
$(INSTALL) $(EXPORT_RESOURCE_XPINSTALL) $(DIST)/bin/res/xpinstall
|
||||
31
mozilla/xpinstall/res/makefile.win
Normal file
31
mozilla/xpinstall/res/makefile.win
Normal file
@@ -0,0 +1,31 @@
|
||||
#!nmake
|
||||
#
|
||||
# The contents of this file are subject to the Netscape Public License
|
||||
# Version 1.0 (the "NPL"); you may not use this file except in
|
||||
# compliance with the NPL. You may obtain a copy of the NPL at
|
||||
# http://www.mozilla.org/NPL/
|
||||
#
|
||||
# Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
# for the specific language governing rights and limitations under the
|
||||
# NPL.
|
||||
#
|
||||
# The Initial Developer of this code under the NPL is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
# Reserved.
|
||||
|
||||
DEPTH=..\..
|
||||
IGNORE_MANIFEST=1
|
||||
|
||||
include <$(DEPTH)\config\rules.mak>
|
||||
|
||||
install:: $(DLL)
|
||||
$(MAKE_INSTALL) progress.xul $(DIST)\bin\res\xpinstall
|
||||
$(MAKE_INSTALL) progress.css $(DIST)\bin\res\xpinstall
|
||||
$(MAKE_INSTALL) progress.html $(DIST)\bin\res\xpinstall
|
||||
|
||||
clobber::
|
||||
rm -f $(DIST)\res\xpinstall\progress.xul
|
||||
rm -f $(DIST)\res\xpinstall\progress.css
|
||||
rm -f $(DIST)\res\xpinstall\progress.html
|
||||
3
mozilla/xpinstall/res/progress.css
Normal file
3
mozilla/xpinstall/res/progress.css
Normal file
@@ -0,0 +1,3 @@
|
||||
TD {
|
||||
font: 10pt sans-serif;
|
||||
}
|
||||
16
mozilla/xpinstall/res/progress.html
Normal file
16
mozilla/xpinstall/res/progress.html
Normal file
@@ -0,0 +1,16 @@
|
||||
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
|
||||
<html>
|
||||
<body bgcolor="#C0C0C0" style="overflow:visible; margin: 0px; color-background: rgb(192,192,192);">
|
||||
<center>
|
||||
<table BORDER COLS=5 WIDTH="99%" style="color-background:rgb(192,192,192);">
|
||||
<tr>
|
||||
<td WIDTH="3%" NOWRAP style="border: 1px inset rgb(192,192,192);"> </td>
|
||||
<td WIDTH="3%" NOWRAP style="border: 1px inset rgb(192,192,192);"> </td>
|
||||
<td WIDTH="3%" NOWRAP style="border: 1px inset rgb(192,192,192);"> </td>
|
||||
<td WIDTH="10%" NOWRAP style="border: 1px inset rgb(192,192,192);"> </td>
|
||||
<td WIDTH="81%" NOWRAP style="border: 1px inset rgb(192,192,192);"> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</center>
|
||||
</body>
|
||||
</html>
|
||||
67
mozilla/xpinstall/res/progress.xul
Normal file
67
mozilla/xpinstall/res/progress.xul
Normal file
@@ -0,0 +1,67 @@
|
||||
<?xml version="1.0"?>
|
||||
<?xml-stylesheet href="../samples/xul.css" type="text/css"?>
|
||||
<?xml-stylesheet href="progress.css" type="text/css"?>
|
||||
|
||||
<!DOCTYPE window
|
||||
[
|
||||
<!ENTITY downloadWindow.title "XPInstall Progress">
|
||||
<!ENTITY status "Status:">
|
||||
<!ENTITY cancelButtonTitle "Cancel">
|
||||
]
|
||||
>
|
||||
|
||||
<window xmlns:html="http://www.w3.org/TR/REC-html40"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
||||
title="XPInstall Progress"
|
||||
width="425"
|
||||
height="225">
|
||||
|
||||
<data>
|
||||
<broadcaster id="data.canceled" type="string" value="false"/>
|
||||
</data>
|
||||
|
||||
|
||||
<html:script>
|
||||
|
||||
function cancelInstall()
|
||||
{
|
||||
var cancelData = document.getElementById("data.canceled");
|
||||
cancelData.setAttribute( "value", "true");
|
||||
}
|
||||
|
||||
</html:script>
|
||||
|
||||
<html:center>
|
||||
<html:table style="width:100%;">
|
||||
|
||||
<html:tr>
|
||||
<html:td align="center">
|
||||
<html:input id="dialog.uiPackageName" readonly="" style="background-color:lightgray;width:300px;"/>
|
||||
</html:td>
|
||||
</html:tr>
|
||||
|
||||
<html:tr>
|
||||
<html:td nowrap="" style="border: 1px rgb(192,192,192);" align="center">
|
||||
<html:input id="dialog.currentAction" readonly="" style="background-color:lightgray;width:450px;"/>
|
||||
</html:td>
|
||||
</html:tr>
|
||||
|
||||
|
||||
<html:tr>
|
||||
<html:td align="center" width="15%" nowrap="" style="border: 1px rgb(192,192,192);">
|
||||
<progressmeter id="dialog.progress" mode="undetermined" style="width:300px;height:16px;">
|
||||
</progressmeter>
|
||||
</html:td>
|
||||
</html:tr>
|
||||
|
||||
<html:tr>
|
||||
<html:td align="center" width="3%" nowrap="" style="border: 1px rgb(192,192,192);">
|
||||
<html:button onclick="cancelInstall()" height="12">
|
||||
&cancelButtonTitle;
|
||||
</html:button>
|
||||
</html:td>
|
||||
</html:tr>
|
||||
</html:table>
|
||||
|
||||
</html:center>
|
||||
</window>
|
||||
61
mozilla/xpinstall/src/Makefile.in
Normal file
61
mozilla/xpinstall/src/Makefile.in
Normal file
@@ -0,0 +1,61 @@
|
||||
#!gmake
|
||||
#
|
||||
# The contents of this file are subject to the Netscape Public License
|
||||
# Version 1.0 (the "License"); you may not use this file except in
|
||||
# compliance with the License. You may obtain a copy of the License at
|
||||
# http://www.mozilla.org/NPL/
|
||||
#
|
||||
# Software distributed under the License is distributed on an "AS IS" basis,
|
||||
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
# for the specific language governing rights and limitations under the
|
||||
# License.
|
||||
#
|
||||
# The Original Code is Mozilla Communicator client code,
|
||||
# released March 31, 1998.
|
||||
#
|
||||
# The Initial Developer of the Original Code is Netscape Communications
|
||||
# Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
# Reserved.
|
||||
#
|
||||
# Contributors:
|
||||
# Daniel Veditz <dveditz@netscape.com>
|
||||
# Douglas Turner <dougt@netscape.com>
|
||||
|
||||
DEPTH = ../..
|
||||
topsrcdir = @top_srcdir@
|
||||
VPATH = @srcdir@
|
||||
srcdir = @srcdir@
|
||||
|
||||
include $(DEPTH)/config/autoconf.mk
|
||||
|
||||
MODULE = xpinstall
|
||||
LIBRARY_NAME = xpinstall
|
||||
IS_COMPONENT = 1
|
||||
REQUIRES = dom js netlib raptor xpcom
|
||||
|
||||
CPPSRCS = \
|
||||
nsSoftwareUpdate.cpp \
|
||||
nsInstall.cpp \
|
||||
nsInstallDelete.cpp \
|
||||
nsInstallExecute.cpp \
|
||||
nsInstallFile.cpp \
|
||||
nsInstallFolder.cpp \
|
||||
nsInstallPatch.cpp \
|
||||
nsInstallUninstall.cpp \
|
||||
nsInstallTrigger.cpp \
|
||||
nsInstallResources.cpp \
|
||||
nsJSInstall.cpp \
|
||||
nsJSInstallTriggerGlobal.cpp\
|
||||
nsSoftwareUpdateRun.cpp \
|
||||
nsSoftwareUpdateStream.cpp \
|
||||
nsTopProgressNotifier.cpp \
|
||||
nsLoggingProgressNotifier \
|
||||
ScheduledTasks.cpp \
|
||||
nsInstallFileOpItem.cpp \
|
||||
$(NULL)
|
||||
|
||||
INCLUDES += -I$(srcdir)/../public
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
|
||||
1854
mozilla/xpinstall/src/PatchableAppleSingle.cpp
Normal file
1854
mozilla/xpinstall/src/PatchableAppleSingle.cpp
Normal file
File diff suppressed because it is too large
Load Diff
233
mozilla/xpinstall/src/PatchableAppleSingle.h
Normal file
233
mozilla/xpinstall/src/PatchableAppleSingle.h
Normal file
@@ -0,0 +1,233 @@
|
||||
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
|
||||
/*
|
||||
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
|
||||
* Version 1.0 (the "License"); you may not use this file except in
|
||||
|
||||
* compliance with the License. You may obtain a copy of the License at
|
||||
|
||||
* http://www.mozilla.org/NPL/
|
||||
|
||||
*
|
||||
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
|
||||
* for the specific language governing rights and limitations under the
|
||||
|
||||
* License.
|
||||
|
||||
*
|
||||
|
||||
* The Original Code is Mozilla Communicator client code,
|
||||
|
||||
* released March 31, 1998.
|
||||
|
||||
*
|
||||
|
||||
* The Initial Developer of the Original Code is Netscape Communications
|
||||
|
||||
* Corporation. Portions created by Netscape are
|
||||
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
|
||||
* Reserved.
|
||||
|
||||
*
|
||||
|
||||
* Contributors:
|
||||
|
||||
* Douglas Turner <dougt@netscape.com>
|
||||
|
||||
*/
|
||||
|
||||
|
||||
|
||||
#ifndef SU_PAS_H
|
||||
|
||||
#define SU_PAS_H
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#include <Errors.h>
|
||||
|
||||
#include <Types.h>
|
||||
|
||||
#include <Files.h>
|
||||
|
||||
#include <Script.h>
|
||||
|
||||
#include <Resources.h>
|
||||
|
||||
|
||||
|
||||
typedef struct PASHeader /* header portion of Patchable AppleSingle */
|
||||
|
||||
{
|
||||
|
||||
UInt32 magicNum; /* internal file type tag = 0x00244200*/
|
||||
|
||||
UInt32 versionNum; /* format version: 1 = 0x00010000 */
|
||||
|
||||
UInt8 filler[16]; /* filler */
|
||||
|
||||
UInt16 numEntries; /* number of entries which follow */
|
||||
|
||||
} PASHeader ;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
typedef struct PASEntry /* one Patchable AppleSingle entry descriptor */
|
||||
|
||||
{
|
||||
|
||||
UInt32 entryID; /* entry type: see list, 0 invalid */
|
||||
|
||||
UInt32 entryOffset; /* offset, in bytes, from beginning */
|
||||
|
||||
/* of file to this entry's data */
|
||||
|
||||
UInt32 entryLength; /* length of data in octets */
|
||||
|
||||
|
||||
|
||||
} PASEntry;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
typedef struct PASMiscInfo
|
||||
|
||||
{
|
||||
|
||||
short fileHasResFork;
|
||||
|
||||
short fileResAttrs;
|
||||
|
||||
OSType fileType;
|
||||
|
||||
OSType fileCreator;
|
||||
|
||||
UInt32 fileFlags;
|
||||
|
||||
|
||||
|
||||
} PASMiscInfo;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
typedef struct PASResFork
|
||||
|
||||
{
|
||||
|
||||
short NumberOfTypes;
|
||||
|
||||
|
||||
|
||||
} PASResFork;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
typedef struct PASResource
|
||||
|
||||
{
|
||||
|
||||
short attr;
|
||||
|
||||
short attrID;
|
||||
|
||||
OSType attrType;
|
||||
|
||||
Str255 attrName;
|
||||
|
||||
unsigned long length;
|
||||
|
||||
|
||||
|
||||
} PASResource;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#if PRAGMA_ALIGN_SUPPORTED
|
||||
|
||||
#pragma options align=reset
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#define kCreator 'MOSS'
|
||||
|
||||
#define kType 'PASf'
|
||||
|
||||
#define PAS_BUFFER_SIZE (1024*512)
|
||||
|
||||
|
||||
|
||||
#define PAS_MAGIC_NUM (0x00244200)
|
||||
|
||||
#define PAS_VERSION (0x00010000)
|
||||
|
||||
|
||||
|
||||
enum
|
||||
|
||||
{
|
||||
|
||||
ePas_Data = 1,
|
||||
|
||||
ePas_Misc,
|
||||
|
||||
ePas_Resource
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
extern "C" {
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
/* Prototypes */
|
||||
|
||||
OSErr PAS_EncodeFile(FSSpec *inSpec, FSSpec *outSpec);
|
||||
|
||||
OSErr PAS_DecodeFile(FSSpec *inSpec, FSSpec *outSpec);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#endif /* SU_PAS_H */
|
||||
380
mozilla/xpinstall/src/ScheduledTasks.cpp
Normal file
380
mozilla/xpinstall/src/ScheduledTasks.cpp
Normal file
@@ -0,0 +1,380 @@
|
||||
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "License"); you may not use this file except in
|
||||
* compliance with the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is Mozilla Communicator client code,
|
||||
* released March 31, 1998.
|
||||
*
|
||||
* The Initial Developer of the Original Code is Netscape Communications
|
||||
* Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*
|
||||
* Contributors:
|
||||
* Daniel Veditz <dveditz@netscape.com>
|
||||
* Douglas Turner <dougt@netscape.com>
|
||||
*/
|
||||
|
||||
#include "nscore.h"
|
||||
#include "NSReg.h"
|
||||
#include "nsFileSpec.h"
|
||||
#include "nsFileStream.h"
|
||||
#include "nsInstall.h" // for error codes
|
||||
#include "prmem.h"
|
||||
#include "ScheduledTasks.h"
|
||||
|
||||
#ifdef _WINDOWS
|
||||
#include <sys/stat.h>
|
||||
#include <windows.h>
|
||||
|
||||
BOOL WIN32_IsMoveFileExBroken()
|
||||
{
|
||||
/* the NT option MOVEFILE_DELAY_UNTIL_REBOOT is broken on
|
||||
* Windows NT 3.51 Service Pack 4 and NT 4.0 before Service Pack 2
|
||||
*/
|
||||
BOOL broken = FALSE;
|
||||
OSVERSIONINFO osinfo;
|
||||
|
||||
// they *all* appear broken--better to have one way that works.
|
||||
return TRUE;
|
||||
|
||||
osinfo.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
|
||||
if (GetVersionEx(&osinfo) && osinfo.dwPlatformId == VER_PLATFORM_WIN32_NT)
|
||||
{
|
||||
if ( osinfo.dwMajorVersion == 3 && osinfo.dwMinorVersion == 51 )
|
||||
{
|
||||
if ( 0 == stricmp(osinfo.szCSDVersion,"Service Pack 4"))
|
||||
{
|
||||
broken = TRUE;
|
||||
}
|
||||
}
|
||||
else if ( osinfo.dwMajorVersion == 4 )
|
||||
{
|
||||
if (osinfo.szCSDVersion[0] == '\0' ||
|
||||
(0 == stricmp(osinfo.szCSDVersion,"Service Pack 1")))
|
||||
{
|
||||
broken = TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return broken;
|
||||
}
|
||||
|
||||
|
||||
PRInt32 DoWindowsReplaceExistingFileStuff(const char* currentName, const char* finalName)
|
||||
{
|
||||
PRInt32 err = 0;
|
||||
|
||||
char* final = strdup(finalName);
|
||||
char* current = strdup(currentName);
|
||||
|
||||
/* couldn't delete, probably in use. Schedule for later */
|
||||
DWORD dwVersion, dwWindowsMajorVersion;
|
||||
|
||||
/* Get OS version info */
|
||||
dwVersion = GetVersion();
|
||||
dwWindowsMajorVersion = (DWORD)(LOBYTE(LOWORD(dwVersion)));
|
||||
|
||||
/* Get build numbers for Windows NT or Win32s */
|
||||
|
||||
if (dwVersion < 0x80000000) // Windows NT
|
||||
{
|
||||
/* On Windows NT */
|
||||
if ( WIN32_IsMoveFileExBroken() )
|
||||
{
|
||||
/* the MOVEFILE_DELAY_UNTIL_REBOOT option doesn't work on
|
||||
* NT 3.51 SP4 or on NT 4.0 until SP2
|
||||
*/
|
||||
struct stat statbuf;
|
||||
PRBool nameFound = PR_FALSE;
|
||||
char tmpname[_MAX_PATH];
|
||||
|
||||
strncpy( tmpname, finalName, _MAX_PATH );
|
||||
int len = strlen(tmpname);
|
||||
while (!nameFound && len < _MAX_PATH )
|
||||
{
|
||||
tmpname[len-1] = '~';
|
||||
tmpname[len] = '\0';
|
||||
if ( stat(tmpname, &statbuf) != 0 )
|
||||
nameFound = TRUE;
|
||||
else
|
||||
len++;
|
||||
}
|
||||
|
||||
if ( nameFound )
|
||||
{
|
||||
if ( MoveFile( finalName, tmpname ) )
|
||||
{
|
||||
if ( MoveFile( currentName, finalName ) )
|
||||
{
|
||||
DeleteFileNowOrSchedule(nsFileSpec(tmpname));
|
||||
}
|
||||
else
|
||||
{
|
||||
/* 2nd move failed, put old file back */
|
||||
MoveFile( tmpname, finalName );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
/* non-executable in use; schedule for later */
|
||||
return -1; // let the start registry stuff do our work!
|
||||
}
|
||||
}
|
||||
}
|
||||
else if ( MoveFileEx(currentName, finalName, MOVEFILE_DELAY_UNTIL_REBOOT) )
|
||||
{
|
||||
err = 0;
|
||||
}
|
||||
}
|
||||
else // Windows 95 or Win16
|
||||
{
|
||||
/*
|
||||
* Place an entry in the WININIT.INI file in the Windows directory
|
||||
* to delete finalName and rename currentName to be finalName at reboot
|
||||
*/
|
||||
|
||||
int strlen;
|
||||
char Src[_MAX_PATH]; // 8.3 name
|
||||
char Dest[_MAX_PATH]; // 8.3 name
|
||||
|
||||
strlen = GetShortPathName( (LPCTSTR)currentName, (LPTSTR)Src, (DWORD)sizeof(Src) );
|
||||
if ( strlen > 0 )
|
||||
{
|
||||
free(current);
|
||||
current = strdup(Src);
|
||||
}
|
||||
|
||||
strlen = GetShortPathName( (LPCTSTR) finalName, (LPTSTR) Dest, (DWORD) sizeof(Dest));
|
||||
if ( strlen > 0 )
|
||||
{
|
||||
free(final);
|
||||
final = strdup(Dest);
|
||||
}
|
||||
|
||||
/* NOTE: use OEM filenames! Even though it looks like a Windows
|
||||
* .INI file, WININIT.INI is processed under DOS
|
||||
*/
|
||||
|
||||
AnsiToOem( final, final );
|
||||
AnsiToOem( current, current );
|
||||
|
||||
if ( WritePrivateProfileString( "Rename", final, current, "WININIT.INI" ) )
|
||||
err = 0;
|
||||
}
|
||||
|
||||
free(final);
|
||||
free(current);
|
||||
|
||||
return err;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
REGERR DeleteFileNowOrSchedule(nsFileSpec& filename)
|
||||
{
|
||||
|
||||
REGERR result = 0;
|
||||
|
||||
filename.Delete(false);
|
||||
|
||||
if (filename.Exists())
|
||||
{
|
||||
RKEY newkey;
|
||||
HREG reg;
|
||||
if ( REGERR_OK == NR_RegOpen("", ®) )
|
||||
{
|
||||
if (REGERR_OK == NR_RegAddKey( reg, ROOTKEY_PRIVATE, REG_DELETE_LIST_KEY, &newkey) )
|
||||
{
|
||||
// FIX should be using nsPersistentFileDescriptor!!!
|
||||
|
||||
result = NR_RegSetEntry( reg, newkey, (char*)(const char*)filename.GetNativePathCString(), REGTYPE_ENTRY_FILE, nsnull, 0);
|
||||
if (result == REGERR_OK)
|
||||
result = nsInstall::REBOOT_NEEDED;
|
||||
}
|
||||
|
||||
NR_RegClose(reg);
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
/* tmp file is the bad one that we want to replace with target. */
|
||||
|
||||
REGERR ReplaceFileNowOrSchedule(nsFileSpec& replacementFile, nsFileSpec& doomedFile )
|
||||
{
|
||||
REGERR result = 0;
|
||||
|
||||
if(replacementFile == doomedFile)
|
||||
{
|
||||
/* do not have to do anything */
|
||||
return result;
|
||||
}
|
||||
|
||||
doomedFile.Delete(false);
|
||||
|
||||
if (! doomedFile.Exists() )
|
||||
{
|
||||
// Now that we have move the existing file, we can move the mExtracedFile into place.
|
||||
nsFileSpec parentofFinalFile;
|
||||
|
||||
doomedFile.GetParent(parentofFinalFile);
|
||||
result = replacementFile.Move(parentofFinalFile);
|
||||
if ( NS_SUCCEEDED(result) )
|
||||
{
|
||||
char* leafName = doomedFile.GetLeafName();
|
||||
replacementFile.Rename(leafName);
|
||||
nsCRT::free(leafName);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
#ifdef _WINDOWS
|
||||
if (DoWindowsReplaceExistingFileStuff(replacementFile.GetNativePathCString(), doomedFile.GetNativePathCString()) == 0)
|
||||
return 0;
|
||||
#endif
|
||||
|
||||
RKEY newkey;
|
||||
HREG reg;
|
||||
|
||||
if ( REGERR_OK == NR_RegOpen("", ®) )
|
||||
{
|
||||
result = NR_RegAddKey( reg, ROOTKEY_PRIVATE, REG_REPLACE_LIST_KEY, &newkey);
|
||||
if ( result == REGERR_OK )
|
||||
{
|
||||
char* replacementFileName = (char*)(const char*)replacementFile.GetNativePathCString();
|
||||
result = NR_RegSetEntry( reg, newkey, (char*)(const char*)doomedFile.GetNativePathCString(), REGTYPE_ENTRY_FILE, replacementFileName, strlen(replacementFileName));
|
||||
if (result == REGERR_OK)
|
||||
result = nsInstall::REBOOT_NEEDED;
|
||||
}
|
||||
|
||||
NR_RegClose(reg);
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
void DeleteScheduledFiles(void);
|
||||
void ReplaceScheduledFiles(void);
|
||||
|
||||
extern "C" void PerformScheduledTasks(void *data)
|
||||
{
|
||||
DeleteScheduledFiles();
|
||||
ReplaceScheduledFiles();
|
||||
}
|
||||
|
||||
|
||||
void DeleteScheduledFiles(void)
|
||||
{
|
||||
HREG reg;
|
||||
|
||||
if (REGERR_OK == NR_RegOpen("", ®))
|
||||
{
|
||||
RKEY key;
|
||||
REGENUM state;
|
||||
|
||||
/* perform scheduled file deletions and replacements (PC only) */
|
||||
if (REGERR_OK == NR_RegGetKey(reg, ROOTKEY_PRIVATE, REG_DELETE_LIST_KEY,&key))
|
||||
{
|
||||
char buf[MAXREGNAMELEN];
|
||||
|
||||
while (REGERR_OK == NR_RegEnumEntries(reg, key, &state, buf, sizeof(buf), NULL ))
|
||||
{
|
||||
nsFileSpec doomedFile(buf);
|
||||
|
||||
doomedFile.Delete(PR_FALSE);
|
||||
|
||||
if (! doomedFile.Exists())
|
||||
{
|
||||
NR_RegDeleteEntry( reg, key, buf );
|
||||
}
|
||||
}
|
||||
|
||||
/* delete list node if empty */
|
||||
if (REGERR_NOMORE == NR_RegEnumEntries( reg, key, &state, buf, sizeof(buf), NULL ))
|
||||
{
|
||||
NR_RegDeleteKey(reg, ROOTKEY_PRIVATE, REG_DELETE_LIST_KEY);
|
||||
}
|
||||
}
|
||||
|
||||
NR_RegClose(reg);
|
||||
}
|
||||
}
|
||||
|
||||
void ReplaceScheduledFiles(void)
|
||||
{
|
||||
HREG reg;
|
||||
|
||||
if (REGERR_OK == NR_RegOpen("", ®))
|
||||
{
|
||||
RKEY key;
|
||||
REGENUM state;
|
||||
|
||||
/* replace files if any listed */
|
||||
if (REGERR_OK == NR_RegGetKey(reg, ROOTKEY_PRIVATE, REG_REPLACE_LIST_KEY, &key))
|
||||
{
|
||||
char tmpfile[MAXREGNAMELEN];
|
||||
char target[MAXREGNAMELEN];
|
||||
|
||||
state = 0;
|
||||
while (REGERR_OK == NR_RegEnumEntries(reg, key, &state, tmpfile, sizeof(tmpfile), NULL ))
|
||||
{
|
||||
|
||||
nsFileSpec replaceFile(tmpfile);
|
||||
|
||||
if (! replaceFile.Exists() )
|
||||
{
|
||||
NR_RegDeleteEntry( reg, key, tmpfile );
|
||||
}
|
||||
else if ( REGERR_OK != NR_RegGetEntryString( reg, key, tmpfile, target, sizeof(target) ) )
|
||||
{
|
||||
/* can't read target filename, corruption? */
|
||||
NR_RegDeleteEntry( reg, key, tmpfile );
|
||||
}
|
||||
else
|
||||
{
|
||||
nsFileSpec targetFile(target);
|
||||
|
||||
targetFile.Delete(PR_FALSE);
|
||||
|
||||
if (!targetFile.Exists())
|
||||
{
|
||||
nsFileSpec parentofTarget;
|
||||
targetFile.GetParent(parentofTarget);
|
||||
|
||||
nsresult result = replaceFile.Move(parentofTarget);
|
||||
if ( NS_SUCCEEDED(result) )
|
||||
{
|
||||
char* leafName = targetFile.GetLeafName();
|
||||
replaceFile.Rename(leafName);
|
||||
nsCRT::free(leafName);
|
||||
|
||||
NR_RegDeleteEntry( reg, key, tmpfile );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
/* delete list node if empty */
|
||||
if (REGERR_NOMORE == NR_RegEnumEntries(reg, key, &state, tmpfile, sizeof(tmpfile), NULL ))
|
||||
{
|
||||
NR_RegDeleteKey(reg, ROOTKEY_PRIVATE, REG_REPLACE_LIST_KEY);
|
||||
}
|
||||
}
|
||||
|
||||
NR_RegClose(reg);
|
||||
}
|
||||
}
|
||||
42
mozilla/xpinstall/src/ScheduledTasks.h
Normal file
42
mozilla/xpinstall/src/ScheduledTasks.h
Normal file
@@ -0,0 +1,42 @@
|
||||
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "License"); you may not use this file except in
|
||||
* compliance with the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is Mozilla Communicator client code,
|
||||
* released March 31, 1998.
|
||||
*
|
||||
* The Initial Developer of the Original Code is Netscape Communications
|
||||
* Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*
|
||||
* Contributors:
|
||||
* Daniel Veditz <dveditz@netscape.com>
|
||||
* Douglas Turner <dougt@netscape.com>
|
||||
*/
|
||||
|
||||
|
||||
#ifndef __SCHEDULEDTASKS_H__
|
||||
#define __SCHEDULEDTASKS_H__
|
||||
|
||||
|
||||
#include "NSReg.h"
|
||||
#include "nsFileSpec.h"
|
||||
|
||||
|
||||
REGERR DeleteFileNowOrSchedule(nsFileSpec& filename);
|
||||
REGERR ReplaceFileNowOrSchedule(nsFileSpec& tmpfile, nsFileSpec& target );
|
||||
|
||||
|
||||
extern "C" void PerformScheduledTasks(void *data);
|
||||
|
||||
|
||||
#endif
|
||||
135
mozilla/xpinstall/src/gdiff.h
Normal file
135
mozilla/xpinstall/src/gdiff.h
Normal file
@@ -0,0 +1,135 @@
|
||||
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
/*--------------------------------------------------------------
|
||||
* GDIFF.H
|
||||
*
|
||||
* Constants used in processing the GDIFF format
|
||||
*--------------------------------------------------------------*/
|
||||
|
||||
|
||||
#include "prio.h"
|
||||
#include "nsFileSpec.h"
|
||||
|
||||
#define GDIFF_MAGIC "\xD1\xFF\xD1\xFF"
|
||||
#define GDIFF_MAGIC_LEN 4
|
||||
#define GDIFF_VER 5
|
||||
#define GDIFF_EOF "\0"
|
||||
|
||||
#define GDIFF_VER_POS 4
|
||||
#define GDIFF_CS_POS 5
|
||||
#define GDIFF_CSLEN_POS 6
|
||||
|
||||
#define GDIFF_HEADERSIZE 7
|
||||
#define GDIFF_APPDATALEN 4
|
||||
|
||||
#define GDIFF_CS_NONE 0
|
||||
#define GDIFF_CS_MD5 1
|
||||
#define GDIFF_CS_SHA 2
|
||||
#define GDIFF_CS_CRC32 32
|
||||
|
||||
#define CRC32_LEN 4
|
||||
|
||||
/*--------------------------------------
|
||||
* GDIFF opcodes
|
||||
*------------------------------------*/
|
||||
#define ENDDIFF 0
|
||||
#define ADD8MAX 246
|
||||
#define ADD16 247
|
||||
#define ADD32 248
|
||||
#define COPY16BYTE 249
|
||||
#define COPY16SHORT 250
|
||||
#define COPY16LONG 251
|
||||
#define COPY32BYTE 252
|
||||
#define COPY32SHORT 253
|
||||
#define COPY32LONG 254
|
||||
#define COPY64 255
|
||||
|
||||
/* instruction sizes */
|
||||
#define ADD16SIZE 2
|
||||
#define ADD32SIZE 4
|
||||
#define COPY16BYTESIZE 3
|
||||
#define COPY16SHORTSIZE 4
|
||||
#define COPY16LONGSIZE 6
|
||||
#define COPY32BYTESIZE 5
|
||||
#define COPY32SHORTSIZE 6
|
||||
#define COPY32LONGSIZE 8
|
||||
#define COPY64SIZE 12
|
||||
|
||||
|
||||
/*--------------------------------------
|
||||
* error codes
|
||||
*------------------------------------*/
|
||||
#define GDIFF_OK 0
|
||||
#define GDIFF_ERR_UNKNOWN -1
|
||||
#define GDIFF_ERR_ARGS -2
|
||||
#define GDIFF_ERR_ACCESS -3
|
||||
#define GDIFF_ERR_MEM -4
|
||||
#define GDIFF_ERR_HEADER -5
|
||||
#define GDIFF_ERR_BADDIFF -6
|
||||
#define GDIFF_ERR_OPCODE -7
|
||||
#define GDIFF_ERR_OLDFILE -8
|
||||
#define GDIFF_ERR_CHKSUMTYPE -9
|
||||
#define GDIFF_ERR_CHECKSUM -10
|
||||
#define GDIFF_ERR_CHECKSUM_TARGET -11
|
||||
#define GDIFF_ERR_CHECKSUM_RESULT -12
|
||||
|
||||
|
||||
/*--------------------------------------
|
||||
* types
|
||||
*------------------------------------*/
|
||||
#ifndef AIX
|
||||
#ifdef OSF1
|
||||
#include <sys/types.h>
|
||||
#else
|
||||
typedef unsigned char uchar;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
typedef struct _diffdata {
|
||||
PRFileDesc* fSrc;
|
||||
PRFileDesc* fOut;
|
||||
PRFileDesc* fDiff;
|
||||
uint8 checksumType;
|
||||
uint8 checksumLength;
|
||||
uchar* oldChecksum;
|
||||
uchar* newChecksum;
|
||||
PRBool bMacAppleSingle;
|
||||
PRBool bWin32BoundImage;
|
||||
uchar* databuf;
|
||||
uint32 bufsize;
|
||||
} DIFFDATA;
|
||||
|
||||
typedef DIFFDATA* pDIFFDATA;
|
||||
|
||||
|
||||
/*--------------------------------------
|
||||
* miscellaneous
|
||||
*------------------------------------*/
|
||||
|
||||
#define APPFLAG_W32BOUND "autoinstall:Win32PE"
|
||||
#define APPFLAG_APPLESINGLE "autoinstall:AppleSingle"
|
||||
|
||||
#ifndef TRUE
|
||||
#define TRUE 1
|
||||
#endif
|
||||
|
||||
#ifndef FALSE
|
||||
#define FALSE 0
|
||||
#endif
|
||||
|
||||
|
||||
111
mozilla/xpinstall/src/makefile.win
Normal file
111
mozilla/xpinstall/src/makefile.win
Normal file
@@ -0,0 +1,111 @@
|
||||
#!nmake
|
||||
#
|
||||
# The contents of this file are subject to the Netscape Public License
|
||||
# Version 1.0 (the "License"); you may not use this file except in
|
||||
# compliance with the License. You may obtain a copy of the License at
|
||||
# http://www.mozilla.org/NPL/
|
||||
#
|
||||
# Software distributed under the License is distributed on an "AS IS" basis,
|
||||
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
# for the specific language governing rights and limitations under the
|
||||
# License.
|
||||
#
|
||||
# The Original Code is Mozilla Communicator client code,
|
||||
# released March 31, 1998.
|
||||
#
|
||||
# The Initial Developer of the Original Code is Netscape Communications
|
||||
# Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
# Reserved.
|
||||
#
|
||||
# Contributors:
|
||||
# Daniel Veditz <dveditz@netscape.com>
|
||||
# Douglas Turner <dougt@netscape.com>
|
||||
|
||||
|
||||
DEPTH=..\..
|
||||
IGNORE_MANIFEST=1
|
||||
|
||||
MAKE_OBJ_TYPE = DLL
|
||||
MODULE=xpinstall
|
||||
|
||||
DLL=.\$(OBJDIR)\$(MODULE).dll
|
||||
|
||||
DEFINES=-D_IMPL_NS_DOM -DWIN32_LEAN_AND_MEAN
|
||||
|
||||
LCFLAGS = \
|
||||
$(LCFLAGS) \
|
||||
$(DEFINES) \
|
||||
$(NULL)
|
||||
|
||||
LINCS= \
|
||||
-I$(PUBLIC)\xpinstall \
|
||||
-I$(PUBLIC)\jar \
|
||||
-I$(PUBLIC)\libreg \
|
||||
-I$(PUBLIC)\netlib \
|
||||
-I$(PUBLIC)\xpcom \
|
||||
-I$(PUBLIC)\pref \
|
||||
-I$(PUBLIC)\rdf \
|
||||
-I$(PUBLIC)\js \
|
||||
-I$(PUBLIC)\dom \
|
||||
-I$(PUBLIC)\raptor \
|
||||
-I$(PUBLIC)\nspr2 \
|
||||
-I$(PUBLIC)\zlib \
|
||||
-I$(PUBLIC)\xpfe\components \
|
||||
$(NULL)
|
||||
|
||||
LLIBS = \
|
||||
$(DIST)\lib\jar50.lib \
|
||||
$(DIST)\lib\libreg32.lib \
|
||||
$(DIST)\lib\netlib.lib \
|
||||
$(DIST)\lib\xpcom.lib \
|
||||
$(DIST)\lib\js3250.lib \
|
||||
$(DIST)\lib\jsdombase_s.lib \
|
||||
$(DIST)\lib\jsdomevents_s.lib \
|
||||
$(DIST)\lib\zlib.lib \
|
||||
$(DIST)\lib\plc3.lib \
|
||||
$(LIBNSPR) \
|
||||
$(NULL)
|
||||
|
||||
|
||||
OBJS = \
|
||||
.\$(OBJDIR)\nsInstall.obj \
|
||||
.\$(OBJDIR)\nsInstallTrigger.obj \
|
||||
.\$(OBJDIR)\nsInstallVersion.obj \
|
||||
.\$(OBJDIR)\nsInstallFolder.obj \
|
||||
.\$(OBJDIR)\nsJSInstall.obj \
|
||||
.\$(OBJDIR)\nsJSInstallTriggerGlobal.obj \
|
||||
.\$(OBJDIR)\nsJSInstallVersion.obj \
|
||||
.\$(OBJDIR)\nsSoftwareUpdate.obj \
|
||||
.\$(OBJDIR)\nsSoftwareUpdateRun.obj \
|
||||
.\$(OBJDIR)\nsSoftwareUpdateStream.obj \
|
||||
.\$(OBJDIR)\nsInstallFile.obj \
|
||||
.\$(OBJDIR)\nsInstallDelete.obj \
|
||||
.\$(OBJDIR)\nsInstallExecute.obj \
|
||||
.\$(OBJDIR)\nsInstallPatch.obj \
|
||||
.\$(OBJDIR)\nsInstallUninstall.obj \
|
||||
.\$(OBJDIR)\nsInstallResources.obj \
|
||||
.\$(OBJDIR)\nsTopProgressNotifier.obj \
|
||||
.\$(OBJDIR)\nsLoggingProgressNotifier.obj\
|
||||
.\$(OBJDIR)\ScheduledTasks.obj \
|
||||
.\$(OBJDIR)\nsWinReg.obj \
|
||||
.\$(OBJDIR)\nsJSWinReg.obj \
|
||||
.\$(OBJDIR)\nsWinRegItem.obj \
|
||||
.\$(OBJDIR)\nsWinRegValue.obj \
|
||||
.\$(OBJDIR)\nsWinProfile.obj \
|
||||
.\$(OBJDIR)\nsJSWinProfile.obj \
|
||||
.\$(OBJDIR)\nsWinProfileItem.obj \
|
||||
.\$(OBJDIR)\nsInstallProgressDialog.obj \
|
||||
.\$(OBJDIR)\nsInstallFileOpItem.obj \
|
||||
$(NULL)
|
||||
|
||||
include <$(DEPTH)\config\rules.mak>
|
||||
|
||||
install:: $(DLL)
|
||||
$(MAKE_INSTALL) .\$(OBJDIR)\$(MODULE).lib $(DIST)\lib
|
||||
$(MAKE_INSTALL) .\$(OBJDIR)\$(MODULE).dll $(DIST)\bin\components
|
||||
|
||||
clobber::
|
||||
rm -f $(DIST)\lib\$(MODULE).lib
|
||||
rm -f $(DIST)\bin\components\$(MODULE).dll
|
||||
|
||||
1692
mozilla/xpinstall/src/nsInstall.cpp
Normal file
1692
mozilla/xpinstall/src/nsInstall.cpp
Normal file
File diff suppressed because it is too large
Load Diff
265
mozilla/xpinstall/src/nsInstall.h
Normal file
265
mozilla/xpinstall/src/nsInstall.h
Normal file
@@ -0,0 +1,265 @@
|
||||
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "License"); you may not use this file except in
|
||||
* compliance with the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is Mozilla Communicator client code,
|
||||
* released March 31, 1998.
|
||||
*
|
||||
* The Initial Developer of the Original Code is Netscape Communications
|
||||
* Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*
|
||||
* Contributors:
|
||||
* Daniel Veditz <dveditz@netscape.com>
|
||||
* Douglas Turner <dougt@netscape.com>
|
||||
*/
|
||||
|
||||
|
||||
#ifndef __NS_INSTALL_H__
|
||||
#define __NS_INSTALL_H__
|
||||
|
||||
#include "nscore.h"
|
||||
#include "nsISupports.h"
|
||||
|
||||
#include "jsapi.h"
|
||||
|
||||
#include "plevent.h"
|
||||
|
||||
#include "nsString.h"
|
||||
#include "nsFileSpec.h"
|
||||
#include "nsVector.h"
|
||||
#include "nsHashtable.h"
|
||||
|
||||
#include "nsSoftwareUpdate.h"
|
||||
|
||||
#include "nsInstallObject.h"
|
||||
#include "nsInstallVersion.h"
|
||||
|
||||
#include "nsIXPInstallProgress.h"
|
||||
|
||||
|
||||
class nsInstallInfo
|
||||
{
|
||||
public:
|
||||
|
||||
nsInstallInfo(const nsString& fromURL, const nsString& localFile, long flags);
|
||||
|
||||
nsInstallInfo(nsVector* fromURL, nsVector* localFiles, long flags);
|
||||
|
||||
virtual ~nsInstallInfo();
|
||||
|
||||
nsString& GetFromURL(PRUint32 index = 0);
|
||||
|
||||
nsString& GetLocalFile(PRUint32 index = 0);
|
||||
|
||||
void GetArguments(nsString& args, PRUint32 index = 0);
|
||||
|
||||
long GetFlags();
|
||||
|
||||
PRBool IsMultipleTrigger();
|
||||
|
||||
static void DeleteVector(nsVector* vector);
|
||||
|
||||
private:
|
||||
|
||||
|
||||
PRBool mMultipleTrigger;
|
||||
nsresult mError;
|
||||
|
||||
long mFlags;
|
||||
nsVector *mFromURLs;
|
||||
nsVector *mLocalFiles;
|
||||
};
|
||||
|
||||
|
||||
|
||||
class nsInstall
|
||||
{
|
||||
friend class nsWinReg;
|
||||
friend class nsWinProfile;
|
||||
|
||||
public:
|
||||
|
||||
enum
|
||||
{
|
||||
BAD_PACKAGE_NAME = -200,
|
||||
UNEXPECTED_ERROR = -201,
|
||||
ACCESS_DENIED = -202,
|
||||
TOO_MANY_CERTIFICATES = -203,
|
||||
NO_INSTALLER_CERTIFICATE = -204,
|
||||
NO_CERTIFICATE = -205,
|
||||
NO_MATCHING_CERTIFICATE = -206,
|
||||
UNKNOWN_JAR_FILE = -207,
|
||||
INVALID_ARGUMENTS = -208,
|
||||
ILLEGAL_RELATIVE_PATH = -209,
|
||||
USER_CANCELLED = -210,
|
||||
INSTALL_NOT_STARTED = -211,
|
||||
SILENT_MODE_DENIED = -212,
|
||||
NO_SUCH_COMPONENT = -213,
|
||||
FILE_DOES_NOT_EXIST = -214,
|
||||
FILE_READ_ONLY = -215,
|
||||
FILE_IS_DIRECTORY = -216,
|
||||
NETWORK_FILE_IS_IN_USE = -217,
|
||||
APPLE_SINGLE_ERR = -218,
|
||||
INVALID_PATH_ERR = -219,
|
||||
PATCH_BAD_DIFF = -220,
|
||||
PATCH_BAD_CHECKSUM_TARGET = -221,
|
||||
PATCH_BAD_CHECKSUM_RESULT = -222,
|
||||
UNINSTALL_FAILED = -223,
|
||||
GESTALT_UNKNOWN_ERR = -5550,
|
||||
GESTALT_INVALID_ARGUMENT = -5551,
|
||||
|
||||
SUCCESS = 0,
|
||||
REBOOT_NEEDED = 999,
|
||||
|
||||
LIMITED_INSTALL = 0,
|
||||
FULL_INSTALL = 1,
|
||||
NO_STATUS_DLG = 2,
|
||||
NO_FINALIZE_DLG = 4,
|
||||
|
||||
INSTALL_FILE_UNEXPECTED_MSG_ID = 0,
|
||||
DETAILS_REPLACE_FILE_MSG_ID = 1,
|
||||
DETAILS_INSTALL_FILE_MSG_ID = 2
|
||||
};
|
||||
|
||||
|
||||
nsInstall();
|
||||
virtual ~nsInstall();
|
||||
|
||||
PRInt32 SetScriptObject(void* aScriptObject);
|
||||
|
||||
PRInt32 SaveWinRegPrototype(void* aScriptObject);
|
||||
PRInt32 SaveWinProfilePrototype(void* aScriptObject);
|
||||
|
||||
JSObject* RetrieveWinRegPrototype(void);
|
||||
JSObject* RetrieveWinProfilePrototype(void);
|
||||
|
||||
PRInt32 GetUserPackageName(nsString& aUserPackageName);
|
||||
PRInt32 GetRegPackageName(nsString& aRegPackageName);
|
||||
|
||||
PRInt32 AbortInstall();
|
||||
|
||||
PRInt32 AddDirectory(const nsString& aRegName, const nsString& aVersion, const nsString& aJarSource, const nsString& aFolder, const nsString& aSubdir, PRBool aForceMode, PRInt32* aReturn);
|
||||
PRInt32 AddDirectory(const nsString& aRegName, const nsString& aVersion, const nsString& aJarSource, const nsString& aFolder, const nsString& aSubdir, PRInt32* aReturn);
|
||||
PRInt32 AddDirectory(const nsString& aRegName, const nsString& aJarSource, const nsString& aFolder, const nsString& aSubdir, PRInt32* aReturn);
|
||||
PRInt32 AddDirectory(const nsString& aJarSource, PRInt32* aReturn);
|
||||
|
||||
PRInt32 AddSubcomponent(const nsString& aRegName, const nsString& aVersion, const nsString& aJarSource, const nsString& aFolder, const nsString& aTargetName, PRBool aForceMode, PRInt32* aReturn);
|
||||
PRInt32 AddSubcomponent(const nsString& aRegName, const nsString& aVersion, const nsString& aJarSource, const nsString& aFolder, const nsString& aTargetName, PRInt32* aReturn);
|
||||
PRInt32 AddSubcomponent(const nsString& aRegName, const nsString& aJarSource, const nsString& aFolder, const nsString& aTargetName, PRInt32* aReturn);
|
||||
PRInt32 AddSubcomponent(const nsString& aJarSource, PRInt32* aReturn);
|
||||
|
||||
PRInt32 DeleteComponent(const nsString& aRegistryName, PRInt32* aReturn);
|
||||
PRInt32 DeleteFile(const nsString& aFolder, const nsString& aRelativeFileName, PRInt32* aReturn);
|
||||
PRInt32 DiskSpaceAvailable(const nsString& aFolder, PRInt32* aReturn);
|
||||
PRInt32 Execute(const nsString& aJarSource, const nsString& aArgs, PRInt32* aReturn);
|
||||
PRInt32 Execute(const nsString& aJarSource, PRInt32* aReturn);
|
||||
PRInt32 FinalizeInstall(PRInt32* aReturn);
|
||||
PRInt32 Gestalt(const nsString& aSelector, PRInt32* aReturn);
|
||||
PRInt32 GetComponentFolder(const nsString& aComponentName, const nsString& aSubdirectory, nsString** aFolder);
|
||||
PRInt32 GetComponentFolder(const nsString& aComponentName, nsString** aFolder);
|
||||
PRInt32 GetFolder(const nsString& aTargetFolder, const nsString& aSubdirectory, nsString** aFolder);
|
||||
PRInt32 GetFolder(const nsString& aTargetFolder, nsString** aFolder);
|
||||
PRInt32 GetLastError(PRInt32* aReturn);
|
||||
PRInt32 GetWinProfile(const nsString& aFolder, const nsString& aFile, JSContext* jscontext, JSClass* WinProfileClass, jsval* aReturn);
|
||||
PRInt32 GetWinRegistry(JSContext* jscontext, JSClass* WinRegClass, jsval* aReturn);
|
||||
PRInt32 Patch(const nsString& aRegName, const nsString& aVersion, const nsString& aJarSource, const nsString& aFolder, const nsString& aTargetName, PRInt32* aReturn);
|
||||
PRInt32 Patch(const nsString& aRegName, const nsString& aJarSource, const nsString& aFolder, const nsString& aTargetName, PRInt32* aReturn);
|
||||
PRInt32 ResetError();
|
||||
PRInt32 SetPackageFolder(const nsString& aFolder);
|
||||
PRInt32 StartInstall(const nsString& aUserPackageName, const nsString& aPackageName, const nsString& aVersion, PRInt32* aReturn);
|
||||
PRInt32 Uninstall(const nsString& aPackageName, PRInt32* aReturn);
|
||||
|
||||
PRInt32 FileOpDirCreate(nsFileSpec& aTarget, PRInt32* aReturn);
|
||||
PRInt32 FileOpDirGetParent(nsFileSpec& aTarget, nsFileSpec* aReturn);
|
||||
PRInt32 FileOpDirRemove(nsFileSpec& aTarget, PRInt32 aFlags, PRInt32* aReturn);
|
||||
PRInt32 FileOpDirRename(nsFileSpec& aSrc, nsFileSpec& aTarget, PRInt32* aReturn);
|
||||
PRInt32 FileOpFileCopy(nsFileSpec& aSrc, nsFileSpec& aTarget, PRInt32* aReturn);
|
||||
PRInt32 FileOpFileDelete(nsFileSpec& aTarget, PRInt32 aFlags, PRInt32* aReturn);
|
||||
PRInt32 FileOpFileExists(nsFileSpec& aTarget, PRBool* aReturn);
|
||||
PRInt32 FileOpFileExecute(nsFileSpec& aTarget, nsString& aParams, PRInt32* aReturn);
|
||||
PRInt32 FileOpFileGetNativeVersion(nsFileSpec& aTarget, nsString* aReturn);
|
||||
PRInt32 FileOpFileGetDiskSpaceAvailable(nsFileSpec& aTarget, PRUint32* aReturn);
|
||||
PRInt32 FileOpFileGetModDate(nsFileSpec& aTarget, nsFileSpec::TimeStamp* aReturn);
|
||||
PRInt32 FileOpFileGetSize(nsFileSpec& aTarget, PRUint32* aReturn);
|
||||
PRInt32 FileOpFileIsDirectory(nsFileSpec& aTarget, PRBool* aReturn);
|
||||
PRInt32 FileOpFileIsFile(nsFileSpec& aTarget, PRBool* aReturn);
|
||||
PRInt32 FileOpFileModDateChanged(nsFileSpec& aTarget, nsFileSpec::TimeStamp& aOldStamp, PRBool* aReturn);
|
||||
PRInt32 FileOpFileMove(nsFileSpec& aSrc, nsFileSpec& aTarget, PRInt32* aReturn);
|
||||
PRInt32 FileOpFileRename(nsFileSpec& aSrc, nsFileSpec& aTarget, PRInt32* aReturn);
|
||||
PRInt32 FileOpFileWinShortcutCreate(nsFileSpec& aTarget, PRInt32 aFlags, PRInt32* aReturn);
|
||||
PRInt32 FileOpFileMacAliasCreate(nsFileSpec& aTarget, PRInt32 aFlags, PRInt32* aReturn);
|
||||
PRInt32 FileOpFileUnixLinkCreate(nsFileSpec& aTarget, PRInt32 aFlags, PRInt32* aReturn);
|
||||
|
||||
PRInt32 ExtractFileFromJar(const nsString& aJarfile, nsFileSpec* aSuggestedName, nsFileSpec** aRealName);
|
||||
void AddPatch(nsHashKey *aKey, nsFileSpec* fileName);
|
||||
void GetPatch(nsHashKey *aKey, nsFileSpec* fileName);
|
||||
|
||||
void GetJarFileLocation(nsString& aFile);
|
||||
void SetJarFileLocation(const nsString& aFile);
|
||||
|
||||
void GetInstallArguments(nsString& args);
|
||||
void SetInstallArguments(const nsString& args);
|
||||
|
||||
|
||||
private:
|
||||
JSObject* mScriptObject;
|
||||
|
||||
JSObject* mWinRegObject;
|
||||
JSObject* mWinProfileObject;
|
||||
|
||||
nsString mJarFileLocation;
|
||||
void* mJarFileData;
|
||||
|
||||
nsString mInstallArguments;
|
||||
|
||||
PRBool mUserCancelled;
|
||||
|
||||
PRBool mUninstallPackage;
|
||||
PRBool mRegisterPackage;
|
||||
|
||||
nsString mRegistryPackageName; /* Name of the package we are installing */
|
||||
nsString mUIName; /* User-readable package name */
|
||||
|
||||
nsInstallVersion* mVersionInfo; /* Component version info */
|
||||
|
||||
nsVector* mInstalledFiles;
|
||||
nsHashtable* mPatchList;
|
||||
|
||||
nsIXPInstallProgress *mNotifier;
|
||||
|
||||
PRInt32 mLastError;
|
||||
|
||||
void ParseFlags(int flags);
|
||||
PRInt32 SanityCheck(void);
|
||||
void GetTime(nsString &aString);
|
||||
|
||||
|
||||
PRInt32 GetQualifiedRegName(const nsString& name, nsString& qualifiedRegName );
|
||||
PRInt32 GetQualifiedPackageName( const nsString& name, nsString& qualifiedName );
|
||||
|
||||
void CurrentUserNode(nsString& userRegNode);
|
||||
PRBool BadRegName(const nsString& regName);
|
||||
PRInt32 SaveError(PRInt32 errcode);
|
||||
|
||||
void CleanUp();
|
||||
|
||||
PRInt32 OpenJARFile(void);
|
||||
void CloseJARFile(void);
|
||||
PRInt32 ExtractDirEntries(const nsString& directory, nsVector *paths);
|
||||
|
||||
PRInt32 ScheduleForInstall(nsInstallObject* ob);
|
||||
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
235
mozilla/xpinstall/src/nsInstallDelete.cpp
Normal file
235
mozilla/xpinstall/src/nsInstallDelete.cpp
Normal file
@@ -0,0 +1,235 @@
|
||||
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "License"); you may not use this file except in
|
||||
* compliance with the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is Mozilla Communicator client code,
|
||||
* released March 31, 1998.
|
||||
*
|
||||
* The Initial Developer of the Original Code is Netscape Communications
|
||||
* Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*
|
||||
* Contributors:
|
||||
* Daniel Veditz <dveditz@netscape.com>
|
||||
* Douglas Turner <dougt@netscape.com>
|
||||
*/
|
||||
|
||||
|
||||
#include "prmem.h"
|
||||
|
||||
#include "nsFileSpec.h"
|
||||
|
||||
#include "VerReg.h"
|
||||
#include "ScheduledTasks.h"
|
||||
#include "nsInstallDelete.h"
|
||||
#include "nsInstallResources.h"
|
||||
|
||||
#include "nsInstall.h"
|
||||
#include "nsIDOMInstallVersion.h"
|
||||
|
||||
nsInstallDelete::nsInstallDelete( nsInstall* inInstall,
|
||||
const nsString& folderSpec,
|
||||
const nsString& inPartialPath,
|
||||
PRInt32 *error)
|
||||
|
||||
: nsInstallObject(inInstall)
|
||||
{
|
||||
if ((folderSpec == "null") || (inInstall == NULL))
|
||||
{
|
||||
*error = nsInstall::INVALID_ARGUMENTS;
|
||||
return;
|
||||
}
|
||||
|
||||
mDeleteStatus = DELETE_FILE;
|
||||
mFinalFile = nsnull;
|
||||
mRegistryName = "";
|
||||
|
||||
|
||||
mFinalFile = new nsFileSpec(folderSpec);
|
||||
*mFinalFile += inPartialPath;
|
||||
|
||||
*error = ProcessInstallDelete();
|
||||
}
|
||||
|
||||
nsInstallDelete::nsInstallDelete( nsInstall* inInstall,
|
||||
const nsString& inComponentName,
|
||||
PRInt32 *error)
|
||||
|
||||
: nsInstallObject(inInstall)
|
||||
{
|
||||
if (inInstall == NULL)
|
||||
{
|
||||
*error = nsInstall::INVALID_ARGUMENTS;
|
||||
return;
|
||||
}
|
||||
|
||||
mDeleteStatus = DELETE_COMPONENT;
|
||||
mFinalFile = nsnull;
|
||||
mRegistryName = inComponentName;
|
||||
|
||||
*error = ProcessInstallDelete();
|
||||
}
|
||||
|
||||
|
||||
nsInstallDelete::~nsInstallDelete()
|
||||
{
|
||||
if (mFinalFile == nsnull)
|
||||
delete mFinalFile;
|
||||
}
|
||||
|
||||
|
||||
PRInt32 nsInstallDelete::Prepare()
|
||||
{
|
||||
// no set-up necessary
|
||||
return nsInstall::SUCCESS;
|
||||
}
|
||||
|
||||
PRInt32 nsInstallDelete::Complete()
|
||||
{
|
||||
PRInt32 err = nsInstall::SUCCESS;
|
||||
|
||||
if (mInstall == NULL)
|
||||
return nsInstall::INVALID_ARGUMENTS;
|
||||
|
||||
if (mDeleteStatus == DELETE_COMPONENT)
|
||||
{
|
||||
char* temp = mRegistryName.ToNewCString();
|
||||
err = VR_Remove(temp);
|
||||
delete [] temp;
|
||||
}
|
||||
|
||||
if ((mDeleteStatus == DELETE_FILE) || (err == REGERR_OK))
|
||||
{
|
||||
err = NativeComplete();
|
||||
}
|
||||
else
|
||||
{
|
||||
err = nsInstall::UNEXPECTED_ERROR;
|
||||
}
|
||||
|
||||
|
||||
return err;
|
||||
}
|
||||
|
||||
void nsInstallDelete::Abort()
|
||||
{
|
||||
}
|
||||
|
||||
char* nsInstallDelete::toString()
|
||||
{
|
||||
char* buffer = new char[1024];
|
||||
|
||||
if (mDeleteStatus == DELETE_COMPONENT)
|
||||
{
|
||||
sprintf( buffer, nsInstallResources::GetDeleteComponentString(), nsAutoCString(mRegistryName));
|
||||
}
|
||||
else
|
||||
{
|
||||
if (mFinalFile)
|
||||
sprintf( buffer, nsInstallResources::GetDeleteFileString(), mFinalFile->GetCString());
|
||||
}
|
||||
|
||||
return buffer;
|
||||
}
|
||||
|
||||
|
||||
PRBool
|
||||
nsInstallDelete::CanUninstall()
|
||||
{
|
||||
return PR_FALSE;
|
||||
}
|
||||
|
||||
PRBool
|
||||
nsInstallDelete::RegisterPackageNode()
|
||||
{
|
||||
return PR_FALSE;
|
||||
}
|
||||
|
||||
|
||||
PRInt32 nsInstallDelete::ProcessInstallDelete()
|
||||
{
|
||||
PRInt32 err;
|
||||
|
||||
char* tempCString = nsnull;
|
||||
|
||||
if (mDeleteStatus == DELETE_COMPONENT)
|
||||
{
|
||||
/* Check if the component is in the registry */
|
||||
tempCString = mRegistryName.ToNewCString();
|
||||
|
||||
err = VR_InRegistry( tempCString );
|
||||
|
||||
if (err != REGERR_OK)
|
||||
{
|
||||
return err;
|
||||
}
|
||||
else
|
||||
{
|
||||
char* tempRegistryString;
|
||||
|
||||
tempRegistryString = (char*)PR_Calloc(MAXREGPATHLEN, sizeof(char));
|
||||
|
||||
err = VR_GetPath( tempCString , MAXREGPATHLEN, tempRegistryString);
|
||||
|
||||
if (err == REGERR_OK)
|
||||
{
|
||||
if (mFinalFile)
|
||||
delete mFinalFile;
|
||||
|
||||
mFinalFile = new nsFileSpec(tempRegistryString);
|
||||
}
|
||||
|
||||
PR_FREEIF(tempRegistryString);
|
||||
}
|
||||
}
|
||||
|
||||
if(tempCString)
|
||||
delete [] tempCString;
|
||||
|
||||
if (mFinalFile->Exists())
|
||||
{
|
||||
if (mFinalFile->IsFile())
|
||||
{
|
||||
err = nsInstall::SUCCESS;
|
||||
}
|
||||
else
|
||||
{
|
||||
err = nsInstall::FILE_IS_DIRECTORY;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
err = nsInstall::FILE_DOES_NOT_EXIST;
|
||||
}
|
||||
|
||||
return err;
|
||||
}
|
||||
|
||||
|
||||
|
||||
PRInt32 nsInstallDelete::NativeComplete()
|
||||
{
|
||||
if (mFinalFile->Exists())
|
||||
{
|
||||
if (mFinalFile->IsFile())
|
||||
{
|
||||
return DeleteFileNowOrSchedule(*mFinalFile);
|
||||
}
|
||||
else
|
||||
{
|
||||
return nsInstall::FILE_IS_DIRECTORY;
|
||||
}
|
||||
}
|
||||
|
||||
return nsInstall::FILE_DOES_NOT_EXIST;
|
||||
}
|
||||
|
||||
78
mozilla/xpinstall/src/nsInstallDelete.h
Normal file
78
mozilla/xpinstall/src/nsInstallDelete.h
Normal file
@@ -0,0 +1,78 @@
|
||||
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "License"); you may not use this file except in
|
||||
* compliance with the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is Mozilla Communicator client code,
|
||||
* released March 31, 1998.
|
||||
*
|
||||
* The Initial Developer of the Original Code is Netscape Communications
|
||||
* Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*
|
||||
* Contributors:
|
||||
* Daniel Veditz <dveditz@netscape.com>
|
||||
* Douglas Turner <dougt@netscape.com>
|
||||
*/
|
||||
|
||||
|
||||
#ifndef nsInstallDelete_h__
|
||||
#define nsInstallDelete_h__
|
||||
|
||||
#include "prtypes.h"
|
||||
#include "nsString.h"
|
||||
|
||||
#include "nsInstallObject.h"
|
||||
|
||||
#include "nsInstall.h"
|
||||
|
||||
#define DELETE_COMPONENT 1
|
||||
#define DELETE_FILE 2
|
||||
|
||||
class nsInstallDelete : public nsInstallObject
|
||||
{
|
||||
public:
|
||||
|
||||
nsInstallDelete( nsInstall* inInstall,
|
||||
const nsString& folderSpec,
|
||||
const nsString& inPartialPath,
|
||||
PRInt32 *error);
|
||||
|
||||
nsInstallDelete( nsInstall* inInstall,
|
||||
const nsString& ,
|
||||
PRInt32 *error);
|
||||
|
||||
virtual ~nsInstallDelete();
|
||||
|
||||
PRInt32 Prepare();
|
||||
PRInt32 Complete();
|
||||
void Abort();
|
||||
char* toString();
|
||||
|
||||
PRBool CanUninstall();
|
||||
PRBool RegisterPackageNode();
|
||||
|
||||
|
||||
private:
|
||||
|
||||
/* Private Fields */
|
||||
|
||||
nsFileSpec* mFinalFile;
|
||||
|
||||
nsString mRegistryName;
|
||||
PRInt32 mDeleteStatus;
|
||||
|
||||
PRInt32 ProcessInstallDelete();
|
||||
PRInt32 NativeComplete();
|
||||
|
||||
};
|
||||
|
||||
#endif /* nsInstallDelete_h__ */
|
||||
136
mozilla/xpinstall/src/nsInstallExecute.cpp
Normal file
136
mozilla/xpinstall/src/nsInstallExecute.cpp
Normal file
@@ -0,0 +1,136 @@
|
||||
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "License"); you may not use this file except in
|
||||
* compliance with the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is Mozilla Communicator client code,
|
||||
* released March 31, 1998.
|
||||
*
|
||||
* The Initial Developer of the Original Code is Netscape Communications
|
||||
* Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*
|
||||
* Contributors:
|
||||
* Daniel Veditz <dveditz@netscape.com>
|
||||
* Douglas Turner <dougt@netscape.com>
|
||||
*/
|
||||
|
||||
|
||||
|
||||
#include "prmem.h"
|
||||
|
||||
#include "nsFileSpec.h"
|
||||
|
||||
#include "VerReg.h"
|
||||
#include "nsInstallExecute.h"
|
||||
#include "nsInstallResources.h"
|
||||
#include "ScheduledTasks.h"
|
||||
|
||||
#include "nsInstall.h"
|
||||
#include "nsIDOMInstallVersion.h"
|
||||
|
||||
nsInstallExecute:: nsInstallExecute( nsInstall* inInstall,
|
||||
const nsString& inJarLocation,
|
||||
const nsString& inArgs,
|
||||
PRInt32 *error)
|
||||
|
||||
: nsInstallObject(inInstall)
|
||||
{
|
||||
if ((inInstall == nsnull) || (inJarLocation == "null"))
|
||||
{
|
||||
*error = nsInstall::INVALID_ARGUMENTS;
|
||||
return;
|
||||
}
|
||||
|
||||
mJarLocation = inJarLocation;
|
||||
mArgs = inArgs;
|
||||
mExecutableFile = nsnull;
|
||||
|
||||
}
|
||||
|
||||
|
||||
nsInstallExecute::~nsInstallExecute()
|
||||
{
|
||||
if (mExecutableFile)
|
||||
delete mExecutableFile;
|
||||
}
|
||||
|
||||
|
||||
|
||||
PRInt32 nsInstallExecute::Prepare()
|
||||
{
|
||||
if (mInstall == NULL || mJarLocation == "null")
|
||||
return nsInstall::INVALID_ARGUMENTS;
|
||||
|
||||
return mInstall->ExtractFileFromJar(mJarLocation, nsnull, &mExecutableFile);
|
||||
}
|
||||
|
||||
PRInt32 nsInstallExecute::Complete()
|
||||
{
|
||||
if (mExecutableFile == nsnull)
|
||||
return nsInstall::INVALID_ARGUMENTS;
|
||||
|
||||
nsFileSpec app( *mExecutableFile);
|
||||
|
||||
if (!app.Exists())
|
||||
{
|
||||
return nsInstall::INVALID_ARGUMENTS;
|
||||
}
|
||||
|
||||
PRInt32 result = app.Execute( mArgs );
|
||||
|
||||
DeleteFileNowOrSchedule( app );
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
void nsInstallExecute::Abort()
|
||||
{
|
||||
/* Get the names */
|
||||
if (mExecutableFile == nsnull)
|
||||
return;
|
||||
|
||||
DeleteFileNowOrSchedule(*mExecutableFile);
|
||||
}
|
||||
|
||||
char* nsInstallExecute::toString()
|
||||
{
|
||||
char* buffer = new char[1024];
|
||||
|
||||
// if the FileSpec is NULL, just us the in jar file name.
|
||||
|
||||
if (mExecutableFile == nsnull)
|
||||
{
|
||||
char *tempString = mJarLocation.ToNewCString();
|
||||
sprintf( buffer, nsInstallResources::GetExecuteString(), tempString);
|
||||
delete [] tempString;
|
||||
}
|
||||
else
|
||||
{
|
||||
sprintf( buffer, nsInstallResources::GetExecuteString(), mExecutableFile->GetCString());
|
||||
}
|
||||
return buffer;
|
||||
|
||||
}
|
||||
|
||||
|
||||
PRBool
|
||||
nsInstallExecute::CanUninstall()
|
||||
{
|
||||
return PR_FALSE;
|
||||
}
|
||||
|
||||
PRBool
|
||||
nsInstallExecute::RegisterPackageNode()
|
||||
{
|
||||
return PR_FALSE;
|
||||
}
|
||||
|
||||
73
mozilla/xpinstall/src/nsInstallExecute.h
Normal file
73
mozilla/xpinstall/src/nsInstallExecute.h
Normal file
@@ -0,0 +1,73 @@
|
||||
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "License"); you may not use this file except in
|
||||
* compliance with the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is Mozilla Communicator client code,
|
||||
* released March 31, 1998.
|
||||
*
|
||||
* The Initial Developer of the Original Code is Netscape Communications
|
||||
* Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*
|
||||
* Contributors:
|
||||
* Daniel Veditz <dveditz@netscape.com>
|
||||
* Douglas Turner <dougt@netscape.com>
|
||||
*/
|
||||
|
||||
|
||||
#ifndef nsInstallExecute_h__
|
||||
#define nsInstallExecute_h__
|
||||
|
||||
#include "prtypes.h"
|
||||
#include "nsString.h"
|
||||
|
||||
#include "nsInstallObject.h"
|
||||
|
||||
#include "nsInstall.h"
|
||||
#include "nsIDOMInstallVersion.h"
|
||||
|
||||
|
||||
class nsInstallExecute : public nsInstallObject
|
||||
{
|
||||
public:
|
||||
|
||||
nsInstallExecute( nsInstall* inInstall,
|
||||
const nsString& inJarLocation,
|
||||
const nsString& inArgs,
|
||||
PRInt32 *error);
|
||||
|
||||
|
||||
virtual ~nsInstallExecute();
|
||||
|
||||
PRInt32 Prepare();
|
||||
PRInt32 Complete();
|
||||
void Abort();
|
||||
char* toString();
|
||||
|
||||
PRBool CanUninstall();
|
||||
PRBool RegisterPackageNode();
|
||||
|
||||
|
||||
private:
|
||||
|
||||
nsString mJarLocation; // Location in the JAR
|
||||
nsString mArgs; // command line arguments
|
||||
|
||||
nsFileSpec *mExecutableFile; // temporary file location
|
||||
|
||||
|
||||
PRInt32 NativeComplete(void);
|
||||
void NativeAbort(void);
|
||||
|
||||
};
|
||||
|
||||
#endif /* nsInstallExecute_h__ */
|
||||
366
mozilla/xpinstall/src/nsInstallFile.cpp
Normal file
366
mozilla/xpinstall/src/nsInstallFile.cpp
Normal file
@@ -0,0 +1,366 @@
|
||||
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "License"); you may not use this file except in
|
||||
* compliance with the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is Mozilla Communicator client code,
|
||||
* released March 31, 1998.
|
||||
*
|
||||
* The Initial Developer of the Original Code is Netscape Communications
|
||||
* Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*
|
||||
* Contributors:
|
||||
* Daniel Veditz <dveditz@netscape.com>
|
||||
* Douglas Turner <dougt@netscape.com>
|
||||
*/
|
||||
|
||||
#include "nsInstallFile.h"
|
||||
#include "nsFileSpec.h"
|
||||
#include "VerReg.h"
|
||||
#include "ScheduledTasks.h"
|
||||
#include "nsInstall.h"
|
||||
#include "nsIDOMInstallVersion.h"
|
||||
#include "nsInstallResources.h"
|
||||
|
||||
/* Public Methods */
|
||||
|
||||
/* Constructor
|
||||
inInstall - softUpdate object we belong to
|
||||
inComponentName - full path of the registry component
|
||||
inVInfo - full version info
|
||||
inJarLocation - location inside the JAR file
|
||||
inFinalFileSpec - final location on disk
|
||||
*/
|
||||
|
||||
|
||||
nsInstallFile::nsInstallFile(nsInstall* inInstall,
|
||||
const nsString& inComponentName,
|
||||
const nsString& inVInfo,
|
||||
const nsString& inJarLocation,
|
||||
const nsString& folderSpec,
|
||||
const nsString& inPartialPath,
|
||||
PRBool forceInstall,
|
||||
PRInt32 *error)
|
||||
: nsInstallObject(inInstall)
|
||||
{
|
||||
mVersionRegistryName = nsnull;
|
||||
mJarLocation = nsnull;
|
||||
mExtracedFile = nsnull;
|
||||
mFinalFile = nsnull;
|
||||
mVersionInfo = nsnull;
|
||||
|
||||
mUpgradeFile = PR_FALSE;
|
||||
|
||||
if ((folderSpec == "null") || (inInstall == NULL))
|
||||
{
|
||||
*error = nsInstall::INVALID_ARGUMENTS;
|
||||
return;
|
||||
}
|
||||
|
||||
/* Check for existence of the newer version */
|
||||
|
||||
PRBool versionNewer = PR_FALSE; // Is this a newer version
|
||||
char* qualifiedRegNameString = inComponentName.ToNewCString();
|
||||
|
||||
if ( (forceInstall == PR_FALSE ) && (inVInfo != "") && ( VR_ValidateComponent( qualifiedRegNameString ) == 0 ) )
|
||||
{
|
||||
nsInstallVersion *newVersion = new nsInstallVersion();
|
||||
newVersion->Init(inVInfo);
|
||||
|
||||
VERSION versionStruct;
|
||||
|
||||
VR_GetVersion( qualifiedRegNameString, &versionStruct );
|
||||
|
||||
nsInstallVersion* oldVersion = new nsInstallVersion();
|
||||
|
||||
oldVersion->Init(versionStruct.major,
|
||||
versionStruct.minor,
|
||||
versionStruct.release,
|
||||
versionStruct.build);
|
||||
|
||||
PRInt32 areTheyEqual;
|
||||
newVersion->CompareTo(oldVersion, &areTheyEqual);
|
||||
|
||||
delete oldVersion;
|
||||
delete newVersion;
|
||||
|
||||
if (areTheyEqual == nsIDOMInstallVersion::MAJOR_DIFF_MINUS ||
|
||||
areTheyEqual == nsIDOMInstallVersion::MINOR_DIFF_MINUS ||
|
||||
areTheyEqual == nsIDOMInstallVersion::REL_DIFF_MINUS ||
|
||||
areTheyEqual == nsIDOMInstallVersion::BLD_DIFF_MINUS )
|
||||
{
|
||||
// the file to be installed is OLDER than what is on disk. Return error
|
||||
delete qualifiedRegNameString;
|
||||
*error = areTheyEqual;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
delete qualifiedRegNameString;
|
||||
|
||||
|
||||
mFinalFile = new nsFileSpec(folderSpec);
|
||||
*mFinalFile += inPartialPath;
|
||||
|
||||
mReplaceFile = mFinalFile->Exists();
|
||||
|
||||
if (mReplaceFile == PR_FALSE)
|
||||
{
|
||||
nsFileSpec parent;
|
||||
mFinalFile->GetParent(parent);
|
||||
nsFileSpec makeDirs(parent.GetCString(), PR_TRUE);
|
||||
}
|
||||
|
||||
mForceInstall = forceInstall;
|
||||
|
||||
mVersionRegistryName = new nsString(inComponentName);
|
||||
mJarLocation = new nsString(inJarLocation);
|
||||
mVersionInfo = new nsString(inVInfo);
|
||||
|
||||
nsString regPackageName;
|
||||
mInstall->GetRegPackageName(regPackageName);
|
||||
|
||||
// determine Child status
|
||||
if ( regPackageName == "" )
|
||||
{
|
||||
// in the "current communicator package" absolute pathnames (start
|
||||
// with slash) indicate shared files -- all others are children
|
||||
mChildFile = ( mVersionRegistryName->CharAt(0) != '/' );
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
// there is no "starts with" api in nsString. LAME!
|
||||
nsString startsWith;
|
||||
mVersionRegistryName->Left(startsWith, regPackageName.Length());
|
||||
|
||||
if (startsWith.Equals(regPackageName))
|
||||
{
|
||||
mChildFile = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
mChildFile = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
nsInstallFile::~nsInstallFile()
|
||||
{
|
||||
if (mVersionRegistryName)
|
||||
delete mVersionRegistryName;
|
||||
|
||||
if (mJarLocation)
|
||||
delete mJarLocation;
|
||||
|
||||
if (mExtracedFile)
|
||||
delete mExtracedFile;
|
||||
|
||||
if (mFinalFile)
|
||||
delete mFinalFile;
|
||||
|
||||
if (mVersionInfo)
|
||||
delete mVersionInfo;
|
||||
}
|
||||
|
||||
/* Prepare
|
||||
* Extracts file out of the JAR archive
|
||||
*/
|
||||
PRInt32 nsInstallFile::Prepare()
|
||||
{
|
||||
if (mInstall == nsnull || mFinalFile == nsnull || mJarLocation == nsnull )
|
||||
return nsInstall::INVALID_ARGUMENTS;
|
||||
|
||||
return mInstall->ExtractFileFromJar(*mJarLocation, mFinalFile, &mExtracedFile);
|
||||
}
|
||||
|
||||
/* Complete
|
||||
* Completes the install:
|
||||
* - move the downloaded file to the final location
|
||||
* - updates the registry
|
||||
*/
|
||||
PRInt32 nsInstallFile::Complete()
|
||||
{
|
||||
PRInt32 err;
|
||||
|
||||
if (mInstall == nsnull || mVersionRegistryName == nsnull || mFinalFile == nsnull )
|
||||
{
|
||||
return nsInstall::INVALID_ARGUMENTS;
|
||||
}
|
||||
|
||||
err = CompleteFileMove();
|
||||
|
||||
if ( 0 == err || nsInstall::REBOOT_NEEDED == err )
|
||||
{
|
||||
err = RegisterInVersionRegistry();
|
||||
}
|
||||
|
||||
return err;
|
||||
|
||||
}
|
||||
|
||||
void nsInstallFile::Abort()
|
||||
{
|
||||
if (mExtracedFile != nsnull)
|
||||
mExtracedFile->Delete(PR_FALSE);
|
||||
}
|
||||
|
||||
char* nsInstallFile::toString()
|
||||
{
|
||||
char* buffer = new char[1024];
|
||||
|
||||
if (mFinalFile == nsnull)
|
||||
{
|
||||
sprintf( buffer, nsInstallResources::GetInstallFileString(), nsnull);
|
||||
}
|
||||
else if (mReplaceFile)
|
||||
{
|
||||
// we are replacing this file.
|
||||
|
||||
sprintf( buffer, nsInstallResources::GetReplaceFileString(), mFinalFile->GetCString());
|
||||
}
|
||||
else
|
||||
{
|
||||
sprintf( buffer, nsInstallResources::GetInstallFileString(), mFinalFile->GetCString());
|
||||
}
|
||||
|
||||
return buffer;
|
||||
}
|
||||
|
||||
|
||||
PRInt32 nsInstallFile::CompleteFileMove()
|
||||
{
|
||||
int result = 0;
|
||||
|
||||
if (mExtracedFile == nsnull)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
if ( *mExtracedFile == *mFinalFile )
|
||||
{
|
||||
/* No need to rename, they are the same */
|
||||
result = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
result = ReplaceFileNowOrSchedule(*mExtracedFile, *mFinalFile );
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
PRInt32
|
||||
nsInstallFile::RegisterInVersionRegistry()
|
||||
{
|
||||
int refCount;
|
||||
nsString regPackageName;
|
||||
mInstall->GetRegPackageName(regPackageName);
|
||||
|
||||
|
||||
// Register file and log for Uninstall
|
||||
|
||||
if (!mChildFile)
|
||||
{
|
||||
int found;
|
||||
if (regPackageName != "")
|
||||
{
|
||||
found = VR_UninstallFileExistsInList( (char*)(const char*)nsAutoCString(regPackageName) ,
|
||||
(char*)(const char*)nsAutoCString(*mVersionRegistryName));
|
||||
}
|
||||
else
|
||||
{
|
||||
found = VR_UninstallFileExistsInList( "", (char*)(const char*)nsAutoCString(*mVersionRegistryName) );
|
||||
}
|
||||
|
||||
if (found != REGERR_OK)
|
||||
mUpgradeFile = PR_FALSE;
|
||||
else
|
||||
mUpgradeFile = PR_TRUE;
|
||||
}
|
||||
else if (REGERR_OK == VR_InRegistry( (char*)(const char*)nsAutoCString(*mVersionRegistryName)))
|
||||
{
|
||||
mUpgradeFile = PR_TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
mUpgradeFile = PR_FALSE;
|
||||
}
|
||||
|
||||
if ( REGERR_OK != VR_GetRefCount( (char*)(const char*)nsAutoCString(*mVersionRegistryName), &refCount ))
|
||||
{
|
||||
refCount = 0;
|
||||
}
|
||||
|
||||
VR_Install( (char*)(const char*)nsAutoCString(*mVersionRegistryName),
|
||||
(char*)(const char*)mFinalFile->GetNativePathCString(), // DO NOT CHANGE THIS.
|
||||
(char*)(const char*)nsAutoCString(*mVersionInfo),
|
||||
PR_FALSE );
|
||||
|
||||
if (mUpgradeFile)
|
||||
{
|
||||
if (refCount == 0)
|
||||
VR_SetRefCount( (char*)(const char*)nsAutoCString(*mVersionRegistryName), 1 );
|
||||
else
|
||||
VR_SetRefCount( (char*)(const char*)nsAutoCString(*mVersionRegistryName), refCount ); //FIX?? what should the ref count be/
|
||||
}
|
||||
else
|
||||
{
|
||||
if (refCount != 0)
|
||||
{
|
||||
VR_SetRefCount( (char*)(const char*)nsAutoCString(*mVersionRegistryName), refCount + 1 );
|
||||
}
|
||||
else
|
||||
{
|
||||
if (mReplaceFile)
|
||||
VR_SetRefCount( (char*)(const char*)nsAutoCString(*mVersionRegistryName), 2 );
|
||||
else
|
||||
VR_SetRefCount( (char*)(const char*)nsAutoCString(*mVersionRegistryName), 1 );
|
||||
}
|
||||
}
|
||||
|
||||
if ( !mChildFile && !mUpgradeFile )
|
||||
{
|
||||
if (regPackageName != "")
|
||||
{
|
||||
VR_UninstallAddFileToList( (char*)(const char*)nsAutoCString(regPackageName),
|
||||
(char*)(const char*)nsAutoCString(*mVersionRegistryName));
|
||||
}
|
||||
else
|
||||
{
|
||||
VR_UninstallAddFileToList( "", (char*)(const char*)nsAutoCString(*mVersionRegistryName) );
|
||||
}
|
||||
}
|
||||
|
||||
return nsInstall::SUCCESS;
|
||||
}
|
||||
|
||||
/* CanUninstall
|
||||
* InstallFile() installs files which can be uninstalled,
|
||||
* hence this function returns true.
|
||||
*/
|
||||
PRBool
|
||||
nsInstallFile::CanUninstall()
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/* RegisterPackageNode
|
||||
* InstallFile() installs files which need to be registered,
|
||||
* hence this function returns true.
|
||||
*/
|
||||
PRBool
|
||||
nsInstallFile::RegisterPackageNode()
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
93
mozilla/xpinstall/src/nsInstallFile.h
Normal file
93
mozilla/xpinstall/src/nsInstallFile.h
Normal file
@@ -0,0 +1,93 @@
|
||||
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "License"); you may not use this file except in
|
||||
* compliance with the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is Mozilla Communicator client code,
|
||||
* released March 31, 1998.
|
||||
*
|
||||
* The Initial Developer of the Original Code is Netscape Communications
|
||||
* Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*
|
||||
* Contributors:
|
||||
* Daniel Veditz <dveditz@netscape.com>
|
||||
* Douglas Turner <dougt@netscape.com>
|
||||
*/
|
||||
|
||||
|
||||
#ifndef nsInstallFile_h__
|
||||
#define nsInstallFile_h__
|
||||
|
||||
#include "prtypes.h"
|
||||
#include "nsString.h"
|
||||
|
||||
#include "nsInstallObject.h"
|
||||
|
||||
#include "nsInstall.h"
|
||||
#include "nsInstallVersion.h"
|
||||
|
||||
class nsInstallFile : public nsInstallObject
|
||||
{
|
||||
public:
|
||||
|
||||
/*************************************************************
|
||||
* Public Methods
|
||||
*
|
||||
* Constructor
|
||||
* inSoftUpdate - softUpdate object we belong to
|
||||
* inComponentName - full path of the registry component
|
||||
* inVInfo - full version info
|
||||
* inJarLocation - location inside the JAR file
|
||||
* inFinalFileSpec - final location on disk
|
||||
*************************************************************/
|
||||
nsInstallFile( nsInstall* inInstall,
|
||||
const nsString& inVRName,
|
||||
const nsString& inVInfo,
|
||||
const nsString& inJarLocation,
|
||||
const nsString& folderSpec,
|
||||
const nsString& inPartialPath,
|
||||
PRBool forceInstall,
|
||||
PRInt32 *error);
|
||||
|
||||
virtual ~nsInstallFile();
|
||||
|
||||
PRInt32 Prepare();
|
||||
PRInt32 Complete();
|
||||
void Abort();
|
||||
char* toString();
|
||||
|
||||
PRBool CanUninstall();
|
||||
PRBool RegisterPackageNode();
|
||||
|
||||
|
||||
private:
|
||||
|
||||
/* Private Fields */
|
||||
nsString* mVersionInfo; /* Version info for this file*/
|
||||
|
||||
nsString* mJarLocation; /* Location in the JAR */
|
||||
nsFileSpec* mExtracedFile; /* temporary file location */
|
||||
nsFileSpec* mFinalFile; /* final file destination */
|
||||
|
||||
nsString* mVersionRegistryName; /* full version path */
|
||||
|
||||
PRBool mForceInstall; /* whether install is forced */
|
||||
PRBool mReplaceFile; /* whether file exists */
|
||||
PRBool mChildFile; /* whether file is a child */
|
||||
PRBool mUpgradeFile; /* whether file is an upgrade */
|
||||
|
||||
|
||||
PRInt32 CompleteFileMove();
|
||||
PRInt32 RegisterInVersionRegistry();
|
||||
};
|
||||
|
||||
#endif /* nsInstallFile_h__ */
|
||||
38
mozilla/xpinstall/src/nsInstallFileOpEnums.h
Normal file
38
mozilla/xpinstall/src/nsInstallFileOpEnums.h
Normal file
@@ -0,0 +1,38 @@
|
||||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
|
||||
#ifndef nsInstallFileOpEnums_h__
|
||||
#define nsInstallFileOpEnums_h__
|
||||
|
||||
typedef enum nsInstallFileOpEnums {
|
||||
NS_FOP_DIR_CREATE = 0,
|
||||
NS_FOP_DIR_REMOVE = 1,
|
||||
NS_FOP_DIR_RENAME = 2,
|
||||
NS_FOP_FILE_COPY = 3,
|
||||
NS_FOP_FILE_DELETE = 4,
|
||||
NS_FOP_FILE_EXECUTE = 5,
|
||||
NS_FOP_FILE_MOVE = 6,
|
||||
NS_FOP_FILE_RENAME = 7,
|
||||
NS_FOP_WIN_SHORTCUT_CREATE = 8,
|
||||
NS_FOP_MAC_ALIAS_CREATE = 9,
|
||||
NS_FOP_UNIX_LINK_CREATE = 10,
|
||||
NS_FOP_FILE_SET_STAT = 11
|
||||
|
||||
} nsInstallFileOpEnums;
|
||||
|
||||
#endif /* nsInstallFileOpEnums_h__ */
|
||||
316
mozilla/xpinstall/src/nsInstallFileOpItem.cpp
Normal file
316
mozilla/xpinstall/src/nsInstallFileOpItem.cpp
Normal file
@@ -0,0 +1,316 @@
|
||||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
|
||||
#include "nspr.h"
|
||||
#include "nsInstall.h"
|
||||
#include "nsInstallFileOpEnums.h"
|
||||
#include "nsInstallFileOpItem.h"
|
||||
|
||||
/* Public Methods */
|
||||
|
||||
nsInstallFileOpItem::nsInstallFileOpItem(nsInstall* aInstallObj,
|
||||
PRInt32 aCommand,
|
||||
nsFileSpec& aTarget,
|
||||
PRInt32 aFlags,
|
||||
PRInt32* aReturn)
|
||||
:nsInstallObject(aInstallObj)
|
||||
{
|
||||
mIObj = aInstallObj;
|
||||
mCommand = aCommand;
|
||||
mFlags = aFlags;
|
||||
mSrc = nsnull;
|
||||
mParams = nsnull;
|
||||
mTarget = new nsFileSpec(aTarget);
|
||||
|
||||
*aReturn = NS_OK;
|
||||
}
|
||||
|
||||
nsInstallFileOpItem::nsInstallFileOpItem(nsInstall* aInstallObj,
|
||||
PRInt32 aCommand,
|
||||
nsFileSpec& aSrc,
|
||||
nsFileSpec& aTarget,
|
||||
PRInt32* aReturn)
|
||||
:nsInstallObject(aInstallObj)
|
||||
{
|
||||
mIObj = aInstallObj;
|
||||
mCommand = aCommand;
|
||||
mFlags = 0;
|
||||
mSrc = new nsFileSpec(aSrc);
|
||||
mParams = nsnull;
|
||||
mTarget = new nsFileSpec(aTarget);
|
||||
|
||||
*aReturn = NS_OK;
|
||||
}
|
||||
|
||||
nsInstallFileOpItem::nsInstallFileOpItem(nsInstall* aInstallObj,
|
||||
PRInt32 aCommand,
|
||||
nsFileSpec& aTarget,
|
||||
PRInt32* aReturn)
|
||||
:nsInstallObject(aInstallObj)
|
||||
{
|
||||
mIObj = aInstallObj;
|
||||
mCommand = aCommand;
|
||||
mFlags = 0;
|
||||
mSrc = nsnull;
|
||||
mParams = nsnull;
|
||||
mTarget = new nsFileSpec(aTarget);
|
||||
|
||||
*aReturn = NS_OK;
|
||||
}
|
||||
|
||||
nsInstallFileOpItem::nsInstallFileOpItem(nsInstall* aInstallObj,
|
||||
PRInt32 aCommand,
|
||||
nsFileSpec& aTarget,
|
||||
nsString& aParams,
|
||||
PRInt32* aReturn)
|
||||
:nsInstallObject(aInstallObj)
|
||||
{
|
||||
mIObj = aInstallObj;
|
||||
mCommand = aCommand;
|
||||
mFlags = 0;
|
||||
mSrc = nsnull;
|
||||
mParams = new nsString(aParams);
|
||||
mTarget = new nsFileSpec(aTarget);
|
||||
|
||||
*aReturn = NS_OK;
|
||||
}
|
||||
|
||||
nsInstallFileOpItem::~nsInstallFileOpItem()
|
||||
{
|
||||
if(mSrc)
|
||||
delete mSrc;
|
||||
if(mTarget)
|
||||
delete mTarget;
|
||||
}
|
||||
|
||||
PRInt32 nsInstallFileOpItem::Complete()
|
||||
{
|
||||
PRInt32 aReturn = NS_OK;
|
||||
|
||||
switch(mCommand)
|
||||
{
|
||||
case NS_FOP_DIR_CREATE:
|
||||
NativeFileOpDirCreate(mTarget);
|
||||
break;
|
||||
case NS_FOP_DIR_REMOVE:
|
||||
NativeFileOpDirRemove(mTarget, mFlags);
|
||||
break;
|
||||
case NS_FOP_DIR_RENAME:
|
||||
NativeFileOpDirRename(mSrc, mTarget);
|
||||
break;
|
||||
case NS_FOP_FILE_COPY:
|
||||
NativeFileOpFileCopy(mSrc, mTarget);
|
||||
break;
|
||||
case NS_FOP_FILE_DELETE:
|
||||
NativeFileOpFileDelete(mTarget, mFlags);
|
||||
break;
|
||||
case NS_FOP_FILE_EXECUTE:
|
||||
NativeFileOpFileExecute(mTarget, mParams);
|
||||
break;
|
||||
case NS_FOP_FILE_MOVE:
|
||||
NativeFileOpFileMove(mSrc, mTarget);
|
||||
break;
|
||||
case NS_FOP_FILE_RENAME:
|
||||
NativeFileOpFileRename(mSrc, mTarget);
|
||||
break;
|
||||
case NS_FOP_WIN_SHORTCUT_CREATE:
|
||||
NativeFileOpWinShortcutCreate();
|
||||
break;
|
||||
case NS_FOP_MAC_ALIAS_CREATE:
|
||||
NativeFileOpMacAliasCreate();
|
||||
break;
|
||||
case NS_FOP_UNIX_LINK_CREATE:
|
||||
NativeFileOpUnixLinkCreate();
|
||||
break;
|
||||
}
|
||||
return aReturn;
|
||||
}
|
||||
|
||||
float nsInstallFileOpItem::GetInstallOrder()
|
||||
{
|
||||
return 3;
|
||||
}
|
||||
|
||||
char* nsInstallFileOpItem::toString()
|
||||
{
|
||||
nsString result;
|
||||
char* resultCString;
|
||||
|
||||
switch(mCommand)
|
||||
{
|
||||
case NS_FOP_FILE_COPY:
|
||||
result = "Copy file: ";
|
||||
result.Append(mSrc->GetNativePathCString());
|
||||
result.Append(" to ");
|
||||
result.Append(mTarget->GetNativePathCString());
|
||||
resultCString = result.ToNewCString();
|
||||
break;
|
||||
case NS_FOP_FILE_DELETE:
|
||||
result = "Delete file: ";
|
||||
result.Append(mTarget->GetNativePathCString());
|
||||
resultCString = result.ToNewCString();
|
||||
break;
|
||||
case NS_FOP_FILE_MOVE:
|
||||
result = "Move file: ";
|
||||
result.Append(mSrc->GetNativePathCString());
|
||||
result.Append(" to ");
|
||||
result.Append(mTarget->GetNativePathCString());
|
||||
resultCString = result.ToNewCString();
|
||||
break;
|
||||
case NS_FOP_FILE_RENAME:
|
||||
result = "Rename file: ";
|
||||
result.Append(mTarget->GetNativePathCString());
|
||||
resultCString = result.ToNewCString();
|
||||
break;
|
||||
case NS_FOP_DIR_CREATE:
|
||||
result = "Create Folder: ";
|
||||
result.Append(mTarget->GetNativePathCString());
|
||||
resultCString = result.ToNewCString();
|
||||
break;
|
||||
case NS_FOP_DIR_REMOVE:
|
||||
result = "Remove Folder: ";
|
||||
result.Append(mTarget->GetNativePathCString());
|
||||
resultCString = result.ToNewCString();
|
||||
break;
|
||||
case NS_FOP_WIN_SHORTCUT_CREATE:
|
||||
break;
|
||||
case NS_FOP_MAC_ALIAS_CREATE:
|
||||
break;
|
||||
case NS_FOP_UNIX_LINK_CREATE:
|
||||
break;
|
||||
case NS_FOP_FILE_SET_STAT:
|
||||
result = "Set file stat: ";
|
||||
result.Append(mTarget->GetNativePathCString());
|
||||
resultCString = result.ToNewCString();
|
||||
break;
|
||||
default:
|
||||
result = "Unkown file operation command!";
|
||||
resultCString = result.ToNewCString();
|
||||
break;
|
||||
}
|
||||
return resultCString;
|
||||
}
|
||||
|
||||
PRInt32 nsInstallFileOpItem::Prepare()
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void nsInstallFileOpItem::Abort()
|
||||
{
|
||||
}
|
||||
|
||||
/* Private Methods */
|
||||
|
||||
/* CanUninstall
|
||||
* InstallFileOpItem() does not install any files which can be uninstalled,
|
||||
* hence this function returns false.
|
||||
*/
|
||||
PRBool
|
||||
nsInstallFileOpItem::CanUninstall()
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* RegisterPackageNode
|
||||
* InstallFileOpItem() does notinstall files which need to be registered,
|
||||
* hence this function returns false.
|
||||
*/
|
||||
PRBool
|
||||
nsInstallFileOpItem::RegisterPackageNode()
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
//
|
||||
// File operation functions begin here
|
||||
//
|
||||
PRInt32
|
||||
nsInstallFileOpItem::NativeFileOpDirCreate(nsFileSpec* aTarget)
|
||||
{
|
||||
aTarget->CreateDirectory();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
PRInt32
|
||||
nsInstallFileOpItem::NativeFileOpDirRemove(nsFileSpec* aTarget, PRInt32 aFlags)
|
||||
{
|
||||
aTarget->Delete(aFlags);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
PRInt32
|
||||
nsInstallFileOpItem::NativeFileOpDirRename(nsFileSpec* aSrc, nsFileSpec* aTarget)
|
||||
{
|
||||
aSrc->Rename(*aTarget);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
PRInt32
|
||||
nsInstallFileOpItem::NativeFileOpFileCopy(nsFileSpec* aSrc, nsFileSpec* aTarget)
|
||||
{
|
||||
aSrc->Copy(*aTarget);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
PRInt32
|
||||
nsInstallFileOpItem::NativeFileOpFileDelete(nsFileSpec* aTarget, PRInt32 aFlags)
|
||||
{
|
||||
aTarget->Delete(aFlags);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
PRInt32
|
||||
nsInstallFileOpItem::NativeFileOpFileExecute(nsFileSpec* aTarget, nsString* aParams)
|
||||
{
|
||||
aTarget->Execute(*aParams);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
PRInt32
|
||||
nsInstallFileOpItem::NativeFileOpFileMove(nsFileSpec* aSrc, nsFileSpec* aTarget)
|
||||
{
|
||||
aSrc->Move(*aTarget);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
PRInt32
|
||||
nsInstallFileOpItem::NativeFileOpFileRename(nsFileSpec* aSrc, nsFileSpec* aTarget)
|
||||
{
|
||||
aSrc->Rename(*aTarget);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
PRInt32
|
||||
nsInstallFileOpItem::NativeFileOpWinShortcutCreate()
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
PRInt32
|
||||
nsInstallFileOpItem::NativeFileOpMacAliasCreate()
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
PRInt32
|
||||
nsInstallFileOpItem::NativeFileOpUnixLinkCreate()
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
111
mozilla/xpinstall/src/nsInstallFileOpItem.h
Normal file
111
mozilla/xpinstall/src/nsInstallFileOpItem.h
Normal file
@@ -0,0 +1,111 @@
|
||||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
|
||||
#ifndef nsInstallFileOpItem_h__
|
||||
#define nsInstallFileOpItem_h__
|
||||
|
||||
#include "prtypes.h"
|
||||
|
||||
#include "nsFileSpec.h"
|
||||
#include "nsSoftwareUpdate.h"
|
||||
#include "nsInstallObject.h"
|
||||
#include "nsInstall.h"
|
||||
|
||||
class nsInstallFileOpItem : public nsInstallObject
|
||||
{
|
||||
public:
|
||||
/* Public Fields */
|
||||
|
||||
/* Public Methods */
|
||||
// used by:
|
||||
// FileOpFileDelete()
|
||||
nsInstallFileOpItem(nsInstall* installObj,
|
||||
PRInt32 aCommand,
|
||||
nsFileSpec& aTarget,
|
||||
PRInt32 aFlags,
|
||||
PRInt32* aReturn);
|
||||
|
||||
// used by:
|
||||
// FileOpDirRemove()
|
||||
// FileOpDirRename()
|
||||
// FileOpFileCopy()
|
||||
// FileOpFileMove()
|
||||
// FileOpFileRename()
|
||||
nsInstallFileOpItem(nsInstall* installObj,
|
||||
PRInt32 aCommand,
|
||||
nsFileSpec& aSrc,
|
||||
nsFileSpec& aTarget,
|
||||
PRInt32* aReturn);
|
||||
|
||||
// used by:
|
||||
// FileOpDirCreate()
|
||||
nsInstallFileOpItem(nsInstall* aInstallObj,
|
||||
PRInt32 aCommand,
|
||||
nsFileSpec& aTarget,
|
||||
PRInt32* aReturn);
|
||||
|
||||
// used by:
|
||||
// FileOpFileExecute()
|
||||
nsInstallFileOpItem(nsInstall* aInstallObj,
|
||||
PRInt32 aCommand,
|
||||
nsFileSpec& aTarget,
|
||||
nsString& aParams,
|
||||
PRInt32* aReturn);
|
||||
|
||||
~nsInstallFileOpItem();
|
||||
|
||||
PRInt32 Prepare(void);
|
||||
PRInt32 Complete();
|
||||
char* toString();
|
||||
void Abort();
|
||||
float GetInstallOrder();
|
||||
|
||||
/* should these be protected? */
|
||||
PRBool CanUninstall();
|
||||
PRBool RegisterPackageNode();
|
||||
|
||||
private:
|
||||
|
||||
/* Private Fields */
|
||||
|
||||
nsInstall* mIObj; // initiating Install object
|
||||
nsFileSpec* mSrc;
|
||||
nsFileSpec* mTarget;
|
||||
nsString* mParams;
|
||||
long mFStat;
|
||||
PRInt32 mFlags;
|
||||
PRInt32 mCommand;
|
||||
|
||||
/* Private Methods */
|
||||
|
||||
PRInt32 NativeFileOpDirCreate(nsFileSpec* aTarget);
|
||||
PRInt32 NativeFileOpDirRemove(nsFileSpec* aTarget, PRInt32 aFlags);
|
||||
PRInt32 NativeFileOpDirRename(nsFileSpec* aSrc, nsFileSpec* aTarget);
|
||||
PRInt32 NativeFileOpFileCopy(nsFileSpec* aSrc, nsFileSpec* aTarget);
|
||||
PRInt32 NativeFileOpFileDelete(nsFileSpec* aTarget, PRInt32 aFlags);
|
||||
PRInt32 NativeFileOpFileExecute(nsFileSpec* aTarget, nsString* aParams);
|
||||
PRInt32 NativeFileOpFileMove(nsFileSpec* aSrc, nsFileSpec* aTarget);
|
||||
PRInt32 NativeFileOpFileRename(nsFileSpec* aSrc, nsFileSpec* aTarget);
|
||||
PRInt32 NativeFileOpWinShortcutCreate();
|
||||
PRInt32 NativeFileOpMacAliasCreate();
|
||||
PRInt32 NativeFileOpUnixLinkCreate();
|
||||
|
||||
};
|
||||
|
||||
#endif /* nsInstallFileOpItem_h__ */
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user