[Libreoffice-commits] .: 2 commits - solenv/bin

Tim Retout timretout at kemper.freedesktop.org
Tue Feb 21 10:34:39 PST 2012


 solenv/bin/modules/installer/epmfile.pm |  111 --------------------------------
 solenv/bin/modules/installer/files.pm   |   49 --------------
 solenv/bin/modules/par2script/files.pm  |   53 ---------------
 solenv/bin/modules/pre2par/files.pm     |   53 ---------------
 4 files changed, 2 insertions(+), 264 deletions(-)

New commits:
commit 37b0805a8c0498143dedb5f77038ac4e118b8711
Author: Tim Retout <tim at retout.co.uk>
Date:   Sun Feb 19 20:52:31 2012 +0000

    Remove unused subs from installer::epmfile.

diff --git a/solenv/bin/modules/installer/epmfile.pm b/solenv/bin/modules/installer/epmfile.pm
index 1ec035c..830290d 100644
--- a/solenv/bin/modules/installer/epmfile.pm
+++ b/solenv/bin/modules/installer/epmfile.pm
@@ -135,77 +135,6 @@ sub read_packagemap
 
 }
 
-############################################################################
-# The header file contains the strings for the epm header in all languages
-############################################################################
-
-sub get_string_from_headerfile
-{
-    my ($searchstring, $language, $fileref) = @_;
-
-    my $returnstring  = "";
-    my $onestring  = "";
-    my $englishstring  = "";
-    my $foundblock = 0;
-    my $foundstring = 0;
-    my $foundenglishstring = 0;
-    my $englishidentifier = "01";
-
-    $searchstring = "[" . $searchstring . "]";
-
-    for ( my $i = 0; $i <= $#{$fileref}; $i++ )
-    {
-        my $line = ${$fileref}[$i];
-
-        if ( $line =~ /^\s*\Q$searchstring\E\s*$/ )
-        {
-            $foundblock = 1;
-            my $counter = $i + 1;
-
-            $line = ${$fileref}[$counter];
-
-            # Beginning of the next block oder Dateiende
-
-            while ((!($line =~ /^\s*\[\s*\w+\s*\]\s*$/ )) && ( $counter <= $#{$fileref} ))
-            {
-                if ( $line =~ /^\s*\Q$language\E\s+\=\s*\"(.*)\"\s*$/ )
-                {
-                    $onestring = $1;
-                    $foundstring = 1;
-                    last;
-                }
-
-                if ( $line =~ /^\s*\Q$englishidentifier\E\s+\=\s*\"(.*)\"\s*$/ )
-                {
-                    $englishstring = $1;
-                    $foundenglishstring = 1;
-                }
-
-                $counter++;
-                $line = ${$fileref}[$counter];
-            }
-        }
-    }
-
-    if ( $foundstring )
-    {
-        $returnstring = $onestring;
-    }
-    else
-    {
-        if ( $foundenglishstring )
-        {
-            $returnstring = $englishstring;
-        }
-        else
-        {
-            installer::exiter::exit_program("ERROR: No string found for $searchstring in epm header file (-h)", "get_string_from_headerfile");
-        }
-    }
-
-    return \$returnstring;
-}
-
 ##########################################################
 # Filling the epm file with directories, files and links
 ##########################################################
@@ -740,20 +669,6 @@ sub replace_variable_in_shellscripts
     }
 }
 
-###################################################
-# Replace one in shell scripts ( %VARIABLENAME )
-###################################################
-
-sub replace_percent_variable_in_shellscripts
-{
-    my ($scriptref, $variable, $searchstring) = @_;
-
-    for ( my $i = 0; $i <= $#{$scriptref}; $i++ )
-    {
-        ${$scriptref}[$i] =~ s/\%$searchstring/$variable/g;
-    }
-}
-
 ################################################
 # Replacing many variables in shell scripts
 ################################################
@@ -2178,32 +2093,6 @@ sub prepare_packages
     return $newepmdir;
 }
 
-############################################################
-# Linux requirement for perl is changed by epm from
-# /usr/bin/perl to perl .
-# Requires: perl
-############################################################
-
-sub check_requirements_in_specfile
-{
-    my ( $specfile ) = @_;
-
-    for ( my $i = 0; $i <= $#{$specfile}; $i++ )
-    {
-        if (( ${$specfile}[$i] =~ /^\s*Requires/ ) && ( ${$specfile}[$i] =~ /\bperl\b/ ) && ( ! (  ${$specfile}[$i] =~ /\/usr\/bin\/perl\b/ )))
-        {
-            my $oldline = ${$specfile}[$i];
-            ${$specfile}[$i] =~ s/perl/\/usr\/bin\/perl/;
-            my $newline = ${$specfile}[$i];
-
-            $oldline =~ s/\s*$//;
-            $newline =~ s/\s*$//;
-            my $infoline = "Spec File: Changing content from \"$oldline\" to \"$newline\".\n";
-            push(@installer::globals::logfileinfo, $infoline);
-        }
-    }
-}
-
 ###############################################################################
 # Replacement of PRODUCTINSTALLLOCATION and PRODUCTDIRECTORYNAME in the
 # epm list file.
commit 145a69f5df82d04d3dcde6709a2cc1f7cebcda66
Author: Tim Retout <tim at retout.co.uk>
Date:   Sun Feb 19 19:30:21 2012 +0000

    Remove unused save functions from various Perl modules.

diff --git a/solenv/bin/modules/installer/files.pm b/solenv/bin/modules/installer/files.pm
index cd2350d..1d9e770 100644
--- a/solenv/bin/modules/installer/files.pm
+++ b/solenv/bin/modules/installer/files.pm
@@ -95,27 +95,6 @@ sub save_file
     }
 }
 
-sub save_hash
-{
-    my ($savefile, $hashref) = @_;
-
-    my @printcontent = ();
-
-    my $itemkey;
-
-    foreach $itemkey ( keys %{$hashref} )
-    {
-        my $line = "";
-        my $itemvalue = $hashref->{$itemkey};
-        $line = $itemkey . "=" . $itemvalue . "\n";
-        push(@printcontent, $line);
-    }
-
-    open( OUT, ">$savefile" ) || installer::exiter::exit_program("ERROR: Cannot open file $savefile for writing", "save_hash");
-    print OUT @printcontent;
-    close( OUT);
-}
-
 sub save_array_of_hashes
 {
     my ($savefile, $arrayref) = @_;
@@ -144,34 +123,6 @@ sub save_array_of_hashes
     close( OUT);
 }
 
-sub save_array_of_hashes_modules
-{
-    my ($savefile, $arrayref) = @_;
-
-    my @printcontent = ();
-
-    for ( my $i = 0; $i <= $#{$arrayref}; $i++ )
-    {
-        my $line = "***************************************************\n";
-        my $hashref = ${$arrayref}[$i];
-        my $itemkey;
-
-        foreach $itemkey ( keys %{$hashref} )
-        {
-            my $itemvalue = $hashref->{$itemkey};
-            $line = $line . $itemkey . "=" . $itemvalue . "\n";
-        }
-
-        $line = $line . "\n";
-
-        push(@printcontent, $line);
-    }
-
-    open( OUT, ">$savefile" ) || installer::exiter::exit_program("ERROR: Cannot open file $savefile for writing", "save_array_of_hashes");
-    print OUT @printcontent;
-    close( OUT);
-}
-
 ###########################################
 # Binary file operations
 ###########################################
diff --git a/solenv/bin/modules/par2script/files.pm b/solenv/bin/modules/par2script/files.pm
index 3b7e70d..cc1be42 100644
--- a/solenv/bin/modules/par2script/files.pm
+++ b/solenv/bin/modules/par2script/files.pm
@@ -58,7 +58,7 @@ sub read_file
 }
 
 ###########################################
-# Saving files, arrays and hashes
+# Saving files
 ###########################################
 
 sub save_file
@@ -70,55 +70,4 @@ sub save_file
     if (! -f $savefile) { pre2par::exiter::exit_program("ERROR: Cannot write file: $savefile", "save_file"); }
 }
 
-sub save_hash
-{
-    my ($savefile, $hashref) = @_;
-
-    my @printcontent = ();
-
-    my ($itemkey, $itemvalue, $line);
-
-    foreach $itemkey ( keys %{$hashref} )
-    {
-        $line = "";
-        $itemvalue = $hashref->{$itemkey};
-        $line = $itemkey . "=" . $itemvalue . "\n";
-        push(@printcontent, $line);
-    }
-
-    open( OUT, ">$savefile" );
-    print OUT @printcontent;
-    close( OUT);
-}
-
-sub save_array_of_hashes
-{
-    my ($savefile, $arrayref) = @_;
-
-    my @printcontent = ();
-
-    my ($itemkey, $itemvalue, $line, $hashref);
-
-    for ( my $i = 0; $i <= $#{$arrayref}; $i++ )
-    {
-        $line = "";
-        $hashref = ${$arrayref}[$i];
-
-        foreach $itemkey ( keys %{$hashref} )
-        {
-            $itemvalue = $hashref->{$itemkey};
-
-            $line = $line . $itemkey . "=" . $itemvalue . "\t";
-        }
-
-        $line = $line . "\n";
-
-        push(@printcontent, $line);
-    }
-
-    open( OUT, ">$savefile" );
-    print OUT @printcontent;
-    close( OUT);
-}
-
 1;
diff --git a/solenv/bin/modules/pre2par/files.pm b/solenv/bin/modules/pre2par/files.pm
index e3de88b..6dbfd93 100644
--- a/solenv/bin/modules/pre2par/files.pm
+++ b/solenv/bin/modules/pre2par/files.pm
@@ -57,7 +57,7 @@ sub read_file
 }
 
 ###########################################
-# Saving files, arrays and hashes
+# Saving files
 ###########################################
 
 sub save_file
@@ -71,55 +71,4 @@ sub save_file
     if (! -f $savefile) { pre2par::exiter::exit_program("ERROR: Cannot write file: $savefile", "save_file"); }
 }
 
-sub save_hash
-{
-    my ($savefile, $hashref) = @_;
-
-    my @printcontent = ();
-
-    my ($itemkey, $itemvalue, $line);
-
-    foreach $itemkey ( keys %{$hashref} )
-    {
-        $line = "";
-        $itemvalue = $hashref->{$itemkey};
-        $line = $itemkey . "=" . $itemvalue . "\n";
-        push(@printcontent, $line);
-    }
-
-    open( OUT, ">$savefile" );
-    print OUT @printcontent;
-    close( OUT);
-}
-
-sub save_array_of_hashes
-{
-    my ($savefile, $arrayref) = @_;
-
-    my @printcontent = ();
-
-    my ($itemkey, $itemvalue, $line, $hashref);
-
-    for ( my $i = 0; $i <= $#{$arrayref}; $i++ )
-    {
-        $line = "";
-        $hashref = ${$arrayref}[$i];
-
-        foreach $itemkey ( keys %{$hashref} )
-        {
-            $itemvalue = $hashref->{$itemkey};
-
-            $line = $line . $itemkey . "=" . $itemvalue . "\t";
-        }
-
-        $line = $line . "\n";
-
-        push(@printcontent, $line);
-    }
-
-    open( OUT, ">$savefile" );
-    print OUT @printcontent;
-    close( OUT);
-}
-
 1;


More information about the Libreoffice-commits mailing list