Kaydet (Commit) 650c2220 authored tarafından Vladimir Glazounov's avatar Vladimir Glazounov

INTEGRATION: CWS pj69 (1.35.108); FILE MERGED

2006/12/18 13:17:49 hjs 1.35.108.1: #i72646# avoid calling cygpath too often
üst 285c7876
...@@ -4,9 +4,9 @@ ...@@ -4,9 +4,9 @@
# #
# $RCSfile: msiglobal.pm,v $ # $RCSfile: msiglobal.pm,v $
# #
# $Revision: 1.35 $ # $Revision: 1.36 $
# #
# last change: $Author: kz $ $Date: 2006-10-05 09:19:02 $ # last change: $Author: vg $ $Date: 2007-01-09 11:19:12 $
# #
# 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.
...@@ -36,6 +36,7 @@ ...@@ -36,6 +36,7 @@
package installer::windows::msiglobal; package installer::windows::msiglobal;
use Cwd; use Cwd;
use File::Temp qw(tmpnam);
use installer::converter; use installer::converter;
use installer::exiter; use installer::exiter;
use installer::files; use installer::files;
...@@ -129,8 +130,7 @@ sub make_relative_ddf_path ...@@ -129,8 +130,7 @@ sub make_relative_ddf_path
if ( $^O =~ /cygwin/i ) if ( $^O =~ /cygwin/i )
{ {
$windowstemppath =~ s/\\/\\\\/g; $windowstemppath = $installer::globals::cyg_temppath;
chomp( $windowstemppath = qx{cygpath -w "$windowstemppath"} );
} }
$sourcepath =~ s/\Q$windowstemppath\E//; $sourcepath =~ s/\Q$windowstemppath\E//;
...@@ -157,11 +157,33 @@ sub generate_cab_file_list ...@@ -157,11 +157,33 @@ sub generate_cab_file_list
if (( $installer::globals::cab_file_per_component ) || ( $installer::globals::fix_number_of_cab_files )) if (( $installer::globals::cab_file_per_component ) || ( $installer::globals::fix_number_of_cab_files ))
{ {
if ( $^O =~ /cygwin/i )
{
my ($tmpfilehandle, $tmpfilename) = tmpnam();
my $onefile;
open SOURCEPATHLIST, ">$tmpfilename" or die "oops...\n";
for ( my $i = 0; $i <= $#{$filesref}; $i++ )
{
$onefile = ${$filesref}[$i];
print SOURCEPATHLIST "$onefile->{'sourcepath'}\n";
}
close SOURCEPATHLIST;
my @cyg_sourcepathlist = qx{cygpath -w -f "$tmpfilename"};
chomp @cyg_sourcepathlist;
unlink "$tmpfilename" or die "oops\n";
for ( my $i = 0; $i <= $#{$filesref}; $i++ )
{
my $onefile = ${$filesref}[$i];
$onefile->{'cyg_sourcepath'} = $cyg_sourcepathlist[$i];
}
}
for ( my $i = 0; $i <= $#{$filesref}; $i++ ) for ( my $i = 0; $i <= $#{$filesref}; $i++ )
{ {
my $onefile = ${$filesref}[$i]; my $onefile = ${$filesref}[$i];
my $cabinetfile = $onefile->{'cabinet'}; my $cabinetfile = $onefile->{'cabinet'};
my $sourcepath = $onefile->{'sourcepath'}; my $sourcepath = $onefile->{'sourcepath'};
if ( $^O =~ /cygwin/i ) { $sourcepath = $onefile->{'cyg_sourcepath'}; }
my $uniquename = $onefile->{'uniquename'}; my $uniquename = $onefile->{'uniquename'};
my $styles = ""; my $styles = "";
...@@ -169,7 +191,6 @@ sub generate_cab_file_list ...@@ -169,7 +191,6 @@ sub generate_cab_file_list
if ( $onefile->{'Styles'} ) { $styles = $onefile->{'Styles'}; }; if ( $onefile->{'Styles'} ) { $styles = $onefile->{'Styles'}; };
if ( $styles =~ /\bDONT_PACK\b/ ) { $doinclude = 0; } if ( $styles =~ /\bDONT_PACK\b/ ) { $doinclude = 0; }
if ( $^O =~ /cygwin/i ) { chomp( $sourcepath = qx{cygpath -w "$sourcepath"} ); }
# to avoid lines with more than 256 characters, it can be useful to use relative pathes # 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); } if ( $allvariables->{'RELATIVE_PATHES_IN_DDF'} ) { $sourcepath = make_relative_ddf_path($sourcepath); }
...@@ -191,7 +212,7 @@ sub generate_cab_file_list ...@@ -191,7 +212,7 @@ sub generate_cab_file_list
while ( $nextcabinetfile eq $cabinetfile ) while ( $nextcabinetfile eq $cabinetfile )
{ {
$sourcepath = $nextfile->{'sourcepath'}; $sourcepath = $nextfile->{'sourcepath'};
if ( $^O =~ /cygwin/i ) { chomp( $sourcepath = qx{cygpath -w "$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 # 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); } if ( $allvariables->{'RELATIVE_PATHES_IN_DDF'} ) { $sourcepath = make_relative_ddf_path($sourcepath); }
$uniquename = $nextfile->{'uniquename'}; $uniquename = $nextfile->{'uniquename'};
...@@ -237,12 +258,32 @@ sub generate_cab_file_list ...@@ -237,12 +258,32 @@ sub generate_cab_file_list
my $cabinetfile = ""; my $cabinetfile = "";
if ( $^O =~ /cygwin/i )
{
my ($tmpfilehandle, $tmpfilename) = tmpnam();
my $onefile;
open SOURCEPATHLIST, ">$tmpfilename" or die "oops...\n";
for ( my $i = 0; $i <= $#{$filesref}; $i++ )
{
$onefile = ${$filesref}[$i];
print SOURCEPATHLIST "$onefile->{'sourcepath'}\n";
}
close SOURCEPATHLIST;
my @cyg_sourcepathlist = qx{cygpath -w -f "$tmpfilename"};
chomp @cyg_sourcepathlist;
unlink "$tmpfilename" or die "oops\n";
for ( my $i = 0; $i <= $#{$filesref}; $i++ )
{
my $onefile = ${$filesref}[$i];
$onefile->{'cyg_sourcepath'} = $cyg_sourcepathlist[$i];
}
}
for ( my $i = 0; $i <= $#{$filesref}; $i++ ) for ( my $i = 0; $i <= $#{$filesref}; $i++ )
{ {
my $onefile = ${$filesref}[$i]; my $onefile = ${$filesref}[$i];
$cabinetfile = $onefile->{'cabinet'}; $cabinetfile = $onefile->{'cabinet'};
my $sourcepath = $onefile->{'sourcepath'}; my $sourcepath = $onefile->{'sourcepath'};
if ( $^O =~ /cygwin/i ) { chomp( $sourcepath = qx{cygpath -w "$sourcepath"} ); } if ( $^O =~ /cygwin/i ) { $sourcepath = $onefile->{'cyg_sourcepath'}; }
my $uniquename = $onefile->{'uniquename'}; my $uniquename = $onefile->{'uniquename'};
# to avoid lines with more than 256 characters, it can be useful to use relative pathes # to avoid lines with more than 256 characters, it can be useful to use relative pathes
......
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