[Libreoffice-commits] .: solenv/bin

Tor Lillqvist tml at kemper.freedesktop.org
Thu Mar 31 04:41:00 PDT 2011


 solenv/bin/modules/installer/windows/directory.pm |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

New commits:
commit 5bccde7384d9c1f34ea296a26e86cb537d2a4d32
Author: Tor Lillqvist <tlillqvist at novell.com>
Date:   Thu Mar 31 14:35:39 2011 +0300

    Don't check the directories for uniqueness multiple times
    
    Wen building a multi-language installer the subroutine
    create_unique_directorynames() is called for each language. The same
    directory names will be traversed each time. It needs to check the
    uniqueness of them only the first time, otherwise it will think every
    directory name is repeated.
    
    The check is new, from OOo, but they don't build multi-language
    installers so they have not noticed this problem.
    
    The solution is a bit hacky but works.

diff --git a/solenv/bin/modules/installer/windows/directory.pm b/solenv/bin/modules/installer/windows/directory.pm
index e8843a9..3a4adab 100644
--- a/solenv/bin/modules/installer/windows/directory.pm
+++ b/solenv/bin/modules/installer/windows/directory.pm
@@ -133,6 +133,8 @@ sub make_short_dir_version
 # Adding unique directory names to the directory collection
 ##############################################################
 
+my $already_checked_the_frigging_directories_for_uniqueness = 0;
+
 sub create_unique_directorynames
 {
     my ($directoryref, $allvariables) = @_;
@@ -161,6 +163,7 @@ sub create_unique_directorynames
         $uniquename =~ s/\.//g;					# removing dots in directoryname
         $uniquename =~ s/\Q$installer::globals::separator\E/\_/g;	# replacing slash and backslash with underline
         $uniquename =~ s/OpenOffice/OO/g;
+        $uniquename =~ s/LibreOffice/LO/g;
         $uniquename =~ s/_registry/_rgy/g;
         $uniquename =~ s/_registration/_rgn/g;
         $uniquename =~ s/_extension/_ext/g;
@@ -176,7 +179,8 @@ sub create_unique_directorynames
             $uniquename = make_short_dir_version($uniquename, $startlength, $hostname); # taking care of underlines!
         }
 
-        if ( exists($installer::globals::alluniquedirectorynames{$uniquename}) )
+        if ( !$already_checked_the_frigging_directories_for_uniqueness &&
+	     exists($installer::globals::alluniquedirectorynames{$uniquename}) )
         {
             # This is an error, that must stop the packaging process
             $errorcount++;
@@ -543,6 +547,7 @@ sub create_directory_table
     overwrite_programfilesfolder($allvariableshashref);
     if ( $installer::globals::globallogging ) { installer::files::save_array_of_hashes($loggingdir . "directoriesforidt_local_1.log", $directoryref); }
     create_unique_directorynames($directoryref, $allvariableshashref);
+    $already_checked_the_frigging_directories_for_uniqueness++;
     if ( $installer::globals::globallogging ) { installer::files::save_array_of_hashes($loggingdir . "directoriesforidt_local_1a.log", $directoryref); }
     create_defaultdir_directorynames($directoryref, $shortdirnamehashref);	# only destdir!
     if ( $installer::globals::globallogging ) { installer::files::save_array_of_hashes($loggingdir . "directoriesforidt_local_2.log", $directoryref); }


More information about the Libreoffice-commits mailing list