openoffice-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a.@apache.org
Subject svn commit: r1547091 - in /openoffice/trunk/main/solenv/bin: ./ modules/installer/ modules/installer/windows/
Date Mon, 02 Dec 2013 16:37:28 GMT
Author: af
Date: Mon Dec  2 16:37:27 2013
New Revision: 1547091

URL: http://svn.apache.org/r1547091
Log:
123729: More general cleanup in installer scripts.

Modified:
    openoffice/trunk/main/solenv/bin/make_installer.pl
    openoffice/trunk/main/solenv/bin/modules/installer/globals.pm
    openoffice/trunk/main/solenv/bin/modules/installer/parameter.pm
    openoffice/trunk/main/solenv/bin/modules/installer/scppatchsoname.pm
    openoffice/trunk/main/solenv/bin/modules/installer/scriptitems.pm
    openoffice/trunk/main/solenv/bin/modules/installer/setupscript.pm
    openoffice/trunk/main/solenv/bin/modules/installer/windows/assembly.pm
    openoffice/trunk/main/solenv/bin/modules/installer/windows/component.pm
    openoffice/trunk/main/solenv/bin/modules/installer/windows/directory.pm
    openoffice/trunk/main/solenv/bin/modules/installer/windows/featurecomponent.pm
    openoffice/trunk/main/solenv/bin/modules/installer/windows/file.pm
    openoffice/trunk/main/solenv/bin/modules/installer/windows/idtglobal.pm
    openoffice/trunk/main/solenv/bin/modules/installer/windows/inifile.pm
    openoffice/trunk/main/solenv/bin/modules/installer/windows/msiglobal.pm
    openoffice/trunk/main/solenv/bin/modules/installer/windows/registry.pm
    openoffice/trunk/main/solenv/bin/modules/installer/worker.pm

Modified: openoffice/trunk/main/solenv/bin/make_installer.pl
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/solenv/bin/make_installer.pl?rev=1547091&r1=1547090&r2=1547091&view=diff
==============================================================================
--- openoffice/trunk/main/solenv/bin/make_installer.pl (original)
+++ openoffice/trunk/main/solenv/bin/make_installer.pl Mon Dec  2 16:37:27 2013
@@ -256,25 +256,53 @@ sub MakeWindowsBuild ($$$$$$$$$$$$$$$$$$
     $modulesinproductlanguageresolvedarrayref = installer::windows::feature::sort_feature($modulesinproductlanguageresolvedarrayref);
     installer::windows::feature::create_feature_table($modulesinproductlanguageresolvedarrayref, $newidtdir, $languagesarrayref, $allvariableshashref);
 
-    installer::windows::featurecomponent::create_featurecomponent_table($filesinproductlanguageresolvedarrayref, $registryitemsinproductlanguageresolvedarrayref, $newidtdir);
+    installer::windows::featurecomponent::create_featurecomponent_table(
+        $filesinproductlanguageresolvedarrayref,
+        $registryitemsinproductlanguageresolvedarrayref,
+        $newidtdir);
 
-    installer::windows::media::create_media_table($filesinproductlanguageresolvedarrayref, $newidtdir, $allvariableshashref);
+    installer::windows::media::create_media_table(
+        $filesinproductlanguageresolvedarrayref,
+        $newidtdir,
+        $allvariableshashref);
 
-    installer::windows::font::create_font_table($filesinproductlanguageresolvedarrayref, $newidtdir);
+    installer::windows::font::create_font_table(
+        $filesinproductlanguageresolvedarrayref,
+        $newidtdir);
 
     # Attention: The table "Shortcut.idt" contains language specific strings -> parameter: $languagesarrayref !
     # Attention: Shortcuts (Folderitems) have icon files, that have to be copied into the Icon directory (last parameter)
     my @iconfilecollector = ();
 
-    installer::windows::shortcut::create_shortcut_table($filesinproductlanguageresolvedarrayref, $linksinproductlanguageresolvedarrayref, $folderinproductlanguageresolvedarrayref, $folderitemsinproductlanguageresolvedarrayref, $directoriesforepmarrayref, $newidtdir, $languagesarrayref, $includepatharrayref, \@iconfilecollector);
+    installer::windows::shortcut::create_shortcut_table(
+        $filesinproductlanguageresolvedarrayref,
+        $linksinproductlanguageresolvedarrayref,
+        $folderinproductlanguageresolvedarrayref,
+        $folderitemsinproductlanguageresolvedarrayref,
+        $directoriesforepmarrayref,
+        $newidtdir,
+        $languagesarrayref,
+        $includepatharrayref,
+        \@iconfilecollector);
 
-    installer::windows::inifile::create_inifile_table($inifiletableentries, $filesinproductlanguageresolvedarrayref, $newidtdir);
+    installer::windows::inifile::create_inifile_table(
+        $inifiletableentries,
+        $filesinproductlanguageresolvedarrayref,
+        $newidtdir);
 
-    installer::windows::icon::create_icon_table(\@iconfilecollector, $newidtdir);	 # creating the icon table with all iconfiles used as shortcuts (FolderItems)
+    installer::windows::icon::create_icon_table(
+        \@iconfilecollector,
+        $newidtdir);	 # creating the icon table with all iconfiles used as shortcuts (FolderItems)
 
-    installer::windows::createfolder::create_createfolder_table($directoriesforepmarrayref, $filesinproductlanguageresolvedarrayref, $newidtdir, $allvariableshashref);
+    installer::windows::createfolder::create_createfolder_table(
+        $directoriesforepmarrayref,
+        $filesinproductlanguageresolvedarrayref,
+        $newidtdir,
+        $allvariableshashref);
 
-    installer::windows::upgrade::create_upgrade_table($newidtdir, $allvariableshashref);
+    installer::windows::upgrade::create_upgrade_table(
+        $newidtdir,
+        $allvariableshashref);
 
     if ( ! $installer::globals::languagepack )	 # the following tables not for language packs
     {
@@ -384,7 +412,9 @@ sub MakeWindowsBuild ($$$$$$$$$$$$$$$$$$
         {
             my $licensefilesource = installer::windows::idtglobal::get_rtflicensefilesource($onelanguage, $includepatharrayref_lang);
             my $licensefile = installer::files::read_file($licensefilesource);
-            installer::scpzipfiles::replace_all_ziplistvariables_in_rtffile($licensefile, $allvariableshashref);
+            installer::scpzipfiles::replace_all_ziplistvariables_in_rtffile(
+                $licensefile,
+                $allvariableshashref);
             my $controltablename = $languageidtdir . $installer::globals::separator . "Control.idt";
             my $controltable = installer::files::read_file($controltablename);
             installer::windows::idtglobal::add_licensefile_to_database($licensefile, $controltable);
@@ -519,9 +549,6 @@ sub MakeWindowsBuild ($$$$$$$$$$$$$$$$$$
 
     $installer::globals::packjobref = installer::windows::msiglobal::generate_cab_file_list($filesinproductlanguageresolvedarrayref, $installdir, $ddfdir, $allvariableshashref);
 
-    # Update and patch reasons the pack order needs to be saved
-    installer::windows::msiglobal::save_packorder();
-
     $installer::logger::Info->print("\n"); 
 
     #######################################################
@@ -545,7 +572,6 @@ sub MakeWindowsBuild ($$$$$$$$$$$$$$$$$$
     installer::worker::clean_output_tree();	# removing directories created in the output tree
     ($is_success, $finalinstalldir) = installer::worker::analyze_and_save_logfile($loggingdir, $installdir, $installlogdir, $allsettingsarrayref, $languagestringref, $current_install_number);
 
-    
     #######################################################
     # Creating download installation set
     #######################################################
@@ -563,6 +589,7 @@ sub MakeWindowsBuild ($$$$$$$$$$$$$$$$$$
         my $downloaddir = installer::download::create_download_sets($finalinstalldir, $includepatharrayref, $allvariableshashref, $$downloadname, $languagestringref, $languagesarrayref);
         installer::worker::analyze_and_save_logfile($loggingdir, $downloaddir, $installlogdir, $allsettingsarrayref, $languagestringref, $current_install_number);
     }
+    
 }
 
 
@@ -821,7 +848,6 @@ sub MakeNonWindowsBuild ($$$$$$$$$$$$$$$
                     $installer::globals::makelinuxlinkrpm = 0;
                     if ( $installer::globals::patch ) { $installer::globals::call_epm = 1; }	 # enabling packing again
                     $run = 1;
-
                 }
 
                 if (( ! $installer::globals::makelinuxlinkrpm ) && ( ! $run ))
@@ -833,7 +859,6 @@ sub MakeNonWindowsBuild ($$$$$$$$$$$$$$$
                     if ( $installer::globals::patch ) { $installer::globals::call_epm = 0; }	 # no packing of core module in patch
                     $shellscriptsfilename = "";	# shell scripts only need to be included into the link rpm
                     $run = 1;
-
                 }					
             }							
         }
@@ -961,7 +986,7 @@ sub MakeNonWindowsBuild ($$$$$$$$$$$$$$$
             {	
                 # changing into the "install" directory to create installation sets
                 
-                $currentdir = cwd();	# $currentdir is global in this file
+                my $currentdir = cwd();	# $currentdir is global in this file
 
                 chdir($installdir);		# changing into install directory ($installdir is global in this file)
 
@@ -1186,8 +1211,6 @@ sub MakeNonWindowsBuild ($$$$$$$$$$$$$$$
 }
 
 
-
-
 #################################################
 # Main program
 #################################################
@@ -1206,6 +1229,7 @@ $installer::logger::Global->add_timestam
 # While there is no language set and logger::Lang is not yet tied to a log file,
 # forward its output to logger::Global.
 $installer::logger::Lang->set_forward($installer::logger::Global);
+$installer::logger::Info->set_forward($installer::logger::Global);
 
 #########################################
 # Checking the environment and setting
@@ -1254,89 +1278,29 @@ my $current_install_number = "";
 # Checking the system requirements
 ######################################
 
-$installer::logger::Info->print( "... checking required files ...\n" );
+$installer::logger::Info->print("... checking required files ...\n");
 installer::control::check_system_path();
 
 my $pathvariableshashref = installer::environment::create_pathvariables($environmentvariableshashref);
 
-###############################################
-# Checking saved setting for Windows patches
-###############################################
-
-if (( $installer::globals::iswindowsbuild ) &&	( $installer::globals::prepare_winpatch )) { installer::windows::msiglobal::read_saved_mappings(); }
-
 ###################################################
 # Analyzing the settings and variables in zip.lst
 ###################################################
 
-installer::logger::globallog("zip list file: $installer::globals::ziplistname");
-
-my $ziplistref = installer::files::read_file($installer::globals::ziplistname);
-
 $installer::logger::Info->print( "... analyzing $installer::globals::ziplistname ... \n" );
 
-my ($productblockref, $parent) = installer::ziplist::getproductblock($ziplistref, $installer::globals::product, 1);		# product block from zip.lst
-
-my ($settingsblockref, undef) = installer::ziplist::getproductblock($productblockref, "Settings", 0);		# settings block from zip.lst
-
-$settingsblockref = installer::ziplist::analyze_settings_block($settingsblockref);				# select data from settings block in zip.lst
-
-my $allsettingsarrayref = installer::ziplist::get_settings_from_ziplist($settingsblockref);
-
-my $allvariablesarrayref = installer::ziplist::get_variables_from_ziplist($settingsblockref);
-
-my ($globalproductblockref, undef) = installer::ziplist::getproductblock($ziplistref, $installer::globals::globalblock, 0);		# global product block from zip.lst
-
-while (defined $parent)
+my ($allvariableshashref,
+    $allsettingsarrayref)
+    = installer::ziplist::read_openoffice_lst_file(
+        $installer::globals::ziplistname,
+        $installer::globals::product,
+        $loggingdir);
+$installer::logger::Lang->printf("variables:\n");
+foreach my $key (sort keys %$allvariableshashref)
 {
-    my $parentproductblockref;
-    ($parentproductblockref, $parent) = installer::ziplist::getproductblock(
-		$ziplistref, $parent, 1);
-    my ($parentsettingsblockref, undef) = installer::ziplist::getproductblock(
-		$parentproductblockref, "Settings", 0);
-    $parentsettingsblockref = installer::ziplist::analyze_settings_block(
-		$parentsettingsblockref);
-    my $allparentsettingsarrayref =
-		installer::ziplist::get_settings_from_ziplist($parentsettingsblockref);
-    my $allparentvariablesarrayref =
-		installer::ziplist::get_variables_from_ziplist($parentsettingsblockref);
-	$allsettingsarrayref =
-		installer::converter::combine_arrays_from_references_first_win(
-			$allsettingsarrayref, $allparentsettingsarrayref)
-		if $#{$allparentsettingsarrayref} > -1;
-    $allvariablesarrayref =
-		installer::converter::combine_arrays_from_references_first_win(
-			$allvariablesarrayref, $allparentvariablesarrayref)
-		if $#{$allparentvariablesarrayref} > -1;
+    $installer::logger::Global->printf("    %s -> %s\n", $key, $allvariableshashref->{$key});
 }
-
-if ( $#{$globalproductblockref} > -1 )
-{
-    my ($globalsettingsblockref, undef) = installer::ziplist::getproductblock($globalproductblockref, "Settings", 0);		# settings block from zip.lst
-
-    $globalsettingsblockref = installer::ziplist::analyze_settings_block($globalsettingsblockref);				# select data from settings block in zip.lst
     
-    my $allglobalsettingsarrayref = installer::ziplist::get_settings_from_ziplist($globalsettingsblockref);
-
-    my $allglobalvariablesarrayref = installer::ziplist::get_variables_from_ziplist($globalsettingsblockref);
-
-    if ( $#{$allglobalsettingsarrayref} > -1 ) { $allsettingsarrayref = installer::converter::combine_arrays_from_references_first_win($allsettingsarrayref, $allglobalsettingsarrayref); }
-    if ( $#{$allglobalvariablesarrayref} > -1 ) { $allvariablesarrayref = installer::converter::combine_arrays_from_references_first_win($allvariablesarrayref, $allglobalvariablesarrayref); }
-}
-
-$allsettingsarrayref = installer::ziplist::remove_multiples_from_ziplist($allsettingsarrayref); # the settings from the zip.lst
-
-$allvariablesarrayref = installer::ziplist::remove_multiples_from_ziplist($allvariablesarrayref);
-
-installer::ziplist::replace_variables_in_ziplist_variables($allvariablesarrayref);
-
-my $allvariableshashref = installer::converter::convert_array_to_hash($allvariablesarrayref);	# the variables from the zip.lst
-
-installer::ziplist::set_default_productversion_if_required($allvariableshashref);
-
-installer::ziplist::add_variables_to_allvariableshashref($allvariableshashref);
-
-installer::ziplist::overwrite_ooovendor( $allvariableshashref );
 
 ########################################################
 # Check if this is simple packaging mechanism
@@ -1684,19 +1648,19 @@ for (;1;last) 
 
 	if ( $installer::globals::updatepack ) { $shipinstalldir = installer::control::determine_ship_directory($languagestringref); }
 
-	###################################################################
-	# Reading an existing msi database, to prepare update and patch
-	###################################################################
-
 	##############################################
 	# Setting global code variables for Windows
 	##############################################
 
 	if (!($installer::globals::is_copy_only_project)) 
 	{
-		if (( $installer::globals::iswindowsbuild ) && ( $installer::globals::packageformat ne "archive" ) && ( $installer::globals::packageformat ne "installed" ))
+		if (( $installer::globals::iswindowsbuild )
+            && ( $installer::globals::packageformat ne "archive" )
+            && ( $installer::globals::packageformat ne "installed" ))
 		{
-			installer::windows::msiglobal::set_global_code_variables($languagesarrayref, $allvariableshashref);
+			installer::windows::msiglobal::set_global_code_variables(
+                $languagesarrayref,
+                $allvariableshashref);
 		}
 	}
 		
@@ -1745,7 +1709,6 @@ for (;1;last) 
 	}
 	
 	installer::scriptitems::changing_name_of_language_dependent_keys($filesinproductlanguageresolvedarrayref);
-
 	if ( $installer::globals::iswin and $^O =~ /MSWin/i ) { installer::converter::convert_slash_to_backslash($filesinproductlanguageresolvedarrayref); }
 
 	$filesinproductlanguageresolvedarrayref = installer::scriptitems::remove_non_existent_languages_in_productlists($filesinproductlanguageresolvedarrayref, $languagestringref, "Name", "file");
@@ -1848,6 +1811,7 @@ for (;1;last) 
 	($directoriesforepmarrayref, $alldirectoryhash) = installer::scriptitems::collect_directories_with_create_flag_from_directoryarray($dirsinproductlanguageresolvedarrayref, $alldirectoryhash);
 	
 	# installer::sorter::sorting_array_of_hashes($directoriesforepmarrayref, "HostName");
+	# if ( $installer::globals::globallogging ) { installer::files::save_array_of_hashes($loggingdir . "directoriesforepmlist3.log", $directoriesforepmarrayref); }
 
 	#########################################################
 	# language dependent scpactions part
@@ -2054,7 +2018,15 @@ for (;1;last) 
 	if (( $installer::globals::iswindowsbuild ) && ( ! $installer::globals::patch ))	# Windows specific items: Folder, FolderItem, RegistryItem
 	{
 		$installer::logger::Info->print( "... creating inf files ...\n" );
-		installer::worker::create_inf_file($filesinproductlanguageresolvedarrayref, $registryitemsinproductlanguageresolvedarrayref, $folderinproductlanguageresolvedarrayref, $folderitemsinproductlanguageresolvedarrayref, $modulesinproductlanguageresolvedarrayref, $languagesarrayref, $languagestringref, $allvariableshashref);
+		installer::worker::create_inf_file(
+            $filesinproductlanguageresolvedarrayref,
+            $registryitemsinproductlanguageresolvedarrayref,
+            $folderinproductlanguageresolvedarrayref,
+            $folderitemsinproductlanguageresolvedarrayref,
+            $modulesinproductlanguageresolvedarrayref,
+            $languagesarrayref,
+            $languagestringref,
+            $allvariableshashref);
 	}
 
 	###########################################
@@ -2096,16 +2068,13 @@ for (;1;last) 
 	installer::packagelist::log_packages_content($packages);
 	installer::packagelist::create_module_destination_hash($packages, $allvariableshashref);
 
-
-	# saving debug info, before starting part 2
-	if ( $installer::globals::debug ) { installer::logger::savedebug($installer::globals::exitlog); }
-
 	#################################################
 	# Part 2: The platform dependent part
 	#################################################
 
-	if ($installer::globals::iswindowsbuild)
+	if ( $installer::globals::iswindowsbuild )
     {
+        # Create .idt tables and a .msi file.
         MakeWindowsBuild(
             $allvariableshashref,
             $allsettingsarrayref,
@@ -2130,6 +2099,7 @@ for (;1;last) 
     }
     else
     {
+        # Creating epm list file.
         MakeNonWindowsBuild(
             $allvariableshashref,
             $allsettingsarrayref,

Modified: openoffice/trunk/main/solenv/bin/modules/installer/globals.pm
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/solenv/bin/modules/installer/globals.pm?rev=1547091&r1=1547090&r2=1547091&view=diff
==============================================================================
--- openoffice/trunk/main/solenv/bin/modules/installer/globals.pm (original)
+++ openoffice/trunk/main/solenv/bin/modules/installer/globals.pm Mon Dec  2 16:37:27 2013
@@ -31,6 +31,8 @@ BEGIN
 {	
 	$prog="make_installer.pl";
 
+    # WARNING: the following lines are matched verbatim in i18npool/source/isolang/langid.pl
+    
 	@noMSLocaleLangs = (
         "br",
         "bs",
@@ -232,7 +234,7 @@ BEGIN
 	$creating_windows_installer_patch = 0;
 
 	$strip = 1;
-	
+
 	$globallogging = 0;
 	$logfilename = "logfile.log";	# the default logfile name for global errors
 #	@logfileinfo = ();
@@ -411,8 +413,6 @@ BEGIN
 	$previous_idt_dir = "";	
 	$updatepack = 0;
 	$msitranpath = "";
-	$insert_file_at_end = 0;
-	$newfilesexist = 0;
 	$usesharepointpath = 0;
 	%newfilescollector = ();
 
@@ -489,10 +489,6 @@ BEGIN
 		$isunix = 0;
 		$iswin = 1;
         $archiveformat = ".zip";
-		%savedmapping = ();
-		%savedrevmapping = ();
-		%savedrev83mapping = ();
-		%saved83dirmapping = ();
 	}
 	elsif ( $plat =~ /os2/i )
 	{ 

Modified: openoffice/trunk/main/solenv/bin/modules/installer/parameter.pm
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/solenv/bin/modules/installer/parameter.pm?rev=1547091&r1=1547090&r2=1547091&view=diff
==============================================================================
--- openoffice/trunk/main/solenv/bin/modules/installer/parameter.pm (original)
+++ openoffice/trunk/main/solenv/bin/modules/installer/parameter.pm Mon Dec  2 16:37:27 2013
@@ -171,7 +171,7 @@ sub getparameter
 			exit(-1);
 		}
 	}
-	
+
 	# Usage of simple installer (not for Windows):
 	# $PERL -w $SOLARENV/bin/make_installer.pl \
 	# -f openoffice.lst -l en-US -p OpenOffice \
@@ -634,7 +634,6 @@ sub outputparameter ()
 	foreach my $line (@output)
 	{
 	    $installer::logger::Info->print($line);
-	    $installer::logger::Global->print($line);
 	}
 }
 

Modified: openoffice/trunk/main/solenv/bin/modules/installer/scppatchsoname.pm
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/solenv/bin/modules/installer/scppatchsoname.pm?rev=1547091&r1=1547090&r2=1547091&view=diff
==============================================================================
--- openoffice/trunk/main/solenv/bin/modules/installer/scppatchsoname.pm (original)
+++ openoffice/trunk/main/solenv/bin/modules/installer/scppatchsoname.pm Mon Dec  2 16:37:27 2013
@@ -94,6 +94,8 @@ sub replace_productname_in_file
 	my $replacestring = "";
 	for ( my $i = 1; $i <= 80; $i++ ) { $replacestring .= $onestring; }
 
+    $installer::logger::Lang->printf("processing PATCH_SO_NAME: %s -> %s\n", $sourcepath, $destpath);
+
 	my $productname = $variableshashref->{'PRODUCTNAME'} . " " . $variableshashref->{'PRODUCTVERSION'};
 	if ( exists($onefilehash->{'FileDescription'}) ) { $productname = $onefilehash->{'FileDescription'}; }
 	my $unicode_productname = convert_to_unicode($productname);
@@ -152,7 +154,8 @@ sub resolving_patchsoname_flag
 
 			# if (!(-f $destinationpath))	# do nothing if the file already exists
 			# {
-				
+
+            $installer::logger::Lang->printf("PATCH_SO_NAME: copying '%s' to '%s'\n", $sourcepath, $movepath);
 			my $copysuccess = installer::systemactions::copy_one_file($sourcepath, $movepath);
 	
 			if ( $copysuccess )

Modified: openoffice/trunk/main/solenv/bin/modules/installer/scriptitems.pm
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/solenv/bin/modules/installer/scriptitems.pm?rev=1547091&r1=1547090&r2=1547091&view=diff
==============================================================================
--- openoffice/trunk/main/solenv/bin/modules/installer/scriptitems.pm (original)
+++ openoffice/trunk/main/solenv/bin/modules/installer/scriptitems.pm Mon Dec  2 16:37:27 2013
@@ -2617,9 +2617,10 @@ sub build_modulegids_table ($$)
 
 	# build map of item names to list of respective module gids
 	# containing these items
-	foreach my $onemodule (@{$modulesref})
+	foreach my $onemodule (@$modulesref)
 	{
 		next if ! defined $onemodule->{$itemname};
+        
 		# these are the items contained in this module
 		# eg. Files = (gid_a_b_c,gid_d_e_f)
 		my $module_gids = $onemodule->{$itemname};
@@ -2649,10 +2650,9 @@ sub get_string_of_modulegids_for_itemgid
 	my $haslanguagemodule = 0;
 	my %foundmodules = ();
 
-	# print STDERR "lookup '" . lc($itemgid) . "'\n";
 	my $gid_list = $module_lookup_table->{lc($itemgid)};
 
-	foreach my $gid (@{$gid_list})
+	foreach my $gid (@$gid_list)
 	{
 		$foundmodules{$gid} = 1;
 		# Is this module a language module? This info should be stored at the file.
@@ -2674,8 +2674,8 @@ sub get_string_of_modulegids_for_itemgid
         {
             installer::exiter::exit_program(
                 sprintf(
-                    "ERROR: \"\" is assigned to modules with flag "
-                    . "\"LANGUAGEMODULE\" and also to modules without this flag! Modules: %s",
+                    "ERROR: \"%s\" is assigned to modules with flag "
+                    ."\"LANGUAGEMODULE\" and also to modules without this flag! Modules: %s",
                     $itemgid,
                     $allmodules),
                 "get_string_of_modulegids_for_itemgid");

Modified: openoffice/trunk/main/solenv/bin/modules/installer/setupscript.pm
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/solenv/bin/modules/installer/setupscript.pm?rev=1547091&r1=1547090&r2=1547091&view=diff
==============================================================================
--- openoffice/trunk/main/solenv/bin/modules/installer/setupscript.pm (original)
+++ openoffice/trunk/main/solenv/bin/modules/installer/setupscript.pm Mon Dec  2 16:37:27 2013
@@ -80,227 +80,157 @@ sub get_all_scriptvariables_from_install
 {
 	my ($scriptref, $script_filename) = @_;
 	
-	my @installobjectvariables;
+	my $installobjectvariables = {};
 
-	for ( my $i = 0; $i <= $#{$scriptref}; $i++ )
-	{
-		my $line = ${$scriptref}[$i];
-
-		if ( $line =~ /^\s*Installation\s+\w+\s*$/ )	# should be the first line
-		{
-			my $counter = $i+1;
-			my $installline = ${$scriptref}[$counter];	
-			
-			while (!($installline =~ /^\s*End\s*$/ ))
-			{
-				if ( $installline =~ /^\s*(\w+)\s+\=\s*(.*?)\s*\;\s*$/ )
-				{
-					my $key = $1;
-					my $value = $2;
+    my $firstline = $scriptref->[0];
+    if ($firstline !~ /^\s*Installation\s+\w+\s*$/)
+    {
+        installer::logger::PrintError("did not find 'Installation' keyword in first line of %s\n",
+            $script_filename);
+    }
+    foreach my $line (@$scriptref)
+    {
+		next if $line =~ /^\s*Installation\s+\w+\s*$/; # Already processed.
+        last if $line =~ /^\s*End\s*$/;
+
+        if ($line =~ /^\s*(\w+)\s+\=\s*\"?(.*?)\"?\s*\;\s*$/ )
+        {
+            my ($key, $value) = ($1, $2);
 					
-					# removing leading and ending " in $value
-					
-					if ( $value =~ /^\s*\"(.*)\"\s*$/ )
-					{
-						$value = $1;	
-					}
-					
-					$key = "\%" . uc($key);  # $key is %PRODUCTNAME
-					
-					my $input = $key . " " . $value . "\n";	  # $key can only be the first word
-					
-					push(@installobjectvariables ,$input);
-				}
+            $installobjectvariables->{uc($key)} = $value;
+        }
 
-				$counter++;			
-				$installline = ${$scriptref}[$counter];	
-			}
-		}
-
-		last;	# not interesting after installation object
 	}
 
-	return \@installobjectvariables;
+	return $installobjectvariables;
 }
 
 ######################################################################
 # Including LCPRODUCTNAME into the array
 ######################################################################
 
-sub add_lowercase_productname_setupscriptvariable
+sub add_lowercase_productname_setupscriptvariable ($)
 {
 	my ( $variablesref ) = @_;
 
-	for ( my $j = 0; $j <= $#{$variablesref}; $j++ )
-	{
-		my $variableline = ${$variablesref}[$j];
-
-		my ($key, $value);
-				
-		if ( $variableline =~ /^\s*\%(\w+?)\s+(.*?)\s*$/ )
-		{
-			$key = $1;
-			$value = $2;
-			
-			if ( $key eq "PRODUCTNAME" )
-			{
-				my $newline = "\%LCPRODUCTNAME " . lc($value) . "\n";
-				push(@{$variablesref} ,$newline);
-				my $original = $value;
-				$value =~ s/\s*//g; 
-				$newline = "\%ONEWORDPRODUCTNAME " . $value . "\n";
-				push(@{$variablesref} ,$newline);
-				$newline = "\%LCONEWORDPRODUCTNAME " . lc($value) . "\n";
-				push(@{$variablesref} ,$newline);
-				$value = $original;
-				$value =~ s/\s*$//g;
-				$value =~ s/^\s*//g;
-				$value =~ s/ /\%20/g;
-				$newline = "\%MASKEDPRODUCTNAME " . $value . "\n";
-				push(@{$variablesref} ,$newline);				
-				$value = $original;
-				$value =~ s/\s/\_/g; 
-				# if ( $value =~ /^\s*(.*?)\_(\w)(.*?)\_(\w)(.*)\s*$/ ) { $value = $1 . $2 . $4; }
-				$newline = "\%UNIXPRODUCTNAME " . lc($value) . "\n";
-				push(@{$variablesref} ,$newline);
-				$newline = "\%SYSTEMINTUNIXPACKAGENAME " . lc($value) . "\n";
-				push(@{$variablesref} ,$newline);
-				# if ( $value =~ /^\s*(.*?)\_(\w)(.*?)\_(\w)(.*)\s*$/ ) { $value = $1 . $2 . $4; }
-				# if ( $value =~ /^\s*(.*?)\_(\w)(.*?)\_(\w)(.*)\s*$/ ) { $value = $2 . $4; }
-				$newline = "\%UNIXPACKAGENAME " . lc($value) . "\n";
-				push(@{$variablesref} ,$newline);
-				$value = $original;
-				$value =~ s/\s/\_/g; 
-				$value =~ s/\.//g; 
-				# if ( $value =~ /^\s*(.*?)\_(\w)(.*?)\_(\w)(.*)\s*$/ ) { $value = $1 . $2 . $4; }
-				$newline = "\%WITHOUTDOTUNIXPRODUCTNAME " . lc($value) . "\n";
-				push(@{$variablesref} ,$newline);
-				# if ( $value =~ /^\s*(.*?)\_(\w)(.*?)\_(\w)(.*)\s*$/ ) { $value = $1 . $2 . $4; }
-				# if ( $value =~ /^\s*(.*?)\_(\w)(.*?)\_(\w)(.*)\s*$/ ) { $value = $2 . $4; }
-				$newline = "\%WITHOUTDOTUNIXPACKAGENAME " . lc($value) . "\n";
-				push(@{$variablesref} ,$newline);
-				$newline = "\%SOLARISBRANDPACKAGENAME " . lc($value) . "\n";
-				push(@{$variablesref} ,$newline);
-				$value = $original;
-			}
-			elsif  ( $key eq "PRODUCTEXTENSION" )
-			{
-				my $newline = "\%LCPRODUCTEXTENSION " . lc($value) . "\n";
-				push(@{$variablesref} ,$newline);			
-			}
-			elsif  ( $key eq "PRODUCTVERSION" )
-			{
-				$value =~ s/\.//g; 
-				my $newline = "\%WITHOUTDOTPRODUCTVERSION " . $value . "\n";
-				push(@{$variablesref} ,$newline);			
-			}
-			elsif  ( $key eq "OOOBASEVERSION" )
-			{
-				$value =~ s/\.//g; 
-				my $newline = "\%WITHOUTDOTOOOBASEVERSION " . $value . "\n";
-				push(@{$variablesref} ,$newline);			
-			}
-			
+    my %additional_variables = ();
+    
+	while (my ($key, $value) = each %$variablesref)
+	{
+        if ($key eq "PRODUCTNAME")
+        {
+            $additional_variables{"LCPRODUCTNAME"} = lc($value);
+            my $original = $value;
+            $value =~ s/\s+//g; 
+            $additional_variables{"ONEWORDPRODUCTNAME"} = $value;
+            $additional_variables{"LCONEWORDPRODUCTNAME"} = lc($value);
+            $value = $original;
+            $value =~ s/(^\s+|\s+$)//g;
+            $value =~ s/ /\%20/g;
+			$additional_variables{"MASKEDPRODUCTNAME"} = $value;
+            $value = $original;
+            $value =~ s/\s/\_/g; 
+            $additional_variables{"UNIXPRODUCTNAME"} = lc($value);
+            $additional_variables{"SYSTEMINTUNIXPACKAGENAME"} = lc($value);
+            $additional_variables{"UNIXPACKAGENAME"} = lc($value);
+            $value = $original;
+            $value =~ s/\s/\_/g; 
+            $value =~ s/\.//g; 
+            $additional_variables{"WITHOUTDOTUNIXPRODUCTNAME"} = lc($value);
+            $additional_variables{"WITHOUTDOTUNIXPACKAGENAME"} = lc($value);
+            $additional_variables{"SOLARISBRANDPACKAGENAME"} = lc($value);
+        }
+        elsif  ($key eq "PRODUCTEXTENSION")
+        {
+            $additional_variables{"LCPRODUCTEXTENSION"} = lc($value);
+        }
+        elsif  ($key eq "PRODUCTVERSION")
+        {
+            $value =~ s/\.//g; 
+            $additional_variables{"WITHOUTDOTPRODUCTVERSION"} = $value;
+        }
+        elsif  ($key eq "OOOBASEVERSION")
+        {
+            $value =~ s/\.//g; 
+            $additional_variables{"WITHOUTDOTOOOBASEVERSION"} = $value;
 		}
 	}
+
+	while (my ($key, $value) = each %additional_variables)
+    {
+        $variablesref->{$key} = $value;
+    }
 }
 
 ######################################################################
 # Resolving the new introduced lowercase script variables
 ######################################################################
 
-sub resolve_lowercase_productname_setupscriptvariable
+sub resolve_lowercase_productname_setupscriptvariable ($)
 {
-	my ( $variablesref ) = @_;
-
-	my %variables = ();
-
-	# First step: Collecting variables
-
-	for ( my $j = 0; $j <= $#{$variablesref}; $j++ )
-	{
-		my $variableline = ${$variablesref}[$j];
+	my ($variablesref) = @_;
 
-		my ($key, $value);
-				
-		if ( $variableline =~ /^\s*\%(\w+?)\s+(.*?)\s*$/ )
-		{
-			$key = $1;
-			$value = $2;
-			$variables{$key} = $value;
-		}
-	}
-	
-	# Second step: Resolving variables
-	
-	for ( my $j = 0; $j <= $#{$variablesref}; $j++ )
-	{				
-		if ( ${$variablesref}[$j] =~ /\$\{(.*?)\}/ )
-		{
-			my $key = $1;
-			${$variablesref}[$j] =~ s/\$\{\Q$key\E\}/$variables{$key}/g;			
+    while (my ($key,$value) = each %$variablesref)
+    {
+		if ($value =~ /\$\{(.*?)\}/)
+		{
+            my $varname = $1;
+            my $replacement = $variablesref->{$varname};
+            my $new_value = $value;
+            $new_value =~ s/\$\{\Q$varname\E\}/$replacement/g;
+            $variablesref->{$key} = $new_value;
 		}
 	}
-
 }
 
+
+
+
 ######################################################################
 # Replacing all setup script variables inside the setup script file
 ######################################################################
 
-sub replace_all_setupscriptvariables_in_script
+sub replace_all_setupscriptvariables_in_script ($$)
 {
-	my ( $scriptref, $variablesref ) = @_;
+	my ($script_lines, $variables) = @_;
 
 	installer::logger::include_header_into_globallogfile("Replacing variables in setup script (start)");
 
-	# make hash of variables to be substituted if they appear in the script
-	my %subs;
-	for ( my $j = 0; $j <= $#{$variablesref}; $j++ )
-	{
-		my $variableline = ${$variablesref}[$j];
-
-		if ( $variableline =~ /^\s*(\%\w+?)\s+(.*?)\s*$/ )
-		{
-			$subs{$1}= $2;
-		}
-	}
-
 	# This is far faster than running a regexp for each line
-	my $bigstring = '';
-	for my $line (@{$scriptref}) { $bigstring = $bigstring . $line; }
+	my $bigstring = join("", @$script_lines);
 
-	foreach my $key ( keys %subs )
+	while (my ($key,$value) = each %$variables)
 	{
 		# Attention: It must be possible to substitute "%PRODUCTNAMEn", "%PRODUCTNAME%PRODUCTVERSIONabc"
-		my $value = $subs{$key};
-		$bigstring =~ s/$key/$value/g;
+		my $count = ($bigstring =~ s/%$key/$value/g);
+        if ($count > 0)
+        {
+            $installer::logger::Lang->printf("replaced %s %d times\n", $key, $count);
+        }
 	}
 
 	my @newlines = split /\n/, $bigstring;
-	$scriptref = \@newlines;
 
 	# now check for any mis-named '%' variables that we have left
 	my $num = 0;
-	for my $check (@newlines)
+	foreach my $line (@newlines)
 	{
 		$num++;
-		if ( $check =~ /^.*\%\w+.*$/ )
+		if ($line =~ /\%\w+/)
 		{
-			if (( $check =~ /%1/ ) || ( $check =~ /%2/ ) || ( $check =~ /%verify/ ))
+			if (( $line =~ /%1/ ) || ( $line =~ /%2/ ) || ( $line =~ /%verify/ ))
             {
                 next;
             }
-            $installer::logger::Global->printf(
-                "WARNING: mis-named or un-known '%s' variable in setup script at line %s:\n",
-                "%", $num);
-            $installer::logger::Global->printf("%s\n", $check);
+            $installer::logger::Info->printf(
+                "WARNING: mis-named or un-known %%-variable in setup script at line %s:\n",$num);
+            $installer::logger::Info->printf("%s\n", $line);
 		}
 	}
 
 	installer::logger::include_header_into_globallogfile("Replacing variables in setup script (end)");
 
-	return $scriptref;
+	return \@newlines;
 }
 
 #######################################################################
@@ -471,21 +401,13 @@ sub prepare_non_advertised_files
 # object, the installation object is more important
 #####################################################################################
 
-sub add_installationobject_to_variables
+sub add_installationobject_to_variables ($$)
 {
-	my ($allvariables, $allscriptvariablesref) = @_;
+	my ($variables, $script_variables) = @_;
 
-	for ( my $i = 0; $i <= $#{$allscriptvariablesref}; $i++ )
+	while (my ($key, $value) = each %$script_variables)
 	{
-		my $line = ${$allscriptvariablesref}[$i];
-	
-		if ( $line =~ /^\s*\%(\w+)\s+(.*?)\s*$/ )
-		{
-			my $key = $1;
-			my $value = $2;
-
-			$allvariables->{$key} = $value;	# overwrite existing values from zip.lst
-		}
+        $variables->{$key} = $value;	# overwrite existing values from zip.lst
 	}
 }
 

Modified: openoffice/trunk/main/solenv/bin/modules/installer/windows/assembly.pm
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/solenv/bin/modules/installer/windows/assembly.pm?rev=1547091&r1=1547090&r2=1547091&view=diff
==============================================================================
--- openoffice/trunk/main/solenv/bin/modules/installer/windows/assembly.pm (original)
+++ openoffice/trunk/main/solenv/bin/modules/installer/windows/assembly.pm Mon Dec  2 16:37:27 2013
@@ -350,8 +350,10 @@ sub add_assembly_condition_into_componen
                         $keypath) . "\n";
 					${$componenttable}[$j] = $oneline;
 					$changed = 1;
-					$installer::logger::Lang->print("Changing %s :\n", $componenttablename);
+                    
+					$installer::logger::Lang->printf("Changing %s :\n",  $componenttablename);
 					$installer::logger::Lang->print($oneline);
+                    
 					last;			
 				}		
 			}
@@ -362,7 +364,7 @@ sub add_assembly_condition_into_componen
 	{
 		# Saving the file
 		installer::files::save_file($componenttablename ,$componenttable);
-		$installer::logger::Lang->print("Saved idt file: %s\n", $componenttablename);
+		$installer::logger::Lang->printf("Saved idt file: %s\n", $componenttablename);
 	}
 }
 

Modified: openoffice/trunk/main/solenv/bin/modules/installer/windows/component.pm
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/solenv/bin/modules/installer/windows/component.pm?rev=1547091&r1=1547090&r2=1547091&view=diff
==============================================================================
--- openoffice/trunk/main/solenv/bin/modules/installer/windows/component.pm (original)
+++ openoffice/trunk/main/solenv/bin/modules/installer/windows/component.pm Mon Dec  2 16:37:27 2013
@@ -31,6 +31,8 @@ use installer::globals;
 use installer::windows::idtglobal;
 use installer::windows::language;
 
+use strict;
+
 ##############################################################
 # Returning a globally unique ID (GUID) for a component
 # If the component is new, a unique guid has to be created.
@@ -64,34 +66,32 @@ sub get_component_guid ($)
 
 sub get_file_component_directory ($$$)
 {
-	my ($componentname, $filesref, $dirref) = @_; 
+    my ($componentname, $filesref, $dirref) = @_; 
 
-	my ($component,  $uniquedir);
-	my $found = 0;
+    my ($component,  $uniquedir);
 
-	foreach my $onefile (@$filesref)
-	{
-		if ($onefile->{'componentname'} eq $componentname)
-		{
+    foreach my $onefile (@$filesref)
+    {
+        if ($onefile->{'componentname'} eq $componentname)
+        {
             return get_file_component_directory_for_file($onefile, $dirref);
-		}
-	}
-	
-
+        }
+    }
+    
     # This component can be ignored, if it exists in a version with
     # extension "_pff" (this was renamed in file::get_sequence_for_file() )
     my $ignore_this_component = 0;
     my $origcomponentname = $componentname;
     my $componentname_pff = $componentname . "_pff";
-		
+        
     foreach my $onefile (@$filesref)
     {
         if ($onefile->{'componentname'} eq $componentname_pff)
         {
             return "IGNORE_COMP";
-        }	
+        }
     }
-		
+
     installer::exiter::exit_program(
         "ERROR: Did not find component \"$origcomponentname\" in file collection",
         "get_file_component_directory");
@@ -125,7 +125,7 @@ sub get_file_component_directory_for_fil
 	installer::pathanalyzer::get_path_from_fullqualifiedname(\$destination);
 
 	$destination =~ s/\Q$installer::globals::separator\E\s*$//;
-	
+
 	# This path has to be defined in the directory collection at "HostName" 
 
     my $uniquedir = undef;
@@ -135,11 +135,10 @@ sub get_file_component_directory_for_fil
 	}		
 	else
 	{
-		$found = 0;
-	
-		foreach my $directory (@$dirref)
+		my $found = 0;
+        foreach my $directory (@$dirref)
 		{
-			if ($directory->{'HostName'} eq $destination )
+			if ($directory->{'HostName'} eq $destination)
 			{
 				$found = 1;
                 $uniquedir = $directory->{'uniquename'};
@@ -153,16 +152,15 @@ sub get_file_component_directory_for_fil
                 "ERROR: Did not find destination $destination in directory collection",
                 "get_file_component_directory");
 		}
-	
-		
+
 		if ( $uniquedir eq $installer::globals::officeinstalldirectory )
 		{
 			$uniquedir = "INSTALLLOCATION";		
 		}
 	}
-		
+
 	$onefile->{'uniquedirname'} = $uniquedir;		# saving it in the file collection
-	
+
 	return $uniquedir	
 }
 
@@ -326,12 +324,9 @@ sub get_component_keypath ($$)
 {
 	my ($componentname, $itemsref) = @_;
 
-	my $found = 0;
-	my $infoline = "";
-
 	foreach my $oneitem (@$itemsref)
 	{
-        my $component = $oneitem->{'componentname'};
+		my $component = $oneitem->{'componentname'};
 
 		if ( ! defined $component)
         {
@@ -356,14 +351,8 @@ sub get_component_keypath ($$)
 	
             return $keypath
 		}
-
-		if ($oneitem->{'componentname'} eq $componentname)
-		{
-			$found = 1;
-			last;
-		}
 	}
-
+	
     installer::exiter::exit_program(
         "ERROR: Did not find component in file/registry collection, function get_component_keypath",
         "get_component_keypath");

Modified: openoffice/trunk/main/solenv/bin/modules/installer/windows/directory.pm
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/solenv/bin/modules/installer/windows/directory.pm?rev=1547091&r1=1547090&r2=1547091&view=diff
==============================================================================
--- openoffice/trunk/main/solenv/bin/modules/installer/windows/directory.pm (original)
+++ openoffice/trunk/main/solenv/bin/modules/installer/windows/directory.pm Mon Dec  2 16:37:27 2013
@@ -30,6 +30,8 @@ use installer::pathanalyzer;
 use installer::windows::idtglobal;
 use installer::windows::msiglobal;
 
+use strict;
+
 ##############################################################
 # Collecting all directory trees in global hash
 ##############################################################
@@ -73,12 +75,22 @@ sub overwrite_programfilesfolder
 	}
 }
 
-##############################################################
-# Maximum length of directory name is 72.
-# Taking care of underlines, which are the separator.
-##############################################################
 
-sub make_short_dir_version
+
+
+=head2 make_short_dir_version($longstring)
+
+    Transform the given string into one that is at most 70 characters long.
+    That is done in two steps:
+    - Cut all parts separated by '_' or '-' down to a length of 5.
+    - Cut down the result to a length of 60 and fill it up to length 70
+      with the MD5 checksum.
+
+    This transform always returns the same result for the same string.
+    There is no counter and reference to a global set of names to make the string unique.
+    
+=cut
+sub make_short_dir_version ($)
 {
 	my ($longstring) = @_;
 	
@@ -90,29 +102,24 @@ sub make_short_dir_version
 	# Splitting the string at each "underline" and allowing only $length characters per directory name.
 	# Checking also uniqueness and length.
 	
-	my $stringarray = installer::converter::convert_stringlist_into_array_without_newline(\$longstring, "_");
-	
-	foreach my $onestring ( @{$stringarray} )
+	my @outer_parts = split(/_/, $longstring);
+	foreach my $onestring (@outer_parts)
 	{
 		my $partstring = "";
 		
 		if ( $onestring =~ /\-/ )
 		{
-			my $localstringarray = installer::converter::convert_stringlist_into_array_without_newline(\$onestring, "-");
-			foreach my $onelocalstring ( @{$localstringarray} )
-			{
-				if ( length($onelocalstring) > $length ) { $onelocalstring = substr($onelocalstring, 0, $length); }
-				$partstring = $partstring . "-" . $onelocalstring;
-			}
+			my @inner_parts = split(/-/, $onestring);
+            @inner_parts = map {substr($_,0,$length)} @inner_parts;
+            $partstring = join("-", @inner_parts);
 			$partstring =~ s/^\s*\-//;
 		}
 		else
 		{
-			if ( length($onestring) > $length ) { $partstring = substr($onestring, 0, $length); }
-			else { $partstring = $onestring; }
+			$partstring = substr($onestring, 0, $length);
 		}
 
-		$shortstring = $shortstring . "_" . $partstring;
+		$shortstring .= "_" . $partstring;
 	}
 
 	$shortstring =~ s/^\s*\_//;
@@ -120,14 +127,8 @@ sub make_short_dir_version
 	# Setting unique ID to each directory
 	# No counter allowed, process must be absolute reproducable due to patch creation process.
 	
-	# chomp(my $id = `echo $longstring_save | md5sum | sed -e "s/ .*//g"`);  # Very, very slow
-	# my $subid = substr($id, 0, 9); # taking only the first 9 digits
-
 	my $subid = installer::windows::msiglobal::calculate_id($longstring_save, 9); # taking only the first 9 digits
-
-	if ( length($shortstring) > $cutlength ) { $shortstring = substr($shortstring, 0, $cutlength); }
-
-	$shortstring = $shortstring . "_" . $subid;
+	$shortstring = substr($shortstring, 0, $cutlength) . "_" . $subid;
 
 	return $shortstring;
 }
@@ -558,13 +559,9 @@ sub create_directory_table ($$$$)
 	my $infoline;
 	
 	overwrite_programfilesfolder($allvariableshashref);
-	if ( $installer::globals::globallogging ) { installer::files::save_array_of_hashes($loggingdir . "directoriesforidt_local_1.log", $directoryref); }
 	create_unique_directorynames($directoryref, $allvariableshashref);
-	if ( $installer::globals::globallogging ) { installer::files::save_array_of_hashes($loggingdir . "directoriesforidt_local_1a.log", $directoryref); }
 	create_defaultdir_directorynames($directoryref);	# only destdir!
-	if ( $installer::globals::globallogging ) { installer::files::save_array_of_hashes($loggingdir . "directoriesforidt_local_2.log", $directoryref); }
 	set_installlocation_directory($directoryref, $allvariableshashref);
-	if ( $installer::globals::globallogging ) { installer::files::save_array_of_hashes($loggingdir . "directoriesforidt_local_3.log", $directoryref); }
 	installer::windows::idtglobal::write_idt_header(\@directorytable, "directory");
 	add_root_directories(\@directorytable, $allvariableshashref);
 	create_directorytable_from_collection(\@directorytable, $directoryref);

Modified: openoffice/trunk/main/solenv/bin/modules/installer/windows/featurecomponent.pm
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/solenv/bin/modules/installer/windows/featurecomponent.pm?rev=1547091&r1=1547090&r2=1547091&view=diff
==============================================================================
--- openoffice/trunk/main/solenv/bin/modules/installer/windows/featurecomponent.pm (original)
+++ openoffice/trunk/main/solenv/bin/modules/installer/windows/featurecomponent.pm Mon Dec  2 16:37:27 2013
@@ -30,37 +30,46 @@ use installer::files;
 use installer::globals;
 use installer::windows::idtglobal;
 
+use strict;
+
+
 #################################################################################
 # Collecting all pairs of features and components from the files collector
 #################################################################################
 
-sub create_featurecomponent_table_from_files_collector
+sub create_featurecomponent_table_from_files_collector ($$)
 {
 	my ($featurecomponenttableref, $filesref) = @_;
 
-	for ( my $i = 0; $i <= $#{$filesref}; $i++ )
+	foreach my $onefile (@$filesref)
 	{
-		my $onefile = ${$filesref}[$i];
-		
 		my $filecomponent = $onefile->{'componentname'};
 		my $filemodules = $onefile->{'modules'};
 
 		if ( $filecomponent eq "" ) 
 		{
-			installer::exiter::exit_program("ERROR: No component defined for file $onefile->{'Name'}", "create_featurecomponent_table_from_files_collector");
-		}
-		if ( $filemodules eq "" ) 
-		{
-			installer::exiter::exit_program("ERROR: No modules found for file $onefile->{'Name'}", "create_featurecomponent_table_from_files_collector");
+			installer::exiter::exit_program(
+                sprintf("ERROR: No component defined for file %s", $onefile->{'Name'}),
+                "create_featurecomponent_table_from_files_collector");
+		}
+        if ( ! defined $filemodules)
+        {
+            # Temporary for files created from source installation set.
+            die;
+        }
+		if ($filemodules eq "") 
+		{
+			installer::exiter::exit_program(
+                sprintf("ERROR: No modules found for file %s", $onefile->{'Name'}),
+                "create_featurecomponent_table_from_files_collector");
 		}
 
 		my $filemodulesarrayref = installer::converter::convert_stringlist_into_array(\$filemodules, ",");
 
-		for ( my $j = 0; $j <= $#{$filemodulesarrayref}; $j++ )
+		foreach my $onemodule (@$filemodulesarrayref)
 		{
 			my %featurecomponent = ();
 			
-			my $onemodule = ${$filemodulesarrayref}[$j];
 			$onemodule =~ s/\s*$//;
 			$featurecomponent{'Feature'} = $onemodule;
 			$featurecomponent{'Component'} = $filecomponent;
@@ -70,7 +79,7 @@ sub create_featurecomponent_table_from_f
 
 			installer::windows::idtglobal::shorten_feature_gid(\$featurecomponent{'Feature'});
 			
-			$oneline = "$featurecomponent{'Feature'}\t$featurecomponent{'Component'}\n";
+			my $oneline = "$featurecomponent{'Feature'}\t$featurecomponent{'Component'}\n";
 			
 			# control of uniqueness
 			
@@ -82,56 +91,66 @@ sub create_featurecomponent_table_from_f
 	}			
 }
 
-#################################################################################
-# Collecting all pairs of features and components from the registry collector
-#################################################################################
 
-sub create_featurecomponent_table_from_registry_collector
+
+
+=head2 create_featurecomponent_table_from_registry_collector ($featurecomponenttableref, $registryref)
+
+    Add entries for the FeatureComponent table for components that contain registry entries.
+
+=cut
+sub create_featurecomponent_table_from_registry_collector ($$)
 {
 	my ($featurecomponenttableref, $registryref) = @_;
 
-	for ( my $i = 0; $i <= $#{$registryref}; $i++ )
+    my $replacement_count = 0;
+    my $unique_count = 0;
+	foreach my $oneregistry (@$registryref)
 	{
-		my $oneregistry = ${$registryref}[$i];
-		
-		my $registrycomponent = $oneregistry->{'componentname'};
-		my $registrymodule = $oneregistry->{'ModuleID'};
-
-		if ( $registrycomponent eq "" ) 
+		my $component_name = $oneregistry->{'componentname'};
+		if ($component_name eq "") 
 		{
-			installer::exiter::exit_program("ERROR: No component defined for registry $oneregistry->{'gid'}", "create_featurecomponent_table_from_registry_collector");
+			installer::exiter::exit_program(
+                sprintf("ERROR: No component defined for registry %s", $oneregistry->{'gid'}),
+                "create_featurecomponent_table_from_registry_collector");
 		}
-		if ( $registrymodule eq "" ) 
+
+		my $feature_name = $oneregistry->{'ModuleID'};
+		if ($feature_name eq "") 
 		{
-			installer::exiter::exit_program("ERROR: No modules found for registry $oneregistry->{'gid'}", "create_featurecomponent_table_from_registry_collector");
+			installer::exiter::exit_program(
+                sprintf("ERROR: No modules found for registry %s", $oneregistry->{'gid'}),
+                "create_featurecomponent_table_from_registry_collector");
 		}
 
-		my %featurecomponent = ();
-			
-		$featurecomponent{'Feature'} = $registrymodule;
-		$featurecomponent{'Component'} = $registrycomponent;
-		
 		# Attention: Features are renamed, because the maximum length is 38.
 		# But in the files collector ($filesref), the original names are saved.
 
-		installer::windows::idtglobal::shorten_feature_gid(\$featurecomponent{'Feature'});
-			
-		$oneline = "$featurecomponent{'Feature'}\t$featurecomponent{'Component'}\n";
-			
-		# control of uniqueness
-			
-		if (! installer::existence::exists_in_array($oneline, $featurecomponenttableref))
+		$feature_name = installer::windows::idtglobal::create_shortend_feature_gid($feature_name);
+
+        my $oneline = sprintf("%s\t%s\n", $feature_name, $component_name);
+		if ( ! installer::existence::exists_in_array($oneline, $featurecomponenttableref))
 		{		
-			push(@{$featurecomponenttableref}, $oneline);
-		}			
-	}				
+			push(@$featurecomponenttableref, $oneline);
+            ++$unique_count;
+		}
+        else
+        {
+            $installer::logger::Lang->printf("feature component pair already exists\n");
+        }
+	}
+    $installer::logger::Lang->printf(
+        "replaced %d (%d) of %d component names in FeatureComponent table\n",
+        $unique_count,
+        $replacement_count,
+        scalar @$registryref);
 }
 
 #################################################################################
 # Collecting all feature that are listed in the featurecomponent table.
 #################################################################################
 
-sub collect_all_feature
+sub collect_all_features
 {
 	my ($featurecomponenttable) = @_;
 	
@@ -145,7 +164,10 @@ sub collect_all_feature
 		{
 			my $feature = $1;
 
-			if (! installer::existence::exists_in_array($feature, \@allfeature)) { push(@allfeature, $feature); }			
+			if (! installer::existence::exists_in_array($feature, \@allfeature))
+            {
+                push(@allfeature, $feature);
+            }
 		}
 	}
 	
@@ -165,7 +187,7 @@ sub check_number_of_components_at_featur
 	$installer::logger::Lang->print("\n");
 	$installer::logger::Lang->print("Checking number of components at features. Maximum is 817 (for Win 98 and Win Me)\n");
 
-	my $allfeature = collect_all_feature($featurecomponenttable);
+	my $allfeature = collect_all_features($featurecomponenttable);
 
 	for ( my $i = 0; $i <= $#{$allfeature}; $i++ )
 	{
@@ -196,7 +218,7 @@ sub check_number_of_components_at_featur
 # Feature Component 
 #################################################################################
 
-sub create_featurecomponent_table
+sub create_featurecomponent_table ($$$)
 {
 	my ($filesref, $registryref, $basedir) = @_;
 	
@@ -216,9 +238,13 @@ sub create_featurecomponent_table
 	# At the moment only the files are related to components (and the files know their modules).
 	# The component for each file is written into the files collector $filesinproductlanguageresolvedarrayref
 			
-	create_featurecomponent_table_from_files_collector(\@featurecomponenttable, $filesref);
-
-	create_featurecomponent_table_from_registry_collector(\@featurecomponenttable, $registryref);
+	create_featurecomponent_table_from_files_collector(
+        \@featurecomponenttable,
+        $filesref);
+
+	create_featurecomponent_table_from_registry_collector(
+        \@featurecomponenttable,
+        $registryref);
 
 	# Additional components have to be added here
 

Modified: openoffice/trunk/main/solenv/bin/modules/installer/windows/file.pm
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/solenv/bin/modules/installer/windows/file.pm?rev=1547091&r1=1547090&r2=1547091&view=diff
==============================================================================
--- openoffice/trunk/main/solenv/bin/modules/installer/windows/file.pm (original)
+++ openoffice/trunk/main/solenv/bin/modules/installer/windows/file.pm Mon Dec  2 16:37:27 2013
@@ -47,68 +47,65 @@ sub assign_cab_to_files
 	
 	my $infoline = "";
 
-	for ( my $i = 0; $i <= $#{$filesref}; $i++ )
+	foreach my $file (@$filesref)
 	{
-		if ( ! exists(${$filesref}[$i]->{'modules'}) ) { installer::exiter::exit_program("ERROR: No module assignment found for ${$filesref}[$i]->{'gid'} !", "assign_cab_to_files"); }
-		my $module = ${$filesref}[$i]->{'modules'};
+		if ( ! exists($file->{'modules'}) )
+        {
+            installer::exiter::exit_program(
+                sprintf("ERROR: No module assignment found for %s", $file->{'gid'}),
+                "assign_cab_to_files");
+        }
+		my $module = $file->{'modules'};
 		# If modules contains a list of modules, only taking the first one.
 		if ( $module =~ /^\s*(.*?)\,/ ) { $module = $1; }
 
-		if ( ! exists($installer::globals::allcabinetassigns{$module}) ) { installer::exiter::exit_program("ERROR: No cabinet file assigned to module \"$module\" (${$filesref}[$i]->{'gid'}) !", "assign_cab_to_files"); }
-		${$filesref}[$i]->{'assignedcabinetfile'} = $installer::globals::allcabinetassigns{$module};
+		if ( ! exists($installer::globals::allcabinetassigns{$module}) )
+        {
+            installer::exiter::exit_program(
+                sprintf("ERROR: No cabinet file assigned to module \"%s\" %s",
+                    $module,
+                    $file->{'gid'}),
+                "assign_cab_to_files");
+        }
+		$file->{'assignedcabinetfile'} = $installer::globals::allcabinetassigns{$module};
 
 		# Counting the files in each cabinet file
-		if ( ! exists($installer::globals::cabfilecounter{${$filesref}[$i]->{'assignedcabinetfile'}}) )
+		if ( ! exists($installer::globals::cabfilecounter{$file->{'assignedcabinetfile'}}) )
 		{
-			$installer::globals::cabfilecounter{${$filesref}[$i]->{'assignedcabinetfile'}} = 1;
+			$installer::globals::cabfilecounter{$file->{'assignedcabinetfile'}} = 1;
 		}
 		else
 		{
-			$installer::globals::cabfilecounter{${$filesref}[$i]->{'assignedcabinetfile'}}++;
+			$installer::globals::cabfilecounter{$file->{'assignedcabinetfile'}}++;
 		}
 	}
 
-	# logging the number of files in each cabinet file
-
-	$installer::logger::Lang->print("\n");
-	$installer::logger::Lang->print("Cabinet file content:\n");
-	my $cabfile;
-	foreach $cabfile ( sort keys %installer::globals::cabfilecounter )
-	{
-		$infoline = "$cabfile : $installer::globals::cabfilecounter{$cabfile} files\n";
-		$installer::logger::Lang->print($infoline);
-	}
-	
 	# assigning startsequencenumbers for each cab file
-	
+
+    my %count = ();
 	my $offset = 1;
-	foreach $cabfile ( sort keys %installer::globals::cabfilecounter )
+	foreach my $cabfile ( sort keys %installer::globals::cabfilecounter )
 	{
 		my $filecount = $installer::globals::cabfilecounter{$cabfile};
+        $count{$cabfile} = $filecount;
 		$installer::globals::cabfilecounter{$cabfile} = $offset;
 		$offset = $offset + $filecount;
 		
 		$installer::globals::lastsequence{$cabfile} = $offset - 1;
 	}
-	
-	# logging the start sequence numbers
-
-	$installer::logger::Lang->print("\n");
-	$installer::logger::Lang->print("Cabinet file start sequences:\n");
-	foreach $cabfile ( sort keys %installer::globals::cabfilecounter )
-	{
-		$infoline = "$cabfile : $installer::globals::cabfilecounter{$cabfile}\n";
-		$installer::logger::Lang->print($infoline);
-	}
 
-	# logging the last sequence numbers
+	# logging the number of files in each cabinet file
 
 	$installer::logger::Lang->print("\n");
-	$installer::logger::Lang->print("Cabinet file last sequences:\n");
-	foreach $cabfile ( sort keys %installer::globals::lastsequence )
+	$installer::logger::Lang->print("Cabinet files:\n");
+	foreach my $cabfile (sort keys %installer::globals::cabfilecounter)
 	{
-		$infoline = "$cabfile : $installer::globals::lastsequence{$cabfile}\n";
-		$installer::logger::Lang->print($infoline);
+		$installer::logger::Lang->printf(
+            "%-30s : %4s files, from %4d to %4d\n",
+            $cabfile,
+            $count{$cabfile},
+            $installer::globals::cabfilecounter{$cabfile},
+            $installer::globals::lastsequence{$cabfile});
 	}
 }
 
@@ -123,7 +120,7 @@ sub assign_sequencenumbers_to_files
 	
 	my %directaccess = ();
 	my %allassigns = ();
-	
+
 	for ( my $i = 0; $i <= $#{$filesref}; $i++ )
 	{
 		my $onefile = ${$filesref}[$i];
@@ -161,7 +158,7 @@ sub assign_sequencenumbers_to_files
 		foreach $dest ( sort keys %{$allassigns{$cabfile}} ) # <- sorting the destination!
 		{
 			my $directaccessnumber = $directaccess{$dest};
-			${$filesref}[$directaccessnumber]->{'assignedsequencenumber'} = $counter;			
+            ${$filesref}[$directaccessnumber]->{'assignedsequencenumber'} = $counter;			
 			$counter++;
 		}
 	}
@@ -373,20 +370,8 @@ sub generate_unique_filename_for_filetab
 	my $counter = 0;
 
 	if ( $fileref->{'Name'} ) { $uniquefilename = $fileref->{'Name'}; }
-
-	installer::pathanalyzer::make_absolute_filename_to_relative_filename(\$uniquefilename);	# making /registry/schema/org/openoffice/VCL.xcs to VCL.xcs 
-
-	# Reading unique filename with help of "Component_" in File table from old database	
-	if (( $installer::globals::prepare_winpatch ) && ( exists($installer::globals::savedmapping{"$component/$uniquefilename"}) ))
-	{
-		# If we have a FTK mapping for this component/file, use it.
-		$installer::globals::savedmapping{"$component/$uniquefilename"} =~ m/^(.*);/;
-		$uniquefilename = $1;
- 		$lcuniquefilename = lc($uniquefilename);
-		$installer::globals::alluniquefilenames{$uniquefilename} = 1;
-		$installer::globals::alllcuniquefilenames{$lcuniquefilename} = 1;
-		return $uniquefilename;
-	}
+   	# making /registry/schema/org/openoffice/VCL.xcs to VCL.xcs
+	installer::pathanalyzer::make_absolute_filename_to_relative_filename(\$uniquefilename);
 
 	$uniquefilename =~ s/\-/\_/g;		# no "-" allowed
 	$uniquefilename =~ s/\@/\_/g;		# no "@" allowed
@@ -399,8 +384,7 @@ sub generate_unique_filename_for_filetab
 
 	my $newname = 0;
 
-	if ( ! exists($installer::globals::alllcuniquefilenames{$lcuniquefilename}) &&
-	     ! exists($installer::globals::savedrevmapping{$lcuniquefilename}) )
+	if ( ! exists($installer::globals::alllcuniquefilenames{$lcuniquefilename}))
 	{
 		$installer::globals::alluniquefilenames{$uniquefilename} = 1;
 		$installer::globals::alllcuniquefilenames{$lcuniquefilename} = 1;
@@ -431,8 +415,7 @@ sub generate_unique_filename_for_filetab
 			$newname = 0;
 			$lcuniquefilename = lc($uniquefilename);	# only lowercase names
 
-			if ( ! exists($installer::globals::alllcuniquefilenames{$lcuniquefilename}) &&
-			     ! exists($installer::globals::savedrevmapping{$lcuniquefilename}) )
+			if ( ! exists($installer::globals::alllcuniquefilenames{$lcuniquefilename}))
 			{
 				$installer::globals::alluniquefilenames{$uniquefilename} = 1;
 				$installer::globals::alllcuniquefilenames{$lcuniquefilename} = 1;
@@ -458,31 +441,21 @@ sub generate_filename_for_filetable ($$)
 	my $returnstring = "";
 
 	my $filename = $fileref->{'Name'};	
+
+    # making /registry/schema/org/openoffice/VCL.xcs to VCL.xcs 
+	installer::pathanalyzer::make_absolute_filename_to_relative_filename(\$filename);	
 	
-	installer::pathanalyzer::make_absolute_filename_to_relative_filename(\$filename);	# making /registry/schema/org/openoffice/VCL.xcs to VCL.xcs 
-	
-	my $shortstring;
+	my $shortstring = installer::windows::idtglobal::make_eight_three_conform_with_hash($filename, "file", $shortnamesref);
 	
-	# Reading short string with help of "FileName" in File table from old database	
-	if (( $installer::globals::prepare_winpatch ) && ( exists($installer::globals::savedmapping{"$fileref->{'componentname'}/$filename"}) ))
-	{
-		$installer::globals::savedmapping{"$fileref->{'componentname'}/$filename"} =~ m/.*;(.*)/;
-		if ($1 ne '')
-		{
-			$shortstring = $1;
-		}
-		else
-		{
-			$shortstring = installer::windows::idtglobal::make_eight_three_conform_with_hash($filename, "file", $shortnamesref);
-		}
-	}
+	if ( $shortstring eq $filename )
+    {
+        # nothing changed
+        $returnstring = $filename;
+    }
 	else
-	{
-		$shortstring = installer::windows::idtglobal::make_eight_three_conform_with_hash($filename, "file", $shortnamesref);
-	}
-	
-	if ( $shortstring eq $filename ) { $returnstring = $filename; }	# nothing changed
-	else {$returnstring = $shortstring . "\|" . $filename; }
+    {
+        $returnstring = $shortstring . "\|" . $filename;
+    }
 	
 	return $returnstring;
 }
@@ -524,7 +497,10 @@ sub get_fileversion
 
 	if ( $allvariables->{'USE_FILEVERSION'} )
 	{
-		if ( ! $allvariables->{'LIBRARYVERSION'} ) { installer::exiter::exit_program("ERROR: USE_FILEVERSION is set, but not LIBRARYVERSION", "get_fileversion"); } 
+		if ( ! $allvariables->{'LIBRARYVERSION'} )
+        {
+            installer::exiter::exit_program("ERROR: USE_FILEVERSION is set, but not LIBRARYVERSION", "get_fileversion");
+        } 
 		my $libraryversion = $allvariables->{'LIBRARYVERSION'};
 		if ( $libraryversion =~ /^\s*(\d+)\.(\d+)\.(\d+)\s*$/ )
 		{
@@ -535,18 +511,23 @@ sub get_fileversion
 			$libraryversion = $major . "\." . $concat;
 		}
 		my $vendornumber = 0;
-		if ( $allvariables->{'VENDORPATCHVERSION'} ) { $vendornumber = $allvariables->{'VENDORPATCHVERSION'}; }
+		if ( $allvariables->{'VENDORPATCHVERSION'} )
+        {
+            $vendornumber = $allvariables->{'VENDORPATCHVERSION'};
+        }
 		$fileversion = $libraryversion . "\." . $installer::globals::buildid . "\." . $vendornumber;
-		if ( $onefile->{'FileVersion'} ) { $fileversion = $onefile->{'FileVersion'}; } # overriding FileVersion in scp
-
-		# if ( $styles =~ /\bFONT\b/ )
-		# {
-		#	my $newfileversion = installer::windows::font::get_font_version($onefile->{'sourcepath'});
-		#	if ( $newfileversion != 0 ) { $fileversion = $newfileversion; }
-		# }
+		if ( $onefile->{'FileVersion'} )
+        {
+            # overriding FileVersion in scp
+            $fileversion = $onefile->{'FileVersion'};
+        }
 	}
 	
-	if ( $installer::globals::prepare_winpatch ) { $fileversion = ""; } # Windows patches do not allow this version # -> who says so?
+	if ( $installer::globals::prepare_winpatch )
+    {
+        # Windows patches do not allow this version # -> who says so?
+        $fileversion = "";
+    }
 		
 	return $fileversion;
 }

Modified: openoffice/trunk/main/solenv/bin/modules/installer/windows/idtglobal.pm
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/solenv/bin/modules/installer/windows/idtglobal.pm?rev=1547091&r1=1547090&r2=1547091&view=diff
==============================================================================
--- openoffice/trunk/main/solenv/bin/modules/installer/windows/idtglobal.pm (original)
+++ openoffice/trunk/main/solenv/bin/modules/installer/windows/idtglobal.pm Mon Dec  2 16:37:27 2013
@@ -56,6 +56,19 @@ sub shorten_feature_gid
 	$$stringref =~ s/_Replacement_/_rpl_/;
 }
 
+=head2 create_shortend_feature_gid ($feature_name)
+    
+    This is a side effect free version of shorten_feature_gid.
+    The shortened feature name is returned instead of overwriting the given name.
+    
+=cut
+sub create_shortend_feature_gid ($)
+{
+    my ($feature_name) = @_;
+    shorten_feature_gid(\$feature_name);
+    return $feature_name;
+}
+
 ############################################
 # Getting the next free number, that
 # can be added.

Modified: openoffice/trunk/main/solenv/bin/modules/installer/windows/inifile.pm
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/solenv/bin/modules/installer/windows/inifile.pm?rev=1547091&r1=1547090&r2=1547091&view=diff
==============================================================================
--- openoffice/trunk/main/solenv/bin/modules/installer/windows/inifile.pm (original)
+++ openoffice/trunk/main/solenv/bin/modules/installer/windows/inifile.pm Mon Dec  2 16:37:27 2013
@@ -28,6 +28,8 @@ use installer::files;
 use installer::globals;
 use installer::windows::idtglobal;
 
+use strict;
+
 ####################################################
 # Setting the profile for a special profileitem
 ####################################################
@@ -66,21 +68,18 @@ sub file_is_part_of_product
 {
 	my ($profilegid, $filesref) = @_;
 	
-	my $part_of_product = 0;
-
-	for ( my $i = 0; $i <= $#{$filesref}; $i++ )
+	foreach my $file (@$filesref)
 	{
-		$onefile = ${$filesref}[$i];
-		my $filegid = $onefile->{'gid'};
+		my $filegid = $file->{'gid'};
+        next unless defined $filegid;
 
 		if ( $filegid eq $profilegid )
 		{
-			$part_of_product = 1;
-			last;	
+			return 1;	
 		}
 	}
 	
-	return $part_of_product;
+	return 0;
 }
 
 ###########################################################################################################

Modified: openoffice/trunk/main/solenv/bin/modules/installer/windows/msiglobal.pm
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/solenv/bin/modules/installer/windows/msiglobal.pm?rev=1547091&r1=1547090&r2=1547091&view=diff
==============================================================================
--- openoffice/trunk/main/solenv/bin/modules/installer/windows/msiglobal.pm (original)
+++ openoffice/trunk/main/solenv/bin/modules/installer/windows/msiglobal.pm Mon Dec  2 16:37:27 2013
@@ -37,6 +37,7 @@ use installer::systemactions;
 use installer::worker;
 use installer::windows::idtglobal;
 use installer::windows::language;
+use strict;
 
 ###########################################################################
 # Generating the header of the ddf file.
@@ -332,65 +333,6 @@ sub get_file_sequence
 	return $sequence;
 }
 
-########################################################################
-# For update and patch reasons the pack order needs to be saved.
-# The pack order is saved in the ddf files; the names and locations
-# of the ddf files are saved in @installer::globals::allddffiles.
-# The outputfile "packorder.txt" can be saved in
-# $installer::globals::infodirectory . 
-########################################################################
-
-sub save_packorder
-{
-	installer::logger::include_header_into_logfile("Saving pack order");
-
-	$installer::logger::Lang->add_timestamp("Performance Info: saving pack order start");
-
-	my $packorderfilename = "packorder.txt";
-	$packorderfilename = $installer::globals::infodirectory . $installer::globals::separator . $packorderfilename;
-
-	my @packorder = ();
-	
-	my $headerline = "\# Syntax\: Filetable_Sequence Cabinetfilename Physical_FileName Unique_FileName\n\n"; 
-	push(@packorder, $headerline);
-	
-	for ( my $i = 0; $i <= $#installer::globals::allddffiles; $i++ )
-	{
-		my $ddffilename = $installer::globals::allddffiles[$i];
-		my $ddffile = installer::files::read_file($ddffilename);
-		my $cabinetfile = "";
-
-		for ( my $j = 0; $j <= $#{$ddffile}; $j++ )
-		{
-			my $oneline = ${$ddffile}[$j];
-			
-			# Getting the Cabinet file name
-			
-			if ( $oneline =~ /^\s*\.Set\s+CabinetName.*\=(.*?)\s*$/ ) { $cabinetfile = $1; }
-			if ( $oneline =~ /^\s*\.Set\s+/ ) { next; } 
-			
-			if ( $oneline =~ /^\s*\"(.*?)\"\s+(.*?)\s*$/ )
-			{
-				my $sourcefile = $1;
-				my $uniquefilename = $2;
-				
-				installer::pathanalyzer::make_absolute_filename_to_relative_filename(\$sourcefile);
-				
-				# Using the hash created in create_files_table for performance reasons to get the sequence number
-				my $filesequence = "";
-				if ( exists($installer::globals::uniquefilenamesequence{$uniquefilename}) ) { $filesequence = $installer::globals::uniquefilenamesequence{$uniquefilename}; }
-				else { installer::exiter::exit_program("ERROR: No sequence number value for $uniquefilename !", "save_packorder"); }
-				
-				my $line = $filesequence . "\t" . $cabinetfile . "\t" . $sourcefile . "\t" . $uniquefilename . "\n";
-				push(@packorder, $line);
-			}
-		}
-	}
-	
-	installer::files::save_file($packorderfilename ,\@packorder);
-
-	$installer::logger::Lang->add_timestamp("Performance Info: saving pack order end");
-}
 
 #################################################################
 # Returning the name of the msi database
@@ -1087,8 +1029,7 @@ sub create_setup_ini
 
 	installer::files::save_file($setupinifilename, $setupinifile);	
 
-	$infoline = "Generated file $setupinifilename !\n";
-	$installer::logger::Lang->print($infoline);
+	$installer::logger::Lang->printf("Generated file %s\n", $setupinifilename);
 }
 
 #################################################################
@@ -1133,7 +1074,7 @@ sub copy_windows_installer_files_into_in
 
     installer::logger::include_header_into_logfile("Copying Windows installer files into installation set");
 	
-	@copyfile = ();
+	my @copyfile = ();
 	push(@copyfile, "loader2.exe");
 	
 	if ( $allvariables->{'NOLOADERREQUIRED'} ) { @copyfile = (); }
@@ -1489,7 +1430,7 @@ sub prepare_64bit_database
 			if ( -f $fullfilename )
 			{
 				my $saving_required = 0;
-				$filecontent = installer::files::read_file($fullfilename);		
+				my $filecontent = installer::files::read_file($fullfilename);		
 
 				for ( my $i = 3; $i <= $#{$filecontent}; $i++ ) 	# ignoring the first three lines
 				{
@@ -1766,8 +1707,8 @@ sub set_global_code_variables ($$)
 	{ 
 		# UpgradeCode can take english as default, if not defined in specified language
 
-		$searchstring = "UPGRADECODE";	# searching in the codes.txt file
-		$codeblock = installer::windows::idtglobal::get_language_block_from_language_file($searchstring, $codefile);
+		my $searchstring = "UPGRADECODE";	# searching in the codes.txt file
+		my $codeblock = installer::windows::idtglobal::get_language_block_from_language_file($searchstring, $codefile);
 		$installer::globals::upgradecode = installer::windows::idtglobal::get_language_string_from_language_block($codeblock, $onelanguage, "");
 	}
 	
@@ -1948,167 +1889,6 @@ sub update_removere_table
 	}
 }
 
-##########################################################################
-# Reading saved mappings in Files.idt and Director.idt.
-# This is required, if installation sets shall be created,
-# that can be used for creation of msp files.
-##########################################################################
-
-sub read_saved_mappings
-{
-	installer::logger::include_header_into_logfile("Reading saved mappings from older installation sets:");
-
-	$installer::logger::Lang->add_timestamp("Performance Info: Reading saved mappings start");
-	
-	if ( $installer::globals::previous_idt_dir )
-	{
-		my @errorlines = ();
-		my $errorstring = "";
-		my $error_occured = 0;
-		my $file_error_occured = 0;
-		my $dir_error = 0;
-		
-		my $idtdir = $installer::globals::previous_idt_dir;
-		$idtdir =~ s/\Q$installer::globals::separator\E\s*$//;
-
-		# Reading File.idt
-
-		my $idtfile = $idtdir . $installer::globals::separator . "File.idt";
-        $installer::logger::Global->print("\n");
-        $installer::logger::Global->printf("Analyzing file: %s\n", $idtfile);
-		if ( ! -f $idtfile )
-        {
-            $installer::logger::Global->printf("Warning: File %s does not exist!\n", $idtfile);
-        }
-		
-		my $n = 0;
-		open (F, "<$idtfile") || installer::exiter::exit_program("ERROR: Cannot open file $idtfile for reading", "read_saved_mappings");
-		<F>; <F>; <F>;
-		while (<F>)
-		{
-			m/^([^\t]+)\t([^\t]+)\t((.*)\|)?([^\t]*)/;
-			print "OUT1: \$1: $1, \$2: $2, \$3: $3, \$4: $4, \$5: $5\n";
-			next if ("$1" eq "$5") && (!defined($3));
-			my $lc1 = lc($1);
-			
-			if ( exists($installer::globals::savedmapping{"$2/$5"}))
-			{
-				if ( ! $file_error_occured )
-				{
-					$errorstring = "\nErrors in $idtfile: \n";
-					push(@errorlines, $errorstring);
-				}
-				$errorstring = "Duplicate savedmapping{" . "$2/$5}\n";
-				push(@errorlines, $errorstring);
-				$error_occured = 1;
-				$file_error_occured = 1;
-			}
-			
-			if ( exists($installer::globals::savedrevmapping{$lc1}))
-			{
-				if ( ! $file_error_occured )
-				{
-					$errorstring = "\nErrors in $idtfile: \n";
-					push(@errorlines, $errorstring);
-				}
-				$errorstring = "Duplicate savedrevmapping{" . "$lc1}\n";
-				push(@errorlines, $errorstring);
-				$error_occured = 1;
-				$file_error_occured = 1;
-			}
-			
-			my $shortname = $4 || '';
-
-			# Don't reuse illegal 8.3 mappings that we used to generate in 2.0.4
-			if (index($shortname, '.') > 8 ||
-			    (index($shortname, '.') == -1 && length($shortname) > 8))
-			{
-			    $shortname = '';
-			}
-
-			if (( $shortname ne '' ) && ( index($shortname, '~') > 0 ) && ( exists($installer::globals::savedrev83mapping{$shortname}) ))
-			{
-				if ( ! $file_error_occured )
-				{
-					$errorstring = "\nErrors in $idtfile: \n";
-					push(@errorlines, $errorstring);
-				}
-				$errorstring = "Duplicate savedrev83mapping{" . "$shortname}\n";
-				push(@errorlines, $errorstring);
-				$error_occured = 1;
-				$file_error_occured = 1;
-			}
-
-			$installer::globals::savedmapping{"$2/$5"} = "$1;$shortname";
-			$installer::globals::savedrevmapping{lc($1)} = "$2/$5";
-			$installer::globals::savedrev83mapping{$shortname} = "$2/$5" if $shortname ne '';
-			$n++;
-		}
-
-		close (F);
-
-        $installer::logger::Global->printf("Read %s old file table key or 8.3 name mappings from %s\n",
-            $n, $idtfile);
-
-		# Reading Director.idt
-		
-		$idtfile = $idtdir . $installer::globals::separator . "Director.idt";
-        $installer::logger::Global->print("\n");
-        $installer::logger::Global->printf("Analyzing file %s\n", $idtfile);
-		if ( ! -f $idtfile )
-        {
-            $installer::logger::Global->printf("Warning: File %s does not exist!\n", $idtfile);
-        }
-
-		$n = 0;
-		open (F, "<$idtfile") || installer::exiter::exit_program("ERROR: Cannot open file $idtfile for reading", "read_saved_mappings");
-		<F>; <F>; <F>;
-		while (<F>)
-		{
-			m/^([^\t]+)\t([^\t]+)\t(([^~]+~\d.*)\|)?([^\t]*)/;
-			next if (!defined($3));
-			my $lc1 = lc($1);
-
-			print "OUT2: \$1: $1, \$2: $2, \$3: $3\n";
-
-			if ( exists($installer::globals::saved83dirmapping{$1}) )
-			{
-				if ( ! $dir_error_occured )
-				{
-					$errorstring = "\nErrors in $idtfile: \n";
-					push(@errorlines, $errorstring);
-				}
-				$errorstring = "Duplicate saved83dirmapping{" . "$1}\n";
-				push(@errorlines, $errorstring);
-				$error_occured = 1;
-				$dir_error_occured = 1;
-			}
-
-			$installer::globals::saved83dirmapping{$1} = $4;
-			$n++;
-		}
-		close (F);
-
-        $installer::logger::Global->printf("Read %s old directory 8.3 name mappings from %s\n",
-            $n, $idtfile);
-
-		# Analyzing errors
-		
-		if ( $error_occured )
-		{
-			for my $line (@errorlines)
-			{
-                $installer::logger::Info->print($line);
-                $installer::logger::Global->print($line);
-			}
-			installer::exiter::exit_program("ERROR: Duplicate entries in saved mappings!", "read_saved_mappings");			
-		}
-	} else {
-		installer::exiter::exit_program("ERROR: Windows patch shall be prepared, but environment variable PREVIOUS_IDT_DIR is not set!", "read_saved_mappings");			
-	}
-
-	$installer::logger::Lang->add_timestamp("Performance Info: Reading saved mappings end");
-}
 
 1;
 

Modified: openoffice/trunk/main/solenv/bin/modules/installer/windows/registry.pm
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/solenv/bin/modules/installer/windows/registry.pm?rev=1547091&r1=1547090&r2=1547091&view=diff
==============================================================================
--- openoffice/trunk/main/solenv/bin/modules/installer/windows/registry.pm (original)
+++ openoffice/trunk/main/solenv/bin/modules/installer/windows/registry.pm Mon Dec  2 16:37:27 2013
@@ -350,25 +350,24 @@ sub create_registry_table
 {
 	my ($registryref, $allregistrycomponentsref, $basedir, $languagesarrayref, $allvariableshashref) = @_;
 
-	for ( my $m = 0; $m <= $#{$languagesarrayref}; $m++ )
+    my %table_data = ();
+	foreach my $onelanguage (@$languagesarrayref)
 	{
-		my $onelanguage = ${$languagesarrayref}[$m];
 
 		my @registrytable = ();
 		my @reg64table = ();
 	
 		installer::windows::idtglobal::write_idt_header(\@registrytable, "registry");
 		installer::windows::idtglobal::write_idt_header(\@reg64table, "reg64");
-
-		for ( my $i = 0; $i <= $#{$registryref}; $i++ )
+        my $table_items = [];
+		foreach my $oneregistry (@$registryref)
 		{
-			my $oneregistry = ${$registryref}[$i];
-
 			# Controlling the language!
 			# Only language independent folderitems or folderitems with the correct language 
 			# will be included into the table
 			
-			if (! (!(( $oneregistry->{'ismultilingual'} )) || ( $oneregistry->{'specificlanguage'} eq $onelanguage )) )  { next; }
+			next if $oneregistry->{'ismultilingual'}
+                && $oneregistry->{'specificlanguage'} ne $onelanguage;
 
 			my %registry = ();
 
@@ -378,7 +377,9 @@ sub create_registry_table
 			$registry{'Name'} = get_registry_name($oneregistry, $allvariableshashref);
 			$registry{'Value'} = get_registry_value($oneregistry, $allvariableshashref);
 			$registry{'Val64'} = get_registry_val64($oneregistry, $allvariableshashref);
-			$registry{'Component_'} = get_registry_component($oneregistry, $allvariableshashref);	
+            my $component_name = get_registry_component_name($oneregistry, $allvariableshashref);
+            $oneregistry->{'componentname'} = $component_name;
+			$registry{'Component_'} = $component_name;
 	
 			# Collecting all components
 			if (!(installer::existence::exists_in_array($registry{'Component_'}, $allregistrycomponentsref))) 
@@ -387,12 +388,19 @@ sub create_registry_table
 			}
 
 			# Collecting all components with DONT_DELETE style
-			my $style = "";
-			if ( $oneregistry->{'Styles'} ) { $style = $oneregistry->{'Styles'}; }
-			if ( $style =~ /\bDONT_DELETE\b/ ) { $installer::globals::dontdeletecomponents{$registry{'Component_'}} = 1; }
+			my $style = $oneregistry->{'Styles'} // "";
+            $registry{'styles'} = $style;
+
+			if ( $style =~ /\bDONT_DELETE\b/ )
+            {
+                $installer::globals::dontdeletecomponents{$component_name} = 1;
+            }
 
 			# Saving upgradekey to write this into setup.ini for minor upgrades
-			if ( $style =~ /\bUPGRADEKEY\b/ ) { $installer::globals::minorupgradekey = $registry{'Key'}; }
+			if ( $style =~ /\bUPGRADEKEY\b/ )
+            {
+                $installer::globals::minorupgradekey = $registry{'Key'};
+            }
 
 			# Collecting all registry components with ALWAYS_REQUIRED style
 			if ( ! ( $style =~ /\bALWAYS_REQUIRED\b/ ))

Modified: openoffice/trunk/main/solenv/bin/modules/installer/worker.pm
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/solenv/bin/modules/installer/worker.pm?rev=1547091&r1=1547090&r2=1547091&view=diff
==============================================================================
--- openoffice/trunk/main/solenv/bin/modules/installer/worker.pm (original)
+++ openoffice/trunk/main/solenv/bin/modules/installer/worker.pm Mon Dec  2 16:37:27 2013
@@ -733,11 +733,11 @@ sub remove_all_items_with_special_flag
 		if ( $oneitem->{'Styles'} ) { $styles = $oneitem->{'Styles'} };
 		if ( $styles =~ /\b$flag\b/ )
 		{
-			$installer::logger::Lang->printf("Attention: Removing from collector: %s\n", $oneitem->{'Name'});
-			if ($flag eq "BINARYTABLE_ONLY")
-            {
-                push(@installer::globals::binarytableonlyfiles, $oneitem);
-            }
+			$installer::logger::Lang->printf(
+                "Attention: Removing from collector '%s' because it has flag %s\n",
+                $oneitem->{'Name'},
+                $flag);
+			if ( $flag eq "BINARYTABLE_ONLY" ) { push(@installer::globals::binarytableonlyfiles, $oneitem); }
 			next;
 		}
 		push( @allitems, $oneitem );
@@ -2712,10 +2712,10 @@ sub generate_cygwin_pathes
 
 	for ( my $i = 0; $i <= $#{$filesref}; $i++ )
 	{
-		my $filename = ${$filesref}[$i]->{'sourcepath'};
-		push(@pathcollector, $filename  . "\n");
+        my $filename = ${$filesref}[$i]->{'sourcepath'};
+		push(@pathcollector, $filename . "\n");
 		$counter++;
-		
+
 		if (( $i == $#{$filesref} ) || ((( $counter % $max ) == 0 ) && ( $i > 0 )))
 		{
 			my $tmpfilename = "cygwinhelper_" . $i . ".txt";
@@ -2741,12 +2741,9 @@ sub generate_cygwin_pathes
 		
 			if ($success)
 			{
-                $installer::logger::Lang->printf(
+				$installer::logger::Lang->printf(
                     "Successfully converted %d paths to cygwin notation\n",
                     $counter);
-                $installer::logger::Lang->printf(
-                    "there where %d unique paths\n",
-                    scalar keys %paths);
 			}
 			else
 			{



Mime
View raw message