? installer.diff ? windows/.msiglobal.pm.swp Index: globals.pm =================================================================== RCS file: /cvs/tools/solenv/bin/modules/installer/globals.pm,v retrieving revision 1.61 diff -u -r1.61 globals.pm --- globals.pm 14 Nov 2006 18:06:26 -0000 1.61 +++ globals.pm 16 Dec 2006 14:46:02 -0000 @@ -105,6 +105,7 @@ $msilanguage = ""; # hash reference for msi languages LCID $sofficeiconadded = 0; $temppath = ""; + $cyg_temppath = ""; $temppathdefined = 0; $packageversion = 1; $packagerevision = 1; Index: parameter.pm =================================================================== RCS file: /cvs/tools/solenv/bin/modules/installer/parameter.pm,v retrieving revision 1.36 diff -u -r1.36 parameter.pm --- parameter.pm 14 Aug 2006 09:38:46 -0000 1.36 +++ parameter.pm 16 Dec 2006 14:46:04 -0000 @@ -405,6 +405,12 @@ push(@installer::globals::removedirs, $installer::globals::temppath); $installer::globals::temppath = $installer::globals::temppath . $installer::globals::separator . $installer::globals::compiler . $installer::globals::productextension; installer::systemactions::create_directory($installer::globals::temppath); + if ( $^O =~ /cygwin/i ) + { + $installer::globals::cyg_temppath = $installer::globals::temppath; + $installer::globals::cyg_temppath =~ s/\\/\\\\/g; + chomp( $installer::globals::cyg_temppath = qx{cygpath -w "$installer::globals::cyg_temppath"} ); + } $installer::globals::temppathdefined = 1; } else Index: windows/msiglobal.pm =================================================================== RCS file: /cvs/tools/solenv/bin/modules/installer/windows/msiglobal.pm,v retrieving revision 1.35 diff -u -r1.35 msiglobal.pm --- windows/msiglobal.pm 5 Oct 2006 09:19:02 -0000 1.35 +++ windows/msiglobal.pm 16 Dec 2006 14:46:08 -0000 @@ -36,6 +36,7 @@ package installer::windows::msiglobal; use Cwd; +use File::Temp qw(tmpnam); use installer::converter; use installer::exiter; use installer::files; @@ -129,8 +130,7 @@ if ( $^O =~ /cygwin/i ) { - $windowstemppath =~ s/\\/\\\\/g; - chomp( $windowstemppath = qx{cygpath -w "$windowstemppath"} ); + $windowstemppath = $installer::globals::cyg_temppath; } $sourcepath =~ s/\Q$windowstemppath\E//; @@ -157,11 +157,36 @@ 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"; +# print "writing ".$onefile->{'sourcepath'}." to file\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]; +# print "inserting $cyg_sourcepathlist[$i]\n"; + } + } + for ( my $i = 0; $i <= $#{$filesref}; $i++ ) - { + { my $onefile = ${$filesref}[$i]; my $cabinetfile = $onefile->{'cabinet'}; my $sourcepath = $onefile->{'sourcepath'}; + if ( $^O =~ /cygwin/i ) { $sourcepath = $onefile->{'cyg_sourcepath'}; } +# if ( $^O =~ /cygwin/i ) { print "$sourcepath\n"; } my $uniquename = $onefile->{'uniquename'}; my $styles = ""; @@ -169,7 +194,7 @@ if ( $onefile->{'Styles'} ) { $styles = $onefile->{'Styles'}; }; if ( $styles =~ /\bDONT_PACK\b/ ) { $doinclude = 0; } - if ( $^O =~ /cygwin/i ) { chomp( $sourcepath = qx{cygpath -w "$sourcepath"} ); } +# 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 if ( $allvariables->{'RELATIVE_PATHES_IN_DDF'} ) { $sourcepath = make_relative_ddf_path($sourcepath); } @@ -191,7 +216,9 @@ while ( $nextcabinetfile eq $cabinetfile ) { $sourcepath = $nextfile->{'sourcepath'}; - if ( $^O =~ /cygwin/i ) { chomp( $sourcepath = qx{cygpath -w "$sourcepath"} ); } + if ( $^O =~ /cygwin/i ) { $sourcepath = $nextfile->{'cyg_sourcepath'}; } + if ( $^O =~ /cygwin/i ) { print "$sourcepath\n"; } +# 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 if ( $allvariables->{'RELATIVE_PATHES_IN_DDF'} ) { $sourcepath = make_relative_ddf_path($sourcepath); } $uniquename = $nextfile->{'uniquename'}; @@ -237,12 +264,36 @@ 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"; +# print "writing ".$onefile->{'sourcepath'}." to file\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]; +# print "inserting $cyg_sourcepathlist[$i]\n"; + } + } for ( my $i = 0; $i <= $#{$filesref}; $i++ ) { + print "second: - $i\n"; my $onefile = ${$filesref}[$i]; $cabinetfile = $onefile->{'cabinet'}; my $sourcepath = $onefile->{'sourcepath'}; - if ( $^O =~ /cygwin/i ) { chomp( $sourcepath = qx{cygpath -w "$sourcepath"} ); } + if ( $^O =~ /cygwin/i ) { $sourcepath = $onefile->{'cyg_sourcepath'}; } +# if ( $^O =~ /cygwin/i ) { chomp( $sourcepath = qx{cygpath -w "$sourcepath"} ); } my $uniquename = $onefile->{'uniquename'}; # to avoid lines with more than 256 characters, it can be useful to use relative pathes