[Libreoffice-commits] core.git: Branch 'aoo/trunk' - 2 commits - solenv/bin
Andre Fischer
af at apache.org
Fri Nov 22 02:08:05 PST 2013
solenv/bin/make_installer.pl | 92 ++++++++-------
solenv/bin/modules/installer/globals.pm | 5
solenv/bin/modules/installer/scriptitems.pm | 6
solenv/bin/modules/installer/windows/directory.pm | 1
solenv/bin/modules/installer/windows/property.pm | 12 -
solenv/bin/modules/installer/ziplist.pm | 134 +++++++++++++++++++++-
6 files changed, 182 insertions(+), 68 deletions(-)
New commits:
commit 7bb645484e11308be6c6de5b5de7079cd532a662
Author: Andre Fischer <af at apache.org>
Date: Fri Nov 22 09:36:12 2013 +0000
123729: Factored out reading of openoffice.lst to its own function.
diff --git a/solenv/bin/make_installer.pl b/solenv/bin/make_installer.pl
index 400949c..463f2d4f9 100644
--- a/solenv/bin/make_installer.pl
+++ b/solenv/bin/make_installer.pl
@@ -87,6 +87,58 @@ use installer::worker;
use installer::xpdinstaller;
use installer::ziplist;
+use strict;
+
+sub GetSetupScriptLines ($$$)
+{
+ my ($allsettingsarrayref, $allvariableshashref, $includepatharrayref) = @_;
+
+ if ($installer::globals::setupscript_defined_in_productlist)
+ {
+ installer::setupscript::set_setupscript_name($allsettingsarrayref, $includepatharrayref);
+ }
+
+ $installer::logger::Info->print( "... analyzing script: $installer::globals::setupscriptname ... \n" );
+ installer::logger::globallog("setup script file: $installer::globals::setupscriptname");
+ $installer::logger::Info->print( "... analyzing script: $installer::globals::setupscriptname ... \n" );
+
+ # Reading the setup script file
+ my $setupscriptref = installer::files::read_file($installer::globals::setupscriptname);
+
+ # Resolving variables defined in the zip list file into setup
+ # script. All the variables are defined in $allvariablesarrayref
+ installer::scpzipfiles::replace_all_ziplistvariables_in_file($setupscriptref, $allvariableshashref);
+
+ # Resolving %variables defined in the installation object
+ my $allscriptvariablesref = installer::setupscript::get_all_scriptvariables_from_installation_object(
+ $setupscriptref,
+ $installer::globals::setupscriptname);
+ installer::setupscript::add_lowercase_productname_setupscriptvariable($allscriptvariablesref);
+ installer::setupscript::resolve_lowercase_productname_setupscriptvariable($allscriptvariablesref);
+
+ $setupscriptref = installer::setupscript::replace_all_setupscriptvariables_in_script(
+ $setupscriptref,
+ $allscriptvariablesref);
+
+ # Adding all variables defined in the installation object into the
+ # hash of all variables. This is needed if variables are defined
+ # in the installation object, but not in the zip list file. If
+ # there is a definition in the zip list file and in the
+ # installation object, the installation object is more important
+ installer::setupscript::add_installationobject_to_variables($allvariableshashref, $allscriptvariablesref);
+
+ # Adding also all variables, that must be included into the $allvariableshashref.
+ installer::setupscript::add_forced_properties($allvariableshashref);
+
+ # Replacing preset properties, not using the default mechanisms (for example for UNIXPRODUCTNAME)
+ installer::setupscript::replace_preset_properties($allvariableshashref);
+
+ # We did this already. Can this or the other one be removed.
+ installer::scpzipfiles::replace_all_ziplistvariables_in_file($setupscriptref, $allvariableshashref);
+
+ return $setupscriptref;
+}
+
#################################################
# Main program
#################################################
@@ -334,43 +386,7 @@ installer::control::check_java_for_xpd($allvariableshashref);
# Analyzing the setup script
#####################################
-if ($installer::globals::setupscript_defined_in_productlist) { installer::setupscript::set_setupscript_name($allsettingsarrayref, $includepatharrayref); }
-
-installer::logger::globallog("setup script file: $installer::globals::setupscriptname");
-
-$installer::logger::Info->print( "... analyzing script: $installer::globals::setupscriptname ... \n" );
-
-my $setupscriptref = installer::files::read_file($installer::globals::setupscriptname); # Reading the setup script file
-
-# Resolving variables defined in the zip list file into setup script
-# All the variables are defined in $allvariablesarrayref
-
-installer::scpzipfiles::replace_all_ziplistvariables_in_file($setupscriptref, $allvariableshashref);
-
-# Resolving %variables defined in the installation object
-
-my $allscriptvariablesref = installer::setupscript::get_all_scriptvariables_from_installation_object($setupscriptref);
-
-installer::setupscript::add_lowercase_productname_setupscriptvariable($allscriptvariablesref);
-
-installer::setupscript::resolve_lowercase_productname_setupscriptvariable($allscriptvariablesref);
-
-$setupscriptref = installer::setupscript::replace_all_setupscriptvariables_in_script($setupscriptref, $allscriptvariablesref);
-
-# Adding all variables defined in the installation object into the hash of all variables.
-# This is needed if variables are defined in the installation object, but not in the zip list file.
-# If there is a definition in the zip list file and in the installation object, the installation object is more important
-
-installer::setupscript::add_installationobject_to_variables($allvariableshashref, $allscriptvariablesref);
-
-# Adding also all variables, that must be included into the $allvariableshashref.
-installer::setupscript::add_forced_properties($allvariableshashref);
-
-# Replacing preset properties, not using the default mechanisms (for example for UNIXPRODUCTNAME)
-installer::setupscript::replace_preset_properties($allvariableshashref);
-
-installer::scpzipfiles::replace_all_ziplistvariables_in_file($setupscriptref, $allvariableshashref);
-
+my $setupscriptref = GetSetupScriptLines($allsettingsarrayref, $allvariableshashref, $includepatharrayref);
installer::logger::log_hashref($allvariableshashref);
@@ -656,7 +672,7 @@ for (;1;last)
# Resolving include paths (language dependent)
################################################
- $includepatharrayref_lang = installer::ziplist::replace_languages_in_pathes($includepatharrayref, $languagesarrayref);
+ my $includepatharrayref_lang = installer::ziplist::replace_languages_in_pathes($includepatharrayref, $languagesarrayref);
if ( $installer::globals::refresh_includepathes ) { installer::worker::collect_all_files_from_includepathes($includepatharrayref_lang); }
diff --git a/solenv/bin/modules/installer/ziplist.pm b/solenv/bin/modules/installer/ziplist.pm
index 6673c32..7c66cdd 100644
--- a/solenv/bin/modules/installer/ziplist.pm
+++ b/solenv/bin/modules/installer/ziplist.pm
@@ -30,6 +30,121 @@ use installer::logger;
use installer::parameter;
use installer::remover;
use installer::systemactions;
+use strict;
+
+=head2 read_openoffice_lst_file (#loggingdir)
+ Read the settings and variables from the settings file (typically 'openoffice.lst').
+=cut
+sub read_openoffice_lst_file ($$;$)
+{
+ my ($filename, $product_name, $loggingdir) = @_;
+
+ # Read all lines from the settings file.
+ my $ziplistref = installer::files::read_file($filename);
+
+ # Extract the lines of the settings block for the current product.
+ my ($productblockref, $parent) = installer::ziplist::getproductblock(
+ $ziplistref, $product_name, 1);
+ my ($settingsblockref, undef) = installer::ziplist::getproductblock($productblockref, "Settings", 0);
+ $settingsblockref = installer::ziplist::analyze_settings_block($settingsblockref);
+
+ # Split into settings and variables.
+ my $allsettingsarrayref = installer::ziplist::get_settings_from_ziplist($settingsblockref);
+ my $allvariablesarrayref = installer::ziplist::get_variables_from_ziplist($settingsblockref);
+
+ # global product block from zip.lst
+ my ($globalproductblockref, undef) = installer::ziplist::getproductblock(
+ $ziplistref, $installer::globals::globalblock, 0);
+
+ if ($installer::globals::globallogging && defined $loggingdir)
+ {
+ installer::files::save_file($loggingdir . "productblock.log", $productblockref);
+ installer::files::save_file($loggingdir . "settingsblock.log", $settingsblockref);
+ installer::files::save_file($loggingdir . "allsettings1.log", $allsettingsarrayref);
+ installer::files::save_file($loggingdir . "allvariables1.log", $allvariablesarrayref);
+ installer::files::save_file($loggingdir . "globalproductblock.log", $globalproductblockref);
+ }
+
+ # Integrate parent values.
+ while (defined $parent)
+ {
+ 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);
+ if (scalar @$allparentsettingsarrayref > 0)
+ {
+ $allsettingsarrayref = installer::converter::combine_arrays_from_references_first_win(
+ $allsettingsarrayref,
+ $allparentsettingsarrayref)
+ }
+ if (scalar @$allparentvariablesarrayref)
+ {
+ $allvariablesarrayref = installer::converter::combine_arrays_from_references_first_win(
+ $allvariablesarrayref,
+ $allparentvariablesarrayref)
+ }
+ }
+
+ # Integrate global values.
+ if (scalar @$globalproductblockref)
+ {
+ # settings block from zip.lst
+ my ($globalsettingsblockref, undef) = installer::ziplist::getproductblock(
+ $globalproductblockref, "Settings", 0);
+
+ # select data from settings block in zip.lst
+ $globalsettingsblockref = installer::ziplist::analyze_settings_block($globalsettingsblockref);
+
+ my $allglobalsettingsarrayref = installer::ziplist::get_settings_from_ziplist($globalsettingsblockref);
+ my $allglobalvariablesarrayref = installer::ziplist::get_variables_from_ziplist($globalsettingsblockref);
+
+ if ($installer::globals::globallogging && defined $loggingdir)
+ {
+ installer::files::save_file($loggingdir . "globalsettingsblock1.log", $globalsettingsblockref);
+ installer::files::save_file($loggingdir . "globalsettingsblock2.log", $globalsettingsblockref);
+ installer::files::save_file($loggingdir . "allglobalsettings1.log", $allglobalsettingsarrayref);
+ installer::files::save_file($loggingdir . "allglobalvariables1.log", $allglobalvariablesarrayref);
+ }
+
+ if (scalar @$allglobalsettingsarrayref > 0)
+ {
+ $allsettingsarrayref = installer::converter::combine_arrays_from_references_first_win(
+ $allsettingsarrayref, $allglobalsettingsarrayref);
+ }
+ if (scalar @$allglobalvariablesarrayref > 0)
+ {
+ $allvariablesarrayref = installer::converter::combine_arrays_from_references_first_win(
+ $allvariablesarrayref, $allglobalvariablesarrayref);
+ }
+ }
+
+ # Remove multiples (and the trailing ##%##).
+ $allsettingsarrayref = installer::ziplist::remove_multiples_from_ziplist($allsettingsarrayref);
+ $allvariablesarrayref = installer::ziplist::remove_multiples_from_ziplist($allvariablesarrayref);
+ installer::ziplist::replace_variables_in_ziplist_variables($allvariablesarrayref);
+
+ # Transform array into hash.
+ my $allvariableshashref = installer::converter::convert_array_to_hash($allvariablesarrayref);
+
+ # Postprocess the variables.
+ installer::ziplist::set_default_productversion_if_required($allvariableshashref);
+ installer::ziplist::add_variables_to_allvariableshashref($allvariableshashref);
+ installer::ziplist::overwrite_ooovendor($allvariableshashref);
+
+ if ($installer::globals::globallogging && defined $loggingdir)
+ {
+ installer::files::save_file($loggingdir . "allsettings2.log" ,$allsettingsarrayref);
+ installer::files::save_file($loggingdir . "allvariables2.log" ,$allvariablesarrayref);
+ }
+
+ # Eventually we should fix this so that we don't have to return the raw arrays, only the resulting hashes.
+ return ($allvariableshashref, $allsettingsarrayref);
+}
+
#################################################
# Getting data from path file and zip list file
@@ -571,7 +686,7 @@ sub replace_languages_in_pathes
my $language = ${$languagesref}[$j];
$line =~ s/\$\(LANG\)/$language/g;
push(@patharray ,$line);
- $newdir = $line;
+ my $newdir = $line;
$line = $originalline;
installer::remover::remove_leading_and_ending_whitespaces(\$newline);
@@ -627,8 +742,6 @@ sub list_all_files_from_include_path
}
$installer::logger::Lang->print("\n");
-
- return \@filesarray;
}
#####################################################
@@ -780,9 +893,18 @@ sub add_variables_to_allvariableshashref
$variableshashref->{'LCPRODUCTEXTENSION'} = "";
}
- if ( $installer::globals::patch ) { $variableshashref->{'PRODUCTADDON'} = $installer::globals::patchaddon; }
- elsif ( $installer::globals::languagepack ) { $variableshashref->{'PRODUCTADDON'} = $installer::globals::languagepackaddon; }
- else { $variableshashref->{'PRODUCTADDON'} = ""; }
+ if ($installer::globals::patch)
+ {
+ $variableshashref->{'PRODUCTADDON'} = $installer::globals::patchaddon;
+ }
+ elsif ($installer::globals::languagepack)
+ {
+ $variableshashref->{'PRODUCTADDON'} = $installer::globals::languagepackaddon;
+ }
+ else
+ {
+ $variableshashref->{'PRODUCTADDON'} = "";
+ }
my $localbuild = $installer::globals::build;
if ( $localbuild =~ /^\s*(\w+?)(\d+)\s*$/ ) { $localbuild = $2; } # using "680" instead of "src680"
commit 4594d7d4d101dbd0b0ce3debac724fcd82a32ada
Author: Andre Fischer <af at apache.org>
Date: Fri Nov 22 09:28:08 2013 +0000
123729: Removed obsolete references to non-opensource builds.
diff --git a/solenv/bin/modules/installer/globals.pm b/solenv/bin/modules/installer/globals.pm
index de3887e..04d14ea 100644
--- a/solenv/bin/modules/installer/globals.pm
+++ b/solenv/bin/modules/installer/globals.pm
@@ -263,7 +263,6 @@ BEGIN
$isopensourceproduct = 1;
$manufacturer = "";
$longmanufacturer = "";
- $sundirname = "Oracle";
$codefilename = "codes.txt";
$componentfilename = "components.txt";
$productcode = "";
@@ -364,7 +363,6 @@ BEGIN
@pcfdiffcomment = ();
@epmdifflist = ();
$desktoplinkexists = 0;
- $sundirexists = 0;
$analyze_spellcheckerlanguage = 0;
%spellcheckerlanguagehash = ();
%spellcheckerfilehash = ();
@@ -392,11 +390,8 @@ BEGIN
$officedirhostname = "";
$basisdirhostname = "";
$uredirhostname = "";
- $sundirhostname = "";
$officedirgid = "";
$basisdirgid = "";
- $uredirgid = "";
- $sundirgid = "";
%sign_extensions = ("dll" => "1", "exe" => "1", "cab" => "1");
%treestyles = ();
diff --git a/solenv/bin/modules/installer/scriptitems.pm b/solenv/bin/modules/installer/scriptitems.pm
index 585fadf..127bcff 100644
--- a/solenv/bin/modules/installer/scriptitems.pm
+++ b/solenv/bin/modules/installer/scriptitems.pm
@@ -715,12 +715,6 @@ sub set_global_directory_hostnames
$installer::globals::officedirgid = $onedir->{'gid'};
$allvariables->{'OFFICEDIRECTORYHOSTNAME'} = $installer::globals::officedirhostname;
}
- if ( $styles =~ /\bSUNDIRECTORY\b/ )
- {
- $installer::globals::sundirhostname = $onedir->{'HostName'};
- $installer::globals::sundirgid = $onedir->{'gid'};
- $allvariables->{'SUNDIRECTORYHOSTNAME'} = $installer::globals::sundirhostname;
- }
}
}
diff --git a/solenv/bin/modules/installer/windows/directory.pm b/solenv/bin/modules/installer/windows/directory.pm
index e1ee953..5c0368f 100644
--- a/solenv/bin/modules/installer/windows/directory.pm
+++ b/solenv/bin/modules/installer/windows/directory.pm
@@ -269,7 +269,6 @@ sub create_unique_directorynames
if ( $installer::globals::installlocationdirectoryset ) { installer::exiter::exit_program("ERROR: Directory with flag ISINSTALLLOCATION alread set: \"$installer::globals::installlocationdirectory\".", "create_unique_directorynames"); }
$installer::globals::installlocationdirectory = $uniquename;
$installer::globals::installlocationdirectoryset = 1;
- if ( $installer::globals::installlocationdirectory =~ /oracle_/i ) { $installer::globals::sundirexists = 1; }
}
# setting the sundirectory
diff --git a/solenv/bin/modules/installer/windows/property.pm b/solenv/bin/modules/installer/windows/property.pm
index eddce82..e93ad04 100644
--- a/solenv/bin/modules/installer/windows/property.pm
+++ b/solenv/bin/modules/installer/windows/property.pm
@@ -308,12 +308,6 @@ sub set_important_properties
$onepropertyline = "DONTOPTIMIZELIBS" . "\t" . "0" . "\n";
push(@{$propertyfile}, $onepropertyline);
- if ( $installer::globals::sundirexists )
- {
- my $onepropertyline = "SUNDIREXISTS" . "\t" . "1" . "\n";
- push(@{$propertyfile}, $onepropertyline);
- }
-
if ( $installer::globals::officedirhostname )
{
my $onepropertyline = "OFFICEDIRHOSTNAME" . "\t" . $installer::globals::officedirhostname . "\n";
@@ -325,12 +319,6 @@ sub set_important_properties
push(@{$propertyfile}, $onepropertyline);
}
- if ( $installer::globals::sundirhostname )
- {
- my $onepropertyline = "SUNDIRHOSTNAME" . "\t" . $installer::globals::sundirhostname . "\n";
- push(@{$propertyfile}, $onepropertyline);
- }
-
if ( $installer::globals::desktoplinkexists )
{
my $onepropertyline = "DESKTOPLINKEXISTS" . "\t" . "1" . "\n";
More information about the Libreoffice-commits
mailing list