Kaydet (Commit) 436ebc95 authored tarafından Kurt Zenker's avatar Kurt Zenker

INTEGRATION: CWS native100 (1.40.42); FILE MERGED

2007/08/23 15:10:35 is 1.40.42.1: #i80937,i80938# introducing module order, package restructuring
üst c29c5644
...@@ -4,9 +4,9 @@ ...@@ -4,9 +4,9 @@
# #
# $RCSfile: msiglobal.pm,v $ # $RCSfile: msiglobal.pm,v $
# #
# $Revision: 1.40 $ # $Revision: 1.41 $
# #
# last change: $Author: ihi $ $Date: 2007-07-12 11:17:01 $ # last change: $Author: kz $ $Date: 2007-09-06 09:55:56 $
# #
# The Contents of this file are made available subject to # The Contents of this file are made available subject to
# the terms of GNU Lesser General Public License Version 2.1. # the terms of GNU Lesser General Public License Version 2.1.
...@@ -140,6 +140,26 @@ sub make_relative_ddf_path ...@@ -140,6 +140,26 @@ sub make_relative_ddf_path
return $sourcepath; return $sourcepath;
} }
##########################################################################
# Returning the order of the sequences in the files array.
##########################################################################
sub get_sequenceorder
{
my ($filesref) = @_;
my %order = ();
for ( my $i = 0; $i <= $#{$filesref}; $i++ )
{
my $onefile = ${$filesref}[$i];
if ( ! $onefile->{'assignedsequencenumber'} ) { installer::exiter::exit_program("ERROR: Sequence number assigned to $onefile->{'gid'}!", "get_sequenceorder"); }
$order{$onefile->{'assignedsequencenumber'}} = $i;
}
return \%order;
}
########################################################################## ##########################################################################
# Generation the list, in which the source of the files is connected # Generation the list, in which the source of the files is connected
# with the cabinet destination file. Because more than one file needs # with the cabinet destination file. Because more than one file needs
...@@ -158,7 +178,93 @@ sub generate_cab_file_list ...@@ -158,7 +178,93 @@ sub generate_cab_file_list
if ( $^O =~ /cygwin/i ) { installer::worker::generate_cygwin_pathes($filesref); } if ( $^O =~ /cygwin/i ) { installer::worker::generate_cygwin_pathes($filesref); }
if (( $installer::globals::cab_file_per_component ) || ( $installer::globals::fix_number_of_cab_files )) if ( $installer::globals::use_packages_for_cabs )
{
my $sequenceorder = get_sequenceorder($filesref);
my $counter = 1;
my $currentcabfile = "";
while ( exists($sequenceorder->{$counter}) )
{
# Files with increasing sequencerorder are included in one cab file
my $onefile = ${$filesref}[$sequenceorder->{$counter}];
my $cabinetfile = $onefile->{'assignedcabinetfile'};
my $sourcepath = $onefile->{'sourcepath'};
if ( $^O =~ /cygwin/i ) { $sourcepath = $onefile->{'cyg_sourcepath'}; }
my $uniquename = $onefile->{'uniquename'};
my $styles = "";
my $doinclude = 1;
if ( $onefile->{'Styles'} ) { $styles = $onefile->{'Styles'}; };
if ( $styles =~ /\bDONT_PACK\b/ ) { $doinclude = 0; }
# to avoid lines with more than 256 characters, it can be useful to use relative pathes
if ( $allvariables->{'RELATIVE_PATHES_IN_DDF'} ) { $sourcepath = make_relative_ddf_path($sourcepath); }
# all files with the same cabinetfile have increasing sequencenumbers
my @ddffile = ();
write_ddf_file_header(\@ddffile, $cabinetfile, $installdir);
my $ddfline = "\"" . $sourcepath . "\"" . " " . $uniquename . "\n";
if ( $doinclude ) { push(@ddffile, $ddfline); }
$counter++; # increasing the counter
my $nextfile = "";
my $nextcabinetfile = "";
if ( exists($sequenceorder->{$counter}) ) { $nextfile = ${$filesref}[$sequenceorder->{$counter}]; }
if ( $nextfile->{'assignedcabinetfile'} ) { $nextcabinetfile = $nextfile->{'assignedcabinetfile'}; }
while ( $nextcabinetfile eq $cabinetfile )
{
$sourcepath = $nextfile->{'sourcepath'};
if ( $^O =~ /cygwin/i ) { $sourcepath = $nextfile->{'cyg_sourcepath'}; }
# to avoid lines with more than 256 characters, it can be useful to use relative pathes
if ( $allvariables->{'RELATIVE_PATHES_IN_DDF'} ) { $sourcepath = make_relative_ddf_path($sourcepath); }
$uniquename = $nextfile->{'uniquename'};
my $localdoinclude = 1;
my $nextfilestyles = "";
if ( $nextfile->{'Styles'} ) { $nextfilestyles = $nextfile->{'Styles'}; }
if ( $nextfilestyles =~ /\bDONT_PACK\b/ ) { $localdoinclude = 0; }
$ddfline = "\"" . $sourcepath . "\"" . " " . $uniquename . "\n";
if ( $localdoinclude ) { push(@ddffile, $ddfline); }
$counter++; # increasing the counter!
$nextcabinetfile = "_lastfile_";
if ( exists($sequenceorder->{$counter}) )
{
$nextfile = ${$filesref}[$sequenceorder->{$counter}];
$nextcabinetfile = $nextfile->{'assignedcabinetfile'};
}
}
# creating the DDF file
my $ddffilename = $cabinetfile;
$ddffilename =~ s/.cab/.ddf/;
$ddfdir =~ s/\Q$installer::globals::separator\E\s*$//;
$ddffilename = $ddfdir . $installer::globals::separator . $ddffilename;
installer::files::save_file($ddffilename ,\@ddffile);
my $infoline = "Created ddf file: $ddffilename\n";
push(@installer::globals::logfileinfo, $infoline);
# lines in ddf files must not be longer than 256 characters
check_ddf_file(\@ddffile, $ddffilename);
# Writing the makecab system call
my $oneline = "makecab.exe /V3 /F " . $ddffilename . " 2\>\&1 |" . "\n";
push(@cabfilelist, $oneline);
# collecting all ddf files
push(@installer::globals::allddffiles, $ddffilename);
}
}
elsif (( $installer::globals::cab_file_per_component ) || ( $installer::globals::fix_number_of_cab_files ))
{ {
for ( my $i = 0; $i <= $#{$filesref}; $i++ ) for ( my $i = 0; $i <= $#{$filesref}; $i++ )
{ {
...@@ -334,8 +440,6 @@ sub get_file_sequence ...@@ -334,8 +440,6 @@ sub get_file_sequence
sub save_packorder sub save_packorder
{ {
my ( $filesref ) = @_;
installer::logger::include_header_into_logfile("Saving pack order"); installer::logger::include_header_into_logfile("Saving pack order");
installer::logger::include_timestamp_into_logfile("Performance Info: saving pack order start"); installer::logger::include_timestamp_into_logfile("Performance Info: saving pack order start");
...@@ -773,7 +877,7 @@ sub create_transforms ...@@ -773,7 +877,7 @@ sub create_transforms
{ {
$infoline = "File $transformfile exists.\n"; $infoline = "File $transformfile exists.\n";
push( @installer::globals::logfileinfo, $infoline); push( @installer::globals::logfileinfo, $infoline);
my $filesize = (stat($transformfile))[7]; my $filesize = ( -s $transformfile );
$infoline = "Size of $transformfile: $filesize\n"; $infoline = "Size of $transformfile: $filesize\n";
push( @installer::globals::logfileinfo, $infoline); push( @installer::globals::logfileinfo, $infoline);
...@@ -1445,6 +1549,7 @@ sub execute_packaging ...@@ -1445,6 +1549,7 @@ sub execute_packaging
$ENV{'TMP'} = $installer::globals::temppath; # setting TMP to the new unique directory! $ENV{'TMP'} = $installer::globals::temppath; # setting TMP to the new unique directory!
my $maxmakecabcalls = 3; my $maxmakecabcalls = 3;
my $allmakecabcalls = $#{$localpackjobref} + 1;
for ( my $i = 0; $i <= $#{$localpackjobref}; $i++ ) for ( my $i = 0; $i <= $#{$localpackjobref}; $i++ )
{ {
...@@ -1452,7 +1557,7 @@ sub execute_packaging ...@@ -1452,7 +1557,7 @@ sub execute_packaging
my $callscounter = $i + 1; my $callscounter = $i + 1;
installer::logger::print_message( "... makecab.exe ($callscounter) ... \n" ); installer::logger::print_message( "... makecab.exe ($callscounter/$allmakecabcalls) ... \n" );
# my $returnvalue = system($systemcall); # my $returnvalue = system($systemcall);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment