[Libreoffice-commits] core.git: solenv/bin

Thomas Arnhold thomas at arnhold.org
Wed Sep 11 17:51:40 PDT 2013


 solenv/bin/modules/SourceConfig.pm               |   57 ---------
 solenv/bin/modules/installer/converter.pm        |   16 --
 solenv/bin/modules/installer/epmfile.pm          |   56 ---------
 solenv/bin/modules/installer/languages.pm        |   22 ---
 solenv/bin/modules/installer/scriptitems.pm      |   26 ----
 solenv/bin/modules/installer/systemactions.pm    |   32 -----
 solenv/bin/modules/installer/windows/assembly.pm |   58 ---------
 solenv/bin/modules/installer/windows/feature.pm  |   30 ----
 solenv/bin/modules/installer/windows/media.pm    |  140 -----------------------
 solenv/bin/modules/installer/windows/msp.pm      |   14 --
 solenv/bin/modules/installer/worker.pm           |   53 --------
 solenv/bin/modules/packager/files.pm             |   32 -----
 12 files changed, 536 deletions(-)

New commits:
commit 815ed63b51c0aba3b3796dcdd37759d22ba91642
Author: Thomas Arnhold <thomas at arnhold.org>
Date:   Thu Sep 12 02:25:38 2013 +0200

    installer: spring cleaning
    
    some uncalled and unused stuff
    
    Change-Id: I74cc7f58a78befa119102f18560782c5b1ff45fd

diff --git a/solenv/bin/modules/SourceConfig.pm b/solenv/bin/modules/SourceConfig.pm
index 6df85c4..9fad7b0 100755
--- a/solenv/bin/modules/SourceConfig.pm
+++ b/solenv/bin/modules/SourceConfig.pm
@@ -29,8 +29,6 @@ package SourceConfig;
 
 use strict;
 
-use constant SOURCE_CONFIG_VERSION => 3;
-
 use Carp;
 use Cwd;
 use RepositoryHelper;
@@ -66,19 +64,9 @@ sub new {
     $self->{DEBUG} = 0;
     $self->{VERBOSE} = 0;
     $self->{REPOSITORIES} = {};
-    $self->{ACTIVATED_REPOSITORIES} = {};
     $self->{MODULE_PATHS} = {};
-    $self->{MODULE_GBUILDIFIED} = {};
-    $self->{MODULE_BUILD_LIST_PATHS} = {};
     $self->{MODULE_REPOSITORY} = {};
     $self->{REAL_MODULES} = {};
-    $self->{NEW_MODULES} = [];
-    $self->{REMOVE_MODULES} = {};
-    $self->{REMOVE_REPOSITORIES} = {};
-    $self->{NEW_REPOSITORIES} = [];
-    $self->{WARNINGS} = [];
-    $self->{REPORT_MESSAGES} = [];
-    $self->{CONFIG_FILE_CONTENT} = [];
     if (defined $self->{USER_SOURCE_ROOT})
     {
         ${$self->{REPOSITORIES}}{File::Basename::basename($self->{USER_SOURCE_ROOT})} = $self->{USER_SOURCE_ROOT};
@@ -99,10 +87,6 @@ sub new {
 
 ##### methods #####
 
-sub get_version {
-    return SOURCE_CONFIG_VERSION;
-};
-
 sub get_repositories
 {
     my $self        = shift;
@@ -131,36 +115,6 @@ sub get_module_path {
     };
 }
 
-sub get_module_build_list {
-    my $self = shift;
-    my $module = shift;
-    if (defined ${$self->{MODULE_BUILD_LIST_PATHS}}{$module}) {
-        return ${$self->{MODULE_BUILD_LIST_PATHS}}{$module};
-    }
-    else
-    {
-        my $module_path = ${$self->{MODULE_PATHS}}{$module};
-        if ( -e $module_path . "/prj/build.lst")
-        {
-            ${$self->{MODULE_BUILD_LIST_PATHS}}{$module} = $module_path . "/prj/build.lst";
-
-            if (!-e $module_path . "/prj/dmake" )
-            {
-#                print "module $module -> gbuild\n";
-                ${$self->{MODULE_GBUILDIFIED}}{$module} = 1;
-            }
-            else
-            {
-#                print "module $module -> dmake\n";
-                ${$self->{MODULE_GBUILDIFIED}}{$module} = 0;
-            }
-            return $module_path . "/prj/build.lst";
-        };
-        Carp::cluck("No build list in module $module found!!\n") if ($self->{DEBUG});
-        return undef;
-    };
-}
-
 sub get_all_modules
 {
     my $self = shift;
@@ -181,17 +135,6 @@ sub is_active
     return exists ($self->{REAL_MODULES}{$module});
 }
 
-sub is_gbuild
-{
-    my $self        = shift;
-    my $module      = shift;
-    if (defined ${$self->{MODULE_GBUILDIFIED}}{$module})
-    {
-        return ${$self->{MODULE_GBUILDIFIED}}{$module};
-    };
-    return undef;
-}
-
 ##### private methods #####
 
 sub get_repository_module_paths {
diff --git a/solenv/bin/modules/installer/converter.pm b/solenv/bin/modules/installer/converter.pm
index bde7001..f825e04 100644
--- a/solenv/bin/modules/installer/converter.pm
+++ b/solenv/bin/modules/installer/converter.pm
@@ -67,22 +67,6 @@ sub convert_stringlist_into_hash
 }
 
 #############################################################################
-# Converting a string list with separator $listseparator
-# into an array
-#############################################################################
-
-sub convert_whitespace_stringlist_into_array
-{
-    my ( $includestringref ) = @_;
-
-    my $tmp = ${$includestringref};
-    $tmp = s/^\s+//;
-    $tmp = s/\s+$//;
-
-    return [map "$_\n", split /\s+/, $tmp];
-}
-
-#############################################################################
 # Converting an array into a space separated string
 #############################################################################
 
diff --git a/solenv/bin/modules/installer/epmfile.pm b/solenv/bin/modules/installer/epmfile.pm
index 503bd4c..06897fb 100644
--- a/solenv/bin/modules/installer/epmfile.pm
+++ b/solenv/bin/modules/installer/epmfile.pm
@@ -1311,28 +1311,6 @@ sub make_prototypefile_relocatable
 }
 
 #########################################################################
-# Replacing the variables in the Solaris patch shell scripts.
-# Taking care, that multiple slashes are not always removed.
-#########################################################################
-
-sub replace_variables_in_shellscripts_for_patch
-{
-    my ($scriptfile, $scriptfilename, $oldstring, $newstring) = @_;
-
-    for ( my $i = 0; $i <= $#{$scriptfile}; $i++ )
-    {
-        if ( ${$scriptfile}[$i] =~ /\Q$oldstring\E/ )
-        {
-            my $oldline = ${$scriptfile}[$i];
-            if (( $oldstring eq "PRODUCTDIRECTORYNAME" ) && ( $newstring eq "" )) { $oldstring = $oldstring . "/"; }
-            ${$scriptfile}[$i] =~ s/\Q$oldstring\E/$newstring/g;
-            my $infoline = "Info: Substituting in $scriptfilename $oldstring by $newstring\n";
-            push(@installer::globals::logfileinfo, $infoline);
-        }
-    }
-}
-
-#########################################################################
 # Replacing the variables in the shell scripts or in the epm list file
 # Linux: spec file
 # Solaris: preinstall, postinstall, preremove, postremove
@@ -2367,40 +2345,6 @@ sub remove_modules_without_package
 }
 
 ######################################################
-# Unpacking tar.gz file and setting new packagename.
-######################################################
-
-sub unpack_tar_gz_file
-{
-    my ($packagename, $destdir) = @_;
-
-    my $newpackagename = "";
-
-    if ( $packagename =~ /\.tar\.gz\s*$/ )
-    {
-        # Collecting all packages in directory "packages"
-        my $oldcontent = installer::systemactions::read_directory($destdir);
-
-        # unpacking gunzip
-        my $systemcall = "cd $destdir; cat $packagename | gunzip | tar -xf -";
-        installer::systemactions::make_systemcall($systemcall);
-
-        # deleting the tar.gz files
-        $systemcall = "cd $destdir; rm -f $packagename";
-        installer::systemactions::make_systemcall($systemcall);
-
-        # Finding new content -> that is the package name
-        my ($newcontent, $allcontent ) = installer::systemactions::find_new_content_in_directory($destdir, $oldcontent);
-        $newpackagename = ${$newcontent}[0];
-        installer::pathanalyzer::make_absolute_filename_to_relative_filename(\$newpackagename);
-    }
-
-    if ( $newpackagename ne "" ) { $packagename = $newpackagename; }
-
-    return $packagename;
-}
-
-######################################################
 # Copying files for system integration.
 ######################################################
 
diff --git a/solenv/bin/modules/installer/languages.pm b/solenv/bin/modules/installer/languages.pm
index af2be54..0dab49e 100644
--- a/solenv/bin/modules/installer/languages.pm
+++ b/solenv/bin/modules/installer/languages.pm
@@ -76,28 +76,6 @@ sub get_info_about_languages
     analyze_languagelist();
 }
 
-#############################################################################
-# Checking whether all elements of an array A are also member of array B
-#############################################################################
-
-sub all_elements_of_array1_in_array2
-{
-    my ($array1, $array2) = @_;
-
-    my $array2_contains_all_elements_of_array1 = 1;
-
-    for ( my $i = 0; $i <= $#{$array1}; $i++ )
-    {
-        if (! grep {$_ eq ${$array1}[$i]} @{$array2})
-        {
-            $array2_contains_all_elements_of_array1 = 0;
-            last;
-        }
-    }
-
-    return $array2_contains_all_elements_of_array1;
-}
-
 #############################################
 # All languages defined for one product
 #############################################
diff --git a/solenv/bin/modules/installer/scriptitems.pm b/solenv/bin/modules/installer/scriptitems.pm
index 6267638..883888d 100644
--- a/solenv/bin/modules/installer/scriptitems.pm
+++ b/solenv/bin/modules/installer/scriptitems.pm
@@ -1010,32 +1010,6 @@ sub get_sourcepath_from_filename_and_includepath
 }
 
 ##############################################################
-# Determining, whether a specified directory is language
-# dependent
-##############################################################
-
-sub determine_directory_language_dependency
-{
-    my($directorygid, $dirsref) = @_;
-
-    my $is_multilingual = 0;
-
-    for ( my $i = 0; $i <= $#{$dirsref}; $i++ )
-    {
-        my $onedir = ${$dirsref}[$i];
-        my $gid = $onedir->{'gid'};
-
-        if ( $gid eq $directorygid )
-        {
-            $is_multilingual = $onedir->{'ismultilingual'};
-            last;
-        }
-    }
-
-    return $is_multilingual;
-}
-
-##############################################################
 # Getting all source paths for all files to be packed
 # $item can be "Files" or "ScpActions"
 ##############################################################
diff --git a/solenv/bin/modules/installer/systemactions.pm b/solenv/bin/modules/installer/systemactions.pm
index 0a1d227..457d68f 100644
--- a/solenv/bin/modules/installer/systemactions.pm
+++ b/solenv/bin/modules/installer/systemactions.pm
@@ -1181,38 +1181,6 @@ sub remove_complete_directory
 }
 
 ######################################################
-# Creating a unique directory with number extension
-######################################################
-
-sub create_unique_directory
-{
-    my ($directory) = @_;
-
-    $directory =~ s/\Q$installer::globals::separator\E\s*$//;
-    $directory = $directory . "_INCREASINGNUMBER";
-
-    my $counter = 1;
-    my $created = 0;
-    my $localdirectory = "";
-
-    do
-    {
-        $localdirectory = $directory;
-        $localdirectory =~ s/INCREASINGNUMBER/$counter/;
-        $counter++;
-
-        if ( ! -d $localdirectory )
-        {
-            create_directory($localdirectory);
-            $created = 1;
-        }
-    }
-    while ( ! $created );
-
-    return $localdirectory;
-}
-
-######################################################
 # Creating a unique directory with pid extension
 ######################################################
 
diff --git a/solenv/bin/modules/installer/windows/assembly.pm b/solenv/bin/modules/installer/windows/assembly.pm
index a03c4de..fb80d52 100644
--- a/solenv/bin/modules/installer/windows/assembly.pm
+++ b/solenv/bin/modules/installer/windows/assembly.pm
@@ -62,35 +62,6 @@ sub get_msiassembly_component
 }
 
 ##############################################################
-# Returning the file name as manifest file
-##############################################################
-
-sub get_msiassembly_filemanifest
-{
-    my ( $onefile ) = @_;
-
-    my $filemanifest = "";
-
-    $filemanifest = $onefile->{'uniquename'};
-
-    return $filemanifest;
-}
-
-
-##############################################################
-# Returning the file application
-##############################################################
-
-sub get_msiassembly_fileapplication
-{
-    my ( $onefile ) = @_;
-
-    my $fileapplication = "";
-
-    return $fileapplication;
-}
-
-##############################################################
 # Returning the file attributes
 ##############################################################
 
@@ -105,35 +76,6 @@ sub get_msiassembly_attributes
     return $fileattributes;
 }
 
-##############################################################
-# Returning the file object for the msiassembly table.
-##############################################################
-
-sub get_msiassembly_file
-{
-    my ( $filesref, $filename ) = @_;
-
-    my $foundfile = 0;
-    my $onefile;
-
-    for ( my $i = 0; $i <= $#{$filesref}; $i++ )
-    {
-        $onefile = ${$filesref}[$i];
-        my $name = $onefile->{'Name'};
-
-        if ( $name eq $filename )
-        {
-            $foundfile = 1;
-            last;
-        }
-    }
-
-    # It does not need to exist. For example products that do not contain the libraries.
-    if (! $foundfile ) { $onefile  = ""; }
-
-    return $onefile;
-}
-
 ####################################################################################
 # Creating the file MsiAssembly.idt dynamically
 # Content:
diff --git a/solenv/bin/modules/installer/windows/feature.pm b/solenv/bin/modules/installer/windows/feature.pm
index d023a74..f230fa6 100644
--- a/solenv/bin/modules/installer/windows/feature.pm
+++ b/solenv/bin/modules/installer/windows/feature.pm
@@ -185,36 +185,6 @@ sub get_feature_attributes
 }
 
 #################################################################################
-# Replacing one variable in one files
-#################################################################################
-
-sub replace_one_variable
-{
-    my ($translationfile, $variable, $searchstring) = @_;
-
-    for ( my $i = 0; $i <= $#{$translationfile}; $i++ )
-    {
-        ${$translationfile}[$i] =~ s/\%$searchstring/$variable/g;
-    }
-}
-
-#################################################################################
-# Replacing the variables in the feature names and descriptions
-#################################################################################
-
-sub replace_variables
-{
-    my ($translationfile, $variableshashref) = @_;
-
-    # we want to substitute FOO_BR before FOO to avoid floating _BR suffixes
-    foreach $key (sort { length ($b) <=> length ($a) } keys %{$variableshashref})
-    {
-        my $value = $variableshashref->{$key};
-        replace_one_variable($translationfile, $value, $key);
-    }
-}
-
-#################################################################################
 # Collecting the feature recursively.
 #################################################################################
 
diff --git a/solenv/bin/modules/installer/windows/media.pm b/solenv/bin/modules/installer/windows/media.pm
index bb89471..9f53069 100644
--- a/solenv/bin/modules/installer/windows/media.pm
+++ b/solenv/bin/modules/installer/windows/media.pm
@@ -35,17 +35,6 @@ sub get_media_diskid
 }
 
 ##############################################################
-# Returning the lastsequence for the media table.
-##############################################################
-
-sub get_media_lastsequence
-{
-    my ($fileref) = @_;
-
-    return $fileref->{'sequencenumber'};
-}
-
-##############################################################
 # Returning the diskprompt for the media table.
 ##############################################################
 
@@ -55,22 +44,6 @@ sub get_media_diskprompt
 }
 
 ##############################################################
-# Returning the cabinet file name for the media table.
-##############################################################
-
-sub get_media_cabinet
-{
-    my ($id) = @_;
-
-    my $number = 1000 + $id;
-    my $filename = "f_" . $number . ".cab";
-
-    if ( $installer::globals::include_cab_in_msi ) { $filename = "\#" . $filename; }
-
-    return $filename;
-}
-
-##############################################################
 # Returning the volumelabel for the media table.
 ##############################################################
 
@@ -88,97 +61,6 @@ sub get_media_source
     return "";
 }
 
-##############################################################
-# Saving the cabinet file name in the files collector.
-# This is useful for making a list to connect the
-# source of each file with the destination cabinet file.
-##############################################################
-
-sub set_cabinetfilename_for_component_in_file_collector
-{
-    my ($cabinetfilename, $filesref, $componentname, $max) = @_;
-
-    for ( my $i = 0; $i <= $max; $i++ )
-    {
-        my $onefile = ${$filesref}[$i];
-        my $component = $onefile->{'componentname'};
-
-        if ( $component eq $componentname )
-        {
-            my $cabinet = "";
-
-            if ( $onefile->{'cabinet'} ) { $cabinet = $onefile->{'cabinet'}; }
-
-            if ( $cabinet eq "" )
-            {
-                $onefile->{'cabinet'} = $cabinetfilename;
-            }
-        }
-    }
-}
-
-#################################################
-# Creating the cab file name dynamically
-#################################################
-
-sub generate_cab_filename_for_some_cabs
-{
-    my ( $allvariables, $id ) = @_;
-
-    my $name = $allvariables->{'PRODUCTNAME'};
-
-    $name = lc($name);
-    $name =~ s/\.//g;
-    $name =~ s/\s//g;
-
-    # possibility to overwrite the name with variable CABFILENAME
-    if ( $allvariables->{'CABFILENAME'} ) { $name = $allvariables->{'CABFILENAME'}; }
-
-    $name = $name . $id . ".cab";
-
-    if ( $installer::globals::include_cab_in_msi ) { $name = "\#" . $name; }
-
-    return $name;
-}
-
-#################################################
-# Creating the cab file name for cab files
-# defined in packages.
-#################################################
-
-sub get_cabfilename
-{
-    my ($name) = @_;
-
-    if ( $installer::globals::include_cab_in_msi ) { $name = "\#" . $name; }
-
-    return $name;
-}
-
-#################################################
-# Creating the cab file name dynamically
-#################################################
-
-sub generate_cab_filename
-{
-    my ( $allvariables ) = @_;
-
-    my $name = $allvariables->{'PRODUCTNAME'};
-
-    $name = lc($name);
-    $name =~ s/\.//g;
-    $name =~ s/\s//g;
-
-    # possibility to overwrite the name with variable CABFILENAME
-    if ( $allvariables->{'CABFILENAME'} ) { $name = $allvariables->{'CABFILENAME'}; }
-
-    $name = $name . ".cab";
-
-    if ( $installer::globals::include_cab_in_msi ) { $name = "\#" . $name; }
-
-    return $name;
-}
-
 sub get_maximum_filenumber
 {
     my ($allfiles, $maxcabfilenumber) = @_;
@@ -198,28 +80,6 @@ sub get_maximum_filenumber
 }
 
 #################################################################################
-# Setting the last sequence for the cabinet files
-#################################################################################
-
-sub get_last_sequence
-{
-    my ( $cabfilename, $alludpatelastsequences ) = @_;
-
-    my $sequence = 0;
-
-    if (( $installer::globals::updatedatabase ) && ( exists($alludpatelastsequences->{$cabfilename}) ))
-    {
-        $sequence = $alludpatelastsequences->{$cabfilename};
-    }
-    else
-    {
-        $sequence = $installer::globals::lastsequence{$cabfilename};
-    }
-
-    return $sequence;
-}
-
-#################################################################################
 # Creating the file Media.idt dynamically
 # Content:
 # DiskId LastSequence DiskPrompt Cabinet VolumeLabel Source
diff --git a/solenv/bin/modules/installer/windows/msp.pm b/solenv/bin/modules/installer/windows/msp.pm
index 9892c7d..fbb0661 100644
--- a/solenv/bin/modules/installer/windows/msp.pm
+++ b/solenv/bin/modules/installer/windows/msp.pm
@@ -281,20 +281,6 @@ sub check_and_save_tables
 }
 
 ####################################################################
-# Setting the languages for the service packs
-####################################################################
-
-sub create_langstring
-{
-    my ( $languagesarrayref ) = @_;
-
-    my $langstring = "";
-    for ( my $i = 0; $i <= $#{$languagesarrayref}; $i++ ) { $langstring = $langstring . "_" . ${$languagesarrayref}[$i]; }
-
-    return $langstring;
-}
-
-####################################################################
 # Setting the name of the msp database
 ####################################################################
 
diff --git a/solenv/bin/modules/installer/worker.pm b/solenv/bin/modules/installer/worker.pm
index b97dae2..4022907 100644
--- a/solenv/bin/modules/installer/worker.pm
+++ b/solenv/bin/modules/installer/worker.pm
@@ -245,31 +245,6 @@ sub collect_all_items_with_special_flag
 }
 
 ##############################################################
-# Collecting all items without a defined flag
-##############################################################
-
-sub collect_all_items_without_special_flag
-{
-    my ($itemsref, $flag) = @_;
-
-    my @allitems = ();
-
-    for ( my $i = 0; $i <= $#{$itemsref}; $i++ )
-    {
-        my $oneitem = ${$itemsref}[$i];
-        my $styles = "";
-        if ( $oneitem->{'Styles'} ) { $styles = $oneitem->{'Styles'} };
-
-        if ( !( $styles =~ /\b$flag\b/ ))
-        {
-            push( @allitems, $oneitem );
-        }
-    }
-
-    return \@allitems;
-}
-
-##############################################################
 # Removing all items with a defined flag from collector
 ##############################################################
 
@@ -652,34 +627,6 @@ sub collect_all_files_from_includepaths
     push( @installer::globals::globallogfileinfo, "\n");
 }
 
-##############################################
-# Searching for a file with the gid
-##############################################
-
-sub find_file_by_id
-{
-    my ( $filesref, $gid ) = @_;
-
-    my $foundfile = 0;
-    my $onefile;
-
-    for ( my $i = 0; $i <= $#{$filesref}; $i++ )
-    {
-        $onefile = ${$filesref}[$i];
-        my $filegid = $onefile->{'gid'};
-
-        if ( $filegid eq $gid )
-        {
-            $foundfile = 1;
-            last;
-        }
-    }
-
-    if (! $foundfile ) { $onefile  = ""; }
-
-    return $onefile;
-}
-
 #################################################
 # Generating paths for cygwin (second version)
 # This function generates smaller files for
diff --git a/solenv/bin/modules/packager/files.pm b/solenv/bin/modules/packager/files.pm
index a9c2fc9..8a947f2 100644
--- a/solenv/bin/modules/packager/files.pm
+++ b/solenv/bin/modules/packager/files.pm
@@ -96,38 +96,6 @@ sub create_directory
 }
 
 ######################################################
-# Creating a unique directory with number extension
-######################################################
-
-sub create_unique_directory
-{
-    my ($directory) = @_;
-
-    $directory =~ s/\Q$packager::globals::separator\E\s*$//;
-    $directory = $directory . "_INCREASINGNUMBER";
-
-    my $counter = 1;
-    my $created = 0;
-    my $localdirectory = "";
-
-    do
-    {
-        $localdirectory = $directory;
-        $localdirectory =~ s/INCREASINGNUMBER/$counter/;
-        $counter++;
-
-        if ( ! -d $localdirectory )
-        {
-            create_directory($localdirectory);
-            $created = 1;
-        }
-    }
-    while ( ! $created );
-
-    return $localdirectory;
-}
-
-######################################################
 # Removing a complete directory with subdirectories
 ######################################################
 


More information about the Libreoffice-commits mailing list