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

2012-02-17 Thread Michael Meeks
 solenv/bin/make_installer.pl |4 
 solenv/bin/modules/installer/download.pm |   64 --
 solenv/bin/modules/installer/worker.pm   |  322 ---
 3 files changed, 390 deletions(-)

New commits:
commit 04e1010fd74a8e61d43e83afb81c4f6315a201c8
Author: Tim Retout t...@retout.co.uk
Date:   Thu Feb 16 23:03:05 2012 +

Remove unused save_logfile_after_linking from installer::worker

diff --git a/solenv/bin/modules/installer/worker.pm 
b/solenv/bin/modules/installer/worker.pm
index 702e366..6f6801a 100644
--- a/solenv/bin/modules/installer/worker.pm
+++ b/solenv/bin/modules/installer/worker.pm
@@ -277,21 +277,6 @@ sub analyze_and_save_logfile
 }
 
 ###
-# Analyzing and creating the log file
-###
-
-sub save_logfile_after_linking
-{
-my ($loggingdir, $installlogdir, $current_install_number) = @_;
-
-# Saving the logfile in the log file directory and additionally in a log 
directory in the install directory
-my $numberedlogfilename = $installer::globals::logfilename;
-installer::logger::print_message( ... creating log file 
$numberedlogfilename \n );
-installer::files::save_file($loggingdir . $numberedlogfilename, 
\@installer::globals::logfileinfo);
-installer::files::save_file($installlogdir . 
$installer::globals::separator . $numberedlogfilename, 
\@installer::globals::logfileinfo);
-}
-
-###
 # Removing all directories that are saved in the
 # global directory @installer::globals::removedirs
 ###
commit 2492b26bb705a5c85b87386cd18aa57b3ed3c68d
Author: Tim Retout t...@retout.co.uk
Date:   Thu Feb 16 23:02:22 2012 +

Remove unused unpack_all_targzfiles_in_directory from installer::worker

diff --git a/solenv/bin/modules/installer/worker.pm 
b/solenv/bin/modules/installer/worker.pm
index 7dbe0d4..702e366 100644
--- a/solenv/bin/modules/installer/worker.pm
+++ b/solenv/bin/modules/installer/worker.pm
@@ -45,44 +45,6 @@ use installer::scriptitems;
 use installer::systemactions;
 use installer::windows::language;
 
-#
-# Unpacking all files ending with tar.gz in a specified directory
-#
-
-sub unpack_all_targzfiles_in_directory
-{
-my ( $directory ) = @_;
-
-installer::logger::include_header_into_logfile(Unpacking tar.gz files:);
-
-installer::logger::print_message( ... unpacking tar.gz files ... \n );
-
-my $localdirectory = $directory . $installer::globals::separator . 
packages;
-my $alltargzfiles = 
installer::systemactions::find_file_with_file_extension(tar.gz, 
$localdirectory);
-
-for ( my $i = 0; $i = $#{$alltargzfiles}; $i++ )
-{
-my $onefile = $localdirectory . $installer::globals::separator . 
${$alltargzfiles}[$i];
-
-my $systemcall = cd $localdirectory; cat ${$alltargzfiles}[$i] \| 
gunzip \| tar -xf -;
-$returnvalue = system($systemcall);
-
-my $infoline = Systemcall: $systemcall\n;
-push( @installer::globals::logfileinfo, $infoline);
-
-if ($returnvalue)
-{
-$infoline = ERROR: Could not execute \$systemcall\!\n;
-push( @installer::globals::logfileinfo, $infoline);
-}
-else
-{
-$infoline = Success: Executed \$systemcall\ successfully!\n;
-push( @installer::globals::logfileinfo, $infoline);
-}
-}
-}
-
 #
 # Writing some global information into
 # the list of files without flag PATCH
commit 8b389383dcc56048605cef7c430ee58687b12986
Author: Tim Retout t...@retout.co.uk
Date:   Thu Feb 16 22:59:51 2012 +

Remove unused checksum subs from installer::worker

diff --git a/solenv/bin/make_installer.pl b/solenv/bin/make_installer.pl
index 08c118b..47d137c 100644
--- a/solenv/bin/make_installer.pl
+++ b/solenv/bin/make_installer.pl
@@ -815,10 +815,6 @@ for ( my $n = 0; $n = 
$#installer::globals::languageproducts; $n++ )
 
installer::scriptitems::make_filename_language_specific($filesinproductlanguageresolvedarrayref);
 if ( $installer::globals::globallogging ) { 
installer::files::save_array_of_hashes($loggingdir . productfiles10f.log, 
$filesinproductlanguageresolvedarrayref); }
 
-# print ... calculating checksums ...\n;
-# my $checksumfile = 
installer::worker::make_checksum_file($filesinproductlanguageresolvedarrayref, 
$includepatharrayref);
-# if ( $installer::globals::globallogging ) { 
installer::files::save_file($loggingdir . 
$installer::globals::checksumfilename, $checksumfile); }
-
 
##
 # Unzipping files with flag 

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

2012-02-16 Thread Michael Meeks
 solenv/bin/make_installer.pl|8 +-
 solenv/bin/modules/installer/sorter.pm  |   89 +++-
 solenv/bin/modules/installer/windows/feature.pm |   13 +--
 solenv/bin/modules/installer/worker.pm  |   20 -
 solenv/bin/modules/t/installer-sorter.t |   48 
 5 files changed, 71 insertions(+), 107 deletions(-)

New commits:
commit 51f8f151780b6514d515b739e3167f36eb30787c
Author: Tim Retout t...@retout.co.uk
Date:   Wed Feb 15 20:08:57 2012 +

Simplify installer::sorter::sorting_array_of_hashes.

diff --git a/solenv/bin/modules/installer/sorter.pm 
b/solenv/bin/modules/installer/sorter.pm
index 54e5c34..b08dd80 100644
--- a/solenv/bin/modules/installer/sorter.pm
+++ b/solenv/bin/modules/installer/sorter.pm
@@ -44,26 +44,10 @@ sub sorting_array_of_hashes
 {
 my ($arrayref, $sortkey) = @_;
 
-for ( my $i = 0; $i = $#{$arrayref}; $i++ )
-{
-my $onehashunder = ${$arrayref}[$i];
-my $sortvalueunder = $onehashunder-{$sortkey};
-
-for ( my $j = $i + 1; $j = $#{$arrayref}; $j++ )
-{
-my $onehashover = ${$arrayref}[$j];
-my $sortvalueover = $onehashover-{$sortkey};
-
-if ( $sortvalueunder gt $sortvalueover)
-{
-${$arrayref}[$i] = $onehashover;
-${$arrayref}[$j] = $onehashunder;
-
-$onehashunder = $onehashover;
-$sortvalueunder = $sortvalueover;
-}
-}
-}
+@$arrayref = map { $_-[1] }
+ sort { $a-[0] cmp $b-[0] }
+ map { [$_-{$sortkey}, $_] }
+ @$arrayref;
 }
 
 1;
commit 01fde2e939cbc4aeeb15978febb5e2fa0396c125
Author: Tim Retout t...@retout.co.uk
Date:   Wed Feb 15 19:00:10 2012 +

Add tests for installer::sorter

diff --git a/solenv/bin/modules/t/installer-sorter.t 
b/solenv/bin/modules/t/installer-sorter.t
new file mode 100644
index 000..fe67b4e
--- /dev/null
+++ b/solenv/bin/modules/t/installer-sorter.t
@@ -0,0 +1,48 @@
+# Version: MPL 1.1 / GPLv3+ / LGPLv3+
+#
+# The contents of this file are subject to the Mozilla Public License Version
+# 1.1 (the License); you may not use this file except in compliance with
+# the License or as specified alternatively below. You may obtain a copy of
+# the License at http://www.mozilla.org/MPL/
+#
+# Software distributed under the License is distributed on an AS IS basis,
+# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+# for the specific language governing rights and limitations under the
+# License.
+#
+# Major Contributor(s):
+# [ Copyright (C) 2012 Tim Retout t...@retout.co.uk (initial developer) ]
+#
+# All Rights Reserved.
+#
+# For minor contributions see the git repository.
+#
+# Alternatively, the contents of this file may be used under the terms of
+# either the GNU General Public License Version 3 or later (the GPLv3+), or
+# the GNU Lesser General Public License Version 3 or later (the LGPLv3+),
+# in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
+# instead of those above.
+
+use strict;
+use warnings;
+
+use lib '.';
+
+use Test::More;
+use List::Util 'shuffle';
+
+BEGIN {
+use_ok('installer::sorter', qw(
+sorting_array_of_hashes
+));
+}
+
+my @loh_str_sorted = map { { key = $_ } } (a..j);
+
+my @loh_str_random = shuffle @loh_str_sorted;
+
+sorting_array_of_hashes(\@loh_str_random, key);
+
+is_deeply(\@loh_str_random, \@loh_str_sorted);
+
+done_testing();
commit a1bc2d7d23e160bd9bb9570b4d512eee740aca15
Author: Tim Retout t...@retout.co.uk
Date:   Wed Feb 15 18:50:06 2012 +

Use Exporter for installer::sorter

diff --git a/solenv/bin/make_installer.pl b/solenv/bin/make_installer.pl
index 4f35aed..45dede0 100644
--- a/solenv/bin/make_installer.pl
+++ b/solenv/bin/make_installer.pl
@@ -57,7 +57,7 @@ use installer::scpzipfiles;
 use installer::scriptitems;
 use installer::setupscript;
 use installer::simplepackage;
-use installer::sorter;
+use installer::sorter qw(sorting_array_of_hashes);
 use installer::strip;
 use installer::substfilenamefiles;
 use installer::systemactions;
@@ -1101,7 +1101,7 @@ for ( my $n = 0; $n = 
$#installer::globals::languageproducts; $n++ )
 if ( $installer::globals::globallogging ) { 
installer::files::save_array_of_hashes($loggingdir . 
directoriesforepmlist3alangpack.log, $directoriesforepmarrayref); }
 ($directoriesforepmarrayref, $alldirectoryhash) = 
installer::scriptitems::collect_directories_with_create_flag_from_directoryarray($dirsinproductlanguageresolvedarrayref,
 $alldirectoryhash);
 if ( $installer::globals::globallogging ) { 
installer::files::save_array_of_hashes($loggingdir . 
directoriesforepmlist3blangpack.log, $directoriesforepmarrayref); }
-installer::sorter::sorting_array_of_hashes($directoriesforepmarrayref, 
HostName);
+sorting_array_of_hashes($directoriesforepmarrayref, HostName);