b=391358 r=mozpreed - use make_incremental_updates.py

This commit is contained in:
ccooper@deadsquid.com 2008-01-04 09:56:38 -08:00
Родитель 0af876b796
Коммит bcb010bd61
3 изменённых файлов: 45 добавлений и 9 удалений

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

@ -113,7 +113,7 @@ sub ProcessCommandLineArgs
Getopt::Long::GetOptions(\%args,
'help|h|?', 'man', 'version', 'app=s', 'config=s', 'verbose',
'dry-run', 'tools-dir=s', 'download-dir=s', 'deliverable-dir=s',
'tools-revision=s', @RUN_MODES)
'tools-revision=s', 'partial-patchlist-file=s', @RUN_MODES)
or return 0;
$this->{'mConfigFilename'} = defined($args{'config'}) ? $args{'config'} :
@ -127,6 +127,7 @@ sub ProcessCommandLineArgs
$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;

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

@ -71,6 +71,7 @@ use strict;
use vars qw($MAR_BIN $MBSDIFF_BIN $MAKE_BIN
$INCREMENTAL_UPDATE_BIN $UNWRAP_FULL_UPDATE_BIN
$FAST_INCREMENTAL_UPDATE_BIN
$TMPDIR_PREFIX
%BOUNCER_PLATFORMS %AUS2_PLATFORMS
$DEFAULT_PARTIAL_MAR_OUTPUT_FILE
@ -81,6 +82,7 @@ $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';
@ -161,6 +163,7 @@ sub ValidateToolsDirectory
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");
}

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

@ -95,6 +95,7 @@ sub main {
PrintUsage(exitCode => 1) if ($config eq undef);
if (not $config->RequestedStep('build-tools') and
not ValidateToolsDirectory(toolsDir => $config->GetToolsDir())) {
my $badDir = $config->GetToolsDir();
@ -467,11 +468,17 @@ sub CreateCompletePatches {
return $i;
} # create_complete_patches
sub CreatePartialPatches {
my %args = @_;
my $config = $args{'config'};
my $useFastPatcher = defined($config->{'mPartialPatchlistFile'});
if ($useFastPatcher) {
print STDERR "fast patcher on!\n";
open(PARTIAL_PATCHLIST_FILE, ">$config->{'mPartialPatchlistFile'}")
or die "open() of $config->{'mPartialPatchlistFile'} failed: $!";
}
my $update = $config->GetCurrentUpdate();
my $total = 0;
@ -532,6 +539,15 @@ sub CreatePartialPatches {
if ( -f $from_path and
-f $to_path and
! -e $partial_pathname ) {
if ($useFastPatcher) {
$partial_pathname =~ m/^(.*)\/[^\/]*$/g;
print PARTIAL_PATCHLIST_FILE
getcwd() . '/' . $from_path . ',' . getcwd() . '/'
. $to_path . ',' . getcwd() . '/' .
$partial_pathname . ',' .
Data::Dumper::Dumper($forcedUpdateList);
} else {
my $start_time = time();
PrintProgress(total => $total, current => $i,
@ -548,7 +564,7 @@ sub CreatePartialPatches {
die 'Partial mar creation failed (see error above?); ' .
'aborting.';
}
print $partial_pathname."\n\n";
# rename partial.mar to the expected result
$partial_pathname =~ m/^(.*)\/[^\/]*$/g;
my $partial_pathname_parent = $1;
@ -562,20 +578,36 @@ sub CreatePartialPatches {
printf("done (" . $total_time . "s)\n");
}
#last if $i > 2;
#$i++;
select(undef, undef, undef, 0.5);
}
#last;
}
#last;
}
}
#printf("%s", Data::Dumper::Dumper($u_config));
chdir($startdir);
if ($useFastPatcher) {
close(PARTIAL_PATCHLIST_FILE);
# -u turns of output buffering so we get real-time updates
my $fastIncrementalUpdateBinary =
catfile($config->GetToolsDir(), 'mozilla',
$MozAUSLib::FAST_INCREMENTAL_UPDATE_BIN);
my $args = ['-u', $fastIncrementalUpdateBinary, '-f',
$config->{'mPartialPatchlistFile'}];
my $rv = RunShellCommand(command => 'python',
args => $args,
output => 1);
if ($rv->{'exitValue'} != 0) {
die "FAILED: make_incremental_updates.py: $rv->{'exitValue'}, " .
"output: $rv->{'output'}\n";
}
}
if (defined($total)) {
printf("\n");
}