Commits

Anonymous committed 437bc28

CWS-TOOLING: integrate CWS native254
2009-07-06 11:53:05 +0200 is r273730 : #159765# setting of unixrights for Windows not required
2009-07-03 14:34:49 +0200 is r273699 : #160182# new ooo transformation wizard

Comments (0)

Files changed (3)

solenv/bin/make_installer.pl

 	installer::scriptitems::get_Source_Directory_For_Files_From_Includepathlist($scpactionsinproductlanguageresolvedarrayref, $includepatharrayref_lang, $dirsinproductlanguageresolvedarrayref, "ScpActions");
 	if ( $installer::globals::globallogging ) { installer::files::save_array_of_hashes($loggingdir . "productscpactions5.log", $scpactionsinproductlanguageresolvedarrayref); }
 
-	# Editing scpactions with flag SCPZIP_REPLACE.
+	# Editing scpactions with flag SCPZIP_REPLACE and PATCH_SO_NAME.
 
 	installer::scpzipfiles::resolving_scpzip_replace_flag($scpactionsinproductlanguageresolvedarrayref, $allvariableshashref, "ScpAction", $languagestringref);
 	if ( $installer::globals::globallogging ) { installer::files::save_array_of_hashes($loggingdir . "productscpactions6.log", $scpactionsinproductlanguageresolvedarrayref); }
 
+	installer::scppatchsoname::resolving_patchsoname_flag($scpactionsinproductlanguageresolvedarrayref, $allvariableshashref, "ScpAction", $languagestringref);
+	if ( $installer::globals::globallogging ) { installer::files::save_array_of_hashes($loggingdir . "productscpactions6a.log", $scpactionsinproductlanguageresolvedarrayref); }
+
 	#########################################################
 	# language dependent links part
 	#########################################################

solenv/bin/modules/installer/scppatchsoname.pm

 }
 
 ########################################################################################
+# The length of the new string must be identical with the length of the old string
+########################################################################################
+
+sub change_length_of_string_with_letter
+{
+	my ($newstringref, $oldstring, $onestring) = @_;
+	
+	while ( length($$newstringref) < length($oldstring) )
+	{
+		$$newstringref = $$newstringref . $onestring;
+	}
+}
+
+########################################################################################
 # Converting a string to a unicode string
 ########################################################################################
 
 
 sub replace_productname_in_file
 {
-	my ($sourcepath, $destpath, $variableshashref, $filedescription) = @_;
+	my ($sourcepath, $destpath, $variableshashref, $onefilehash, $styles) = @_;
 
 	my $onefile = installer::files::read_binary_file($sourcepath);
 
+	# searching for "x" 
+
 	my $onestring = "x" . chr(0);
 	my $replacestring = "";
 	for ( my $i = 1; $i <= 80; $i++ ) { $replacestring .= $onestring; }
 
 	my $productname = $variableshashref->{'PRODUCTNAME'} . " " . $variableshashref->{'PRODUCTVERSION'};
-    if ( $filedescription ne "" ) { $productname = $filedescription; }
+	if ( exists($onefilehash->{'FileDescription'}) ) { $productname = $onefilehash->{'FileDescription'}; }
 	my $unicode_productname = convert_to_unicode($productname);
 
 	change_length_of_string(\$unicode_productname, $replacestring);
 
-	my $found = $onefile =~ s/$replacestring/$unicode_productname/s;
-	
+	my $found1 = $onefile =~ s/$replacestring/$unicode_productname/sg;
+
+	my $found2 = 0;
+
+	if ( $styles =~ /\bPATCH_SO_NAME_Z\b/ )
+	{
+		# searching for "z" 
+
+		$onestring = "z" . chr(0);
+		$replacestring = "";
+		for ( my $i = 1; $i <= 80; $i++ ) { $replacestring .= $onestring; }
+
+		my $productname2 = $variableshashref->{'PRODUCTNAME'} . " " . $variableshashref->{'PRODUCTVERSION'};
+		if ( exists($onefilehash->{'FileDescriptionZ'}) ) { $productname2 = $onefilehash->{'FileDescriptionZ'}; }
+		my $unicode_productname2 = convert_to_unicode($productname2);
+
+		change_length_of_string_with_letter(\$unicode_productname2, $replacestring, $onestring);
+
+		$found2 = $onefile =~ s/$replacestring/$unicode_productname2/sg;
+	}
+
 	installer::files::save_binary_file($onefile, $destpath);
 
+	my $found = $found1 + $found2;
+	
 	return $found;
 }
 
 sub resolving_patchsoname_flag
 {
 	my ($filesarrayref, $variableshashref, $item, $languagestringref) = @_;
-	
+
 	my $diritem = lc($item);
 
 	my $replacedirbase = installer::systemactions::create_directories("patchsoname_$diritem", $languagestringref);
 	{
 		my $onefile = ${$filesarrayref}[$i];
 		my $styles = "";
-
+		
 		if ( $onefile->{'Styles'} ) { $styles = $onefile->{'Styles'}; }
 	
 		if ( $styles =~ /\bPATCH_SO_NAME\b/ )
 			my $sourcepath = $onefile->{'sourcepath'};
 			my $destinationpath = $replacedir . $onefilename;  
 			my $movepath = $destinationpath . ".orig";
-            
-            if ( exists($onefile-> {'FileDescription'}) ) { $filedescription = $onefile-> {'FileDescription'}; }
 
 			# if (!(-f $destinationpath))	# do nothing if the file already exists
 			# {
 			if ( $copysuccess )
 			{
 				# Now the file can be patch (binary!)
-				my $found = replace_productname_in_file($movepath, $destinationpath, $variableshashref, $filedescription);
+				my $found = replace_productname_in_file($movepath, $destinationpath, $variableshashref, $onefile, $styles);
 					
 				if ($found == 0)
 				{

solenv/bin/modules/installer/simplepackage.pm

 		else
 		{
 			installer::systemactions::copy_one_file($source, $destination);	
-			# see issue 102274 
-			my $unixrights = "";
-			if ( $onefile->{'UnixRights'} )
+
+			if ( ! $installer::globals::iswindowsbuild )
 			{
-				$unixrights = $onefile->{'UnixRights'};
-				
-				my $localcall = "$installer::globals::wrapcmd chmod $unixrights \'$destination\' \>\/dev\/null 2\>\&1";
-				system($localcall);
+				# see issue 102274 
+				my $unixrights = "";
+				if ( $onefile->{'UnixRights'} )
+				{
+					$unixrights = $onefile->{'UnixRights'};
+					
+					my $localcall = "$installer::globals::wrapcmd chmod $unixrights \'$destination\' \>\/dev\/null 2\>\&1";
+					system($localcall);
+				}
 			}
 		}
 	}
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.