Commits

Anonymous committed f8b255f

INTEGRATION: CWS kendy21 (1.6.8); FILE MERGED
2008/09/03 15:39:07 thb 1.6.8.1: #i93435# Cleansing all paths with cygpath (conditionalized for cygwin builds)

Comments (0)

Files changed (1)

solenv/bin/modules/installer/windows/mergemodule.pm

 #
 # $RCSfile: mergemodule.pm,v $
 #
-# $Revision: 1.7 $
+# $Revision: 1.8 $
 #
 # This file is part of OpenOffice.org.
 #
 		# changing directory
 		my $from = cwd();
 		my $to = $mergemodulehash->{'workdir'};
-		chdir($to);
+ 		if ( $^O =~ /cygwin/i ) {
+			$to = qx(cygpath -u "$to");
+			chomp $to;
+		}
+
+		chdir($to) || die "Could not chdir to \"$to\"\n";
 
 		# Unpack the cab file, so that in can be included into the last office cabinet file.
 		# Not using cabarc.exe from cabsdk for unpacking cabinet files, but "expand.exe" that
 		$infoline = "Unpacking cabinet file: $mergemodulehash->{'cabinetfile'}\n";
 		push( @installer::globals::logfileinfo, $infoline);
 
+		# Avoid the Cygwin expand command
 		my $expandfile = "expand.exe";	# Has to be in the path
+ 		if ( $^O =~ /cygwin/i ) {
+			$expandfile = qx(cygpath -u "$ENV{WINDIR}"/System32/expand.exe);
+			chomp $expandfile;
+		}
+
 		my $cabfilename = "MergeModule.CABinet";
 
 		# exclude cabinet file
 
 		my $systemcall = "";
 		if ( $^O =~ /cygwin/i ) {
-			my $localunpackdir = qx{cygpath -w "$unpackdir"};
-			$localunpackdir =~ s/\\/\\\\/g;
+			my $localunpackdir = qx(cygpath -m "$unpackdir");
+			chomp $localunpackdir;
 			$systemcall = $expandfile . " " . $cabfilename . " -F:\\\* " . $localunpackdir;
 		}
 		else