[Libreoffice-commits] core.git: Changes to 'refs/changes/09/409/1'

2014-09-29 Thread Tim Retout

___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


Re: [Libreoffice-commits] Revert "installer: Use hashref for replace_all_ziplistvariables_in_rtffile"

2012-08-23 Thread Tim Retout
On Aug 23, 2012 9:13 AM, "Stephan Bergmann"  wrote:
>
> On 08/23/2012 09:59 AM, Libreoffice Gerrit user wrote:
>>
>> commit 52755d6d2cf1c6addaf3c91b93bb86d66b730409
>> Author: Stephan Bergmann 
>> Date:   Thu Aug 23 09:47:13 2012 +0200
>>
>>  Revert "installer: Use hashref for
replace_all_ziplistvariables_in_rtffile"
>>
>>  This reverts commit 46a977081c6f1886f8fff8457c85e6d426dcc20f.  It
started to
>>  replace occurrences of "${...}" unknown to the installer with empty
strings,
>>  instead of keeping them as-is.  This caused the "${ORIGIN}" at the
start of the
>>  value for URE_BOOTSTRAP to disappear from the soffice ini-file (cf.
>>  gid_Brand_Profileitem_Soffice_UreBootstrap in
scp2/source/ooo/common_brand.scp),
>>  making soffice fail to start completely.

> Needed to revert, see above.  The original situation of how the installer
Perl code (we have no good name to talk about it, btw) does string
replacements was never really satisfactory to begin with, replacing just
those "${abc}" it happens to recognize (i.e., that are defined in
instsetoo_native/util/openoffice.lst, IIUC) and leaving unknown ones (like
"${ORIGIN}") alone.

Oh dear, sorry. :(  I could quite easily modify the patch to restore that
behaviour... and I'd add a test for it.  But I can see that it's not ideal
- if ORIGIN gets added to openoffice.lst, it will still fall over.

> A much more robust approach would be to specify an escape mechanism
(either "\$" to quote "$" and "\\" to quote "\", or "$$" to quote "$", say)
in the input language of the installer code.  But doing so would mean that
all the existing input text needs to be reviewed, adding escapements
exactly where necessary.

Hmm. And then these would need unescaping.

...
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


[Libreoffice-commits] .: solenv/bin

2012-08-16 Thread Tim Retout
 solenv/bin/make_installer.pl  |1 
 solenv/bin/modules/installer/environment.pm   |1 
 solenv/bin/modules/installer/epmfile.pm   |4 
 solenv/bin/modules/installer/globals.pm   |   89 --
 solenv/bin/modules/installer/parameter.pm |   24 -
 solenv/bin/modules/installer/windows/directory.pm |2 
 solenv/bin/modules/par2script/globals.pm  |7 -
 solenv/bin/modules/pre2par/globals.pm |8 -
 8 files changed, 136 deletions(-)

New commits:
commit e327840a6d41d8d68e5b5157c944d2acbd3232b0
Author: Thomas Arnhold 
Date:   Wed Aug 15 15:27:09 2012 +0200

installer: remove unused globals

Change-Id: I521e2c816b3dbc4aba1770e5a3b5eb47d5542ac1

diff --git a/solenv/bin/make_installer.pl b/solenv/bin/make_installer.pl
index 91e8ca6..57dedc3 100644
--- a/solenv/bin/make_installer.pl
+++ b/solenv/bin/make_installer.pl
@@ -517,7 +517,6 @@ for ( my $n = 0; $n <= 
$#installer::globals::languageproducts; $n++ )
 {
 my $languagesarrayref = 
installer::languages::get_all_languages_for_one_product($installer::globals::languageproducts[$n],
 $allvariableshashref);
 
-$installer::globals::alllanguagesinproductarrayref = $languagesarrayref;
 my $languagestringref = 
installer::languages::get_language_string($languagesarrayref);
 installer::logger::print_message( "\n" 
);
 installer::logger::print_message( "... languages $$languagestringref ... 
\n" );
diff --git a/solenv/bin/modules/installer/environment.pm 
b/solenv/bin/modules/installer/environment.pm
index 5459761..b0c541b 100644
--- a/solenv/bin/modules/installer/environment.pm
+++ b/solenv/bin/modules/installer/environment.pm
@@ -122,7 +122,6 @@ sub set_global_environment_variables
 if ( $ENV{'LOCALUNPACKDIR'} ) { $installer::globals::localunpackdir = 
$ENV{'LOCALUNPACKDIR'}; }
 if ( $ENV{'MAX_LANG_LENGTH'} ) { $installer::globals::max_lang_length = 
$ENV{'MAX_LANG_LENGTH'}; }
 
-if ( $ENV{'SOLAR_JAVA'} ) { $installer::globals::solarjavaset = 1; }
 if ( $ENV{'RPM'} ) { $installer::globals::rpm = $ENV{'RPM'}; }
 if ( $ENV{'DONTCOMPRESS'} ) { $installer::globals::solarisdontcompress = 
1; }
 if ( $ENV{'IGNORE_ERROR_IN_LOGFILE'} ) { 
$installer::globals::ignore_error_in_logfile = 1; }
diff --git a/solenv/bin/modules/installer/epmfile.pm 
b/solenv/bin/modules/installer/epmfile.pm
index 1ea9572..bc50aeb 100644
--- a/solenv/bin/modules/installer/epmfile.pm
+++ b/solenv/bin/modules/installer/epmfile.pm
@@ -2360,10 +2360,6 @@ sub create_packages_without_epm
 my $rpmcommand = $installer::globals::rpm;
 my $rpmversion = determine_rpm_version();
 
-# saving globally for later usage
-$installer::globals::rpmcommand = $rpmcommand;
-$installer::globals::rpmquerycommand = "rpm";
-
 my $target = "";
 if ( $installer::globals::compiler =~ /unxlngi/) { $target = "i586"; }
 elsif ( $installer::globals::compiler =~ /unxaigppc/) { $target = 
"ppc"; }
diff --git a/solenv/bin/modules/installer/globals.pm 
b/solenv/bin/modules/installer/globals.pm
index 7b5876f..6a2bc77 100644
--- a/solenv/bin/modules/installer/globals.pm
+++ b/solenv/bin/modules/installer/globals.pm
@@ -108,7 +108,6 @@ BEGIN
 $languagelist = "";
 $added_english = 0;
 $set_office_start_language = 0;
-$solarjavaset = 0;
 
 $destdir = "";
 $rootpath = "";
@@ -124,19 +123,10 @@ BEGIN
 $dounzip = 1;
 $languages_defined_in_productlist = 0;
 $setupscript_defined_in_productlist = 0;
-$islinux = 0;
-$issolaris = 0;
-$ismacosx = 0;
 $iswindowsbuild = 0;
 $islinuxbuild = 0;
 $isrpmbuild = 0;
 $isdebbuild = 0;
-$islinuxintelrpmbuild = 0;
-$islinuxppcrpmbuild = 0;
-$islinuxinteldebbuild = 0;
-$islinuxppcdebbuild = 0;
-$islinuxx86_64rpmbuild = 0;
-$islinuxx86_64debbuild = 0;
 $issolarisbuild = 0;
 $issolarispkgbuild = 0;
 $issolarissparcbuild = 0;
@@ -149,13 +139,11 @@ BEGIN
 $idttemplatepath = "";
 $idtlanguagepath = "";
 $buildid = "Not set";
-$guidcounter = 1000; # for uniqueness of guids
 $fontsfolder = "FontsFolder";
 $fontsfoldername = "Fonts";
 $fontsdirparent = "";
 $fontsdirname = "";
 $fontsdirhostname = "truetype";
-$officefolder = "OfficeFolder";
 $officemenufolder = "OfficeMenuFolder";
 $startupfolder = "StartupFolder";
 $startmenufolder = "StartMenuFolder";
@@ -180,12 +168,10 @@ BEGIN
 $packagerevision = 1;
 $rpm = "";
 $rpmcommand = "";
-$rpmquerycommand = "";
 $rpminfologged = 0;
 $debian = "";
 $installertypedir = "";
 $controlledmakecabversion = "5";
-$saved_packages_path = "";
 $max_lang_length = 50;
 $globalblock = "Globals";
 $rootmodulegid = "";
@@ -206,11 +192,6 @@ BEGIN
 $packageformat = "";
 $packagename = "";
 $packagelist = "";
-$addpackagelist = "

[Libreoffice-commits] .: solenv/bin

2012-08-16 Thread Tim Retout
 solenv/bin/make_installer.pl |4 -
 solenv/bin/modules/installer/followme.pm |  102 ---
 2 files changed, 106 deletions(-)

New commits:
commit c65bc1d7ac6671dc5099c66fea38ff9c4f975e5d
Author: Thomas Arnhold 
Date:   Wed Aug 15 14:43:19 2012 +0200

installer: remove save_followme_info

Change-Id: I87875922d952387d9ffd2667dd621d5cd94b4ea4

diff --git a/solenv/bin/make_installer.pl b/solenv/bin/make_installer.pl
index fce4522..91e8ca6 100644
--- a/solenv/bin/make_installer.pl
+++ b/solenv/bin/make_installer.pl
@@ -43,7 +43,6 @@ use installer::environment;
 use installer::epmfile;
 use installer::exiter;
 use installer::files;
-use installer::followme;
 use installer::globals;
 use installer::helppack;
 use installer::languagepack;
@@ -1502,7 +1501,6 @@ for ( my $n = 0; $n <= 
$#installer::globals::languageproducts; $n++ )
 installer::worker::clean_output_tree(); # removing directories created 
in the output tree
 ($is_success, $finalinstalldir) = 
installer::worker::analyze_and_save_logfile($loggingdir, $installdir, 
$installlogdir, $allsettingsarrayref, $languagestringref, 
$current_install_number);
 my $downloadname = 
installer::ziplist::getinfofromziplist($allsettingsarrayref, "downloadname");
-if ( $is_success ) { 
installer::followme::save_followme_info($finalinstalldir, $includepatharrayref, 
$allvariableshashref, $$downloadname, $languagestringref, $languagesarrayref, 
$current_install_number, $loggingdir, $installlogdir); }
 
 ###
 # Creating download installation set
@@ -1917,8 +1915,6 @@ for ( my $n = 0; $n <= 
$#installer::globals::languageproducts; $n++ )
 if ( $installer::globals::helppack ) { $downloadname = 
installer::ziplist::getinfofromziplist($allsettingsarrayref, 
"helppackdownloadname"); }
 if ( $installer::globals::patch ) { $downloadname = 
installer::ziplist::getinfofromziplist($allsettingsarrayref, 
"patchdownloadname"); }
 
-if ( $is_success ) { 
installer::followme::save_followme_info($finalinstalldir, $includepatharrayref, 
$allvariableshashref, $$downloadname, $languagestringref, $languagesarrayref, 
$current_install_number, $loggingdir, $installlogdir); }
-
 if ( $$downloadname ne "" ) { $create_download = 1; }
 if ( $installer::globals::iswindowsbuild )
 {
diff --git a/solenv/bin/modules/installer/followme.pm 
b/solenv/bin/modules/installer/followme.pm
deleted file mode 100644
index 73b1d2e..000
--- a/solenv/bin/modules/installer/followme.pm
+++ /dev/null
@@ -1,102 +0,0 @@
-#*
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org.  If not, see
-# 
-# for a copy of the LGPLv3 License.
-#
-#*
-
-package installer::followme;
-
-use File::Spec;
-use installer::exiter;
-use installer::files;
-use installer::globals;
-use installer::logger;
-use installer::systemactions;
-
-
-# Creating a file, that contains all information
-# to create a follow up process.
-
-
-sub save_followme_info
-{
-my ($finalinstalldir, $includepatharrayref, $allvariableshashref, 
$downloadname, $languagestringref, $languagesarrayref, $current_install_number, 
$loggingdir, $installlogdir) = @_;
-
-my $downloadinfofilename = $installer::globals::logfilename;
-$downloadinfofilename =~ s/log_/follow_me_/;
-
-# Creating directory
-my $downloadinfodir = 
installer::systemactions::create_directory_next_to_directory($finalinstalldir, 
"follow_me");
-
-my @filecontent = ();
-
-push(@filecontent, "finalinstalldir: $finalinstalldir\n");
-push(@filecontent, "downloadname: $downloadname\n");
-push(@filecontent, "currentinstallnumber: $current_install_number\n");
-push(@filecontent, "loggingdir: $loggingdir\n");
-push(@filecontent, "installlogdir: $installlogdir\n");

[Libreoffice-commits] .: solenv/bin

2012-08-14 Thread Tim Retout
 solenv/bin/modules/installer/download.pm |   26 --
 1 file changed, 26 deletions(-)

New commits:
commit 065b591504096661ac9f421902e108fbb8624b23
Author: Tim Retout 
Date:   Tue Aug 14 22:21:11 2012 +0100

installer::download: Remove unused create_link_tree.

Change-Id: I2ec409d25ae46580898dda180d991554d89ee501

diff --git a/solenv/bin/modules/installer/download.pm 
b/solenv/bin/modules/installer/download.pm
index 7c4e23d..fb651a8 100644
--- a/solenv/bin/modules/installer/download.pm
+++ b/solenv/bin/modules/installer/download.pm
@@ -781,32 +781,6 @@ sub get_language_string_from_language_block
 return $newstring;
 }
 
-
-# Creating link tree for upload
-
-
-sub create_link_tree
-{
-my ($sourcedownloadfile, $destfilename, $versionstring) = @_;
-
-if ( ! $installer::globals::ooouploaddir ) { 
installer::exiter::exit_program("ERROR: Directory for LO upload not defined!", 
"create_link_tree"); }
-my $versiondir = $installer::globals::ooouploaddir . 
$installer::globals::separator . $versionstring;
-my $infoline = "Directory for the link: $versiondir\n";
-push(@installer::globals::logfileinfo, $infoline);
-
-if ( ! -d $versiondir ) { 
installer::systemactions::create_directory_structure($versiondir); }
-
-# inside directory $versiondir all links have to be created
-my $linkdestination = $versiondir . $installer::globals::separator . 
$destfilename;
-
-# If there is an older version of this file (link), it has to be removed
-if ( -f $linkdestination ) { unlink($linkdestination); }
-
-$infoline = "Creating hard link from $sourcedownloadfile to 
$linkdestination\n";
-push(@installer::globals::logfileinfo, $infoline);
-installer::systemactions::hardlink_one_file($sourcedownloadfile, 
$linkdestination);
-}
-
 ###
 # Setting supported platform for LibreOffice
 # builds
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2012-08-14 Thread Tim Retout
 solenv/bin/modules/installer/download.pm |   74 ++-
 1 file changed, 5 insertions(+), 69 deletions(-)

New commits:
commit 0038f19b97f5e036870d2210f975358c18e5809e
Author: Tim Retout 
Date:   Tue Aug 14 22:13:55 2012 +0100

Remove unused create_download_link_tree

Change-Id: I319dd0cff6f471fa6ca38d5fcf0f99c462836a83

diff --git a/solenv/bin/modules/installer/download.pm 
b/solenv/bin/modules/installer/download.pm
index 7310bde..7c4e23d 100644
--- a/solenv/bin/modules/installer/download.pm
+++ b/solenv/bin/modules/installer/download.pm
@@ -941,71 +941,4 @@ sub create_download_sets
 return $downloaddir;
 }
 
-
-# Creating LO upload tree
-
-
-sub create_download_link_tree
-{
-my ($downloaddir, $languagestringref, $allvariableshashref) = @_;
-
-my $infoline;
-
-installer::logger::print_message( 
"\n**\n" );
-installer::logger::print_message( "... creating download hard link ...\n" 
);
-installer::logger::print_message( 
"**\n" );
-
-installer::logger::include_header_into_logfile("Creating download hard 
link:");
-installer::logger::include_timestamp_into_logfile("\nPerformance Info: 
Creating hard link, start");
-
-if ( is_supported_platform() )
-{
-my $versionstring = "";
-# Already defined $installer::globals::oooversionstring and 
$installer::globals::ooodownloadfilename ?
-
-if ( ! $installer::globals::oooversionstring ) { $versionstring = 
get_current_version(); }
-else { $versionstring = $installer::globals::oooversionstring; }
-
-# Is $versionstring empty? If yes, there is nothing to do now.
-
-$infoline = "Version string is set to: $versionstring\n";
-push( @installer::globals::logfileinfo, $infoline);
-
-if ( $versionstring )
-{
-# Now the downloadfilename has to be set (if not already done)
-my $destdownloadfilename = "";
-if ( ! $installer::globals::ooodownloadfilename ) { 
$destdownloadfilename = set_download_filename($languagestringref, 
$versionstring, $allvariableshashref); }
-else { $destdownloadfilename = 
$installer::globals::ooodownloadfilename; }
-
-if ( $destdownloadfilename )
-{
-$destdownloadfilename = $destdownloadfilename . 
$installer::globals::downloadfileextension;
-
-$infoline = "Setting destination download file name: 
$destdownloadfilename\n";
-push( @installer::globals::logfileinfo, $infoline);
-
-my $sourcedownloadfile = $downloaddir . 
$installer::globals::separator . $installer::globals::downloadfilename;
-
-$infoline = "Setting source download file name: 
$sourcedownloadfile\n";
-push( @installer::globals::logfileinfo, $infoline);
-
-create_link_tree($sourcedownloadfile, $destdownloadfilename, 
$versionstring);
-}
-}
-else
-{
-$infoline = "Version string is empty. Nothing to do!\n";
-push( @installer::globals::logfileinfo, $infoline);
-}
-}
-else
-{
-$infoline = "Platform not used for hard linking. Nothing to do!\n";
-push( @installer::globals::logfileinfo, $infoline);
-}
-
-installer::logger::include_timestamp_into_logfile("Performance Info: 
Creating hard link, stop");
-}
-
 1;
commit 9b69ef1013d60e655eb4545d1a2af1e2fae8e695
Author: Tim Retout 
Date:   Tue Aug 14 20:16:17 2012 +0100

installer::download: Enable strict and warnings.

Change-Id: I4499968f00e313187ef7792954f3168bfadb2f6e

diff --git a/solenv/bin/modules/installer/download.pm 
b/solenv/bin/modules/installer/download.pm
index b21bbe3..7310bde 100644
--- a/solenv/bin/modules/installer/download.pm
+++ b/solenv/bin/modules/installer/download.pm
@@ -27,6 +27,9 @@
 
 package installer::download;
 
+use strict;
+use warnings;
+
 use File::Spec;
 use installer::exiter;
 use installer::files;
@@ -644,7 +647,7 @@ sub create_tar_gz_file_from_directory
 $installer::globals::downloadfilename = $downloadfilename . 
$installer::globals::downloadfileextension;
 my $targzname = $downloaddir . $installer::globals::separator . 
$installer::globals::downloadfilename;
 
-$systemcall = "cd $changedir; $ldpreloadstring tar -cf - $packdir | gzip > 
$targzname";
+my $systemcall = "cd $changedir; $ldpreloadstring tar -cf - $packdir | 
gzip > $targzname";
 
 my $returnvalue = system($systemcall);
 
@@ -679,7 +682,7 @@ sub resolve_variables_in_downloadname
 if ( $allvariables->{'PRODUCTVERSION'} ) { $productversion = 

[Libreoffice-commits] .: solenv/bin

2012-08-14 Thread Tim Retout
 solenv/bin/modules/installer/download.pm |   58 ---
 1 file changed, 58 deletions(-)

New commits:
commit e6ac2ad7ac9bbdae9ac226a2c8202f627dd0ba8a
Author: Tim Retout 
Date:   Tue Aug 14 08:33:22 2012 +0100

installer::download: Remove unused unicode conversion functions.

Change-Id: Ie4a22b0e88c5509d291b47f4af67ab780d60e3a8

diff --git a/solenv/bin/modules/installer/download.pm 
b/solenv/bin/modules/installer/download.pm
index ac48fe5..b21bbe3 100644
--- a/solenv/bin/modules/installer/download.pm
+++ b/solenv/bin/modules/installer/download.pm
@@ -778,64 +778,6 @@ sub get_language_string_from_language_block
 return $newstring;
 }
 
-##
-# Converting utf 16 file to utf 8
-##
-
-sub convert_utf16_to_utf8
-{
-my ( $filename ) = @_;
-
-my @localfile = ();
-
-my $savfilename = $filename . "_before.utf16";
-installer::systemactions::copy_one_file($filename, $savfilename);
-
-open( IN, "<:encoding(UTF16-LE)", $filename ) || 
installer::exiter::exit_program("ERROR: Cannot open file $filename for 
reading", "convert_utf16_to_utf8");
-while ( $line =  ) {
-push @localfile, $line;
-}
-close( IN );
-
-if ( open( OUT, ">:utf8", $filename ) )
-{
-print OUT @localfile;
-close(OUT);
-}
-
-$savfilename = $filename . "_before.utf8";
-installer::systemactions::copy_one_file($filename, $savfilename);
-}
-
-##
-# Converting utf 8 file to utf 16
-##
-
-sub convert_utf8_to_utf16
-{
-my ( $filename ) = @_;
-
-my @localfile = ();
-
-my $savfilename = $filename . "_after.utf8";
-installer::systemactions::copy_one_file($filename, $savfilename);
-
-open( IN, "<:utf8", $filename ) || installer::exiter::exit_program("ERROR: 
Cannot open file $filename for reading", "convert_utf8_to_utf16");
-while ( $line =  ) {
-push @localfile, $line;
-}
-close( IN );
-
-if ( open( OUT, ">:raw:encoding(UTF16-LE):crlf:utf8", $filename ) )
-{
-print OUT @localfile;
-close(OUT);
-}
-
-$savfilename = $filename . "_after.utf16";
-installer::systemactions::copy_one_file($filename, $savfilename);
-}
-
 
 # Creating link tree for upload
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: solenv/bin

2012-08-13 Thread Tim Retout
 solenv/bin/modules/installer/download.pm |   12 +---
 1 file changed, 5 insertions(+), 7 deletions(-)

New commits:
commit 4b180f51c5cbaaabfcaba6899b5047c89d623cc2
Author: Tim Retout 
Date:   Mon Aug 13 22:18:17 2012 +0100

installer::download: Clean up get_versionstring and make private

Change-Id: I9499b7eb580b499ea63bbf8d6ba5bf45a1c460e1

diff --git a/solenv/bin/modules/installer/download.pm 
b/solenv/bin/modules/installer/download.pm
index 8174067..ac48fe5 100644
--- a/solenv/bin/modules/installer/download.pm
+++ b/solenv/bin/modules/installer/download.pm
@@ -542,18 +542,16 @@ sub get_downloadname_addon
 # This has to be the only content of this file.
 #
 
-sub get_versionstring
+sub _get_versionstring
 {
 my ( $versionfile ) = @_;
 
 my $versionstring = "";
 
-for ( my $i = 0; $i <= $#{$versionfile}; $i++ )
+for ( @{$versionfile} )
 {
-my $oneline = ${$versionfile}[$i];
-
-if ( $oneline =~ /^\s*\#/ ) { next; } # comment line
-if ( $oneline =~ /^\s*\"\s*(.*?)\s*\"\s*$/ )
+next if /^\s*\#/; # comment line
+if ( /^\s*\"\s*(.*?)\s*\"\s*$/ )
 {
 $versionstring = $1;
 last;
@@ -580,7 +578,7 @@ sub get_current_version
 $infoline = "File $filename exists. Trying to find current version.\n";
 push( @installer::globals::logfileinfo, $infoline);
 my $versionfile = installer::files::read_file($filename);
-$versionstring = get_versionstring($versionfile);
+$versionstring = _get_versionstring($versionfile);
 $infoline = "Setting version string: $versionstring\n";
 push( @installer::globals::logfileinfo, $infoline);
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


Re: [PATCH] Replace make_absolute_path with rel2abs in solenv

2012-02-23 Thread Tim Retout
On 23 February 2012 14:37, Caolán McNamara  wrote:
> On Sun, 2012-02-19 at 14:39 +0000, Tim Retout wrote:
>> These three patches remove some home-grown path manipulation from
>> solenv, and replace it with functions shipped with the Perl core.
>
> Sorry, I had revert part of this because under windows we were no longer
> getting any install sets generated. Possibly because of the complexities
> of cygwin paths like /cygdrive/c/foo vs c:\foo and so on

:(

In that case, I'd look closely at the second patch to
installer::ziplist as well; although, File::Spec should handle the
case you mentioned (via File::Spec::Cygwin).

I'll investigate further! Thanks,

-- 
Tim Retout 
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


Re: [PATCH] fix building dictionaries when PERL_UNICODE environment

2012-02-20 Thread Tim Retout
Hi!

On 18 February 2012 22:29, Petr Vorel  wrote:
> I run into troubles while building dictionaries, because I have on my system
> set PERL_UNICODE=SDL (perl script
> clone/dictionaries/dictionaries/util/th_check.pl dies as it's forced to use
> UTF-8, but not all dictionaries are in this encoding).

Interesting, I'd never seen this environment variable before. :)

First, setting this to "SDL" emulates the behaviour of Perl 5.8.0 -
this was deliberately fixed in 5.8.1 (see the perlrun and perl581delta
docs), so I would be careful about putting it in your environment.
It's likely to break more than just LibreOffice.

I am tempted to push your patch as a temporary fix, but there must be
a better way to handle this long-term... I'll check that I can
reproduce the problem, first.

As an idea, would it be possible to identify and re-encode the
dictionaries themselves as UTF-8?  After which we could set the
encoding of the filehandles explicitly in th_check.pl.

Kind regards,

-- 
Tim Retout 
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


Re: Minimum Perl version requirement (was: Re: [PUSHED] Replace make_absolute_path with rel2abs in solenv)

2012-02-20 Thread Tim Retout
On 20 February 2012 16:07, Michael Meeks  wrote:
>        I poked Fridrich, the oracle on this sort of thing - wrt. our old
> build-systems. On windows we have perl 5.10 but on Linux 5.8.8 ( we have
> an artificially old Linux machine to produce forward-compatible builds).

There are some nice things in 5.10 - "defined-or", named regexp
captures, given/when...

5.8 is just about okay - it's what I still use at work ;) - so I'll
ping you again in 3 years or so. :)

-- 
Tim Retout 
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


Minimum Perl version requirement (was: Re: [PUSHED] Replace make_absolute_path with rel2abs in solenv)

2012-02-20 Thread Tim Retout
On 20 February 2012 11:30, Michael Meeks  wrote:
> On Sun, 2012-02-19 at 14:39 +0000, Tim Retout wrote:
>        Great :-) thanks for that, it's always nice to use standard methods
> instead of custom / hand-coded ones. Clearly we want to introduce new
> perl dependencies on shared modules only with some care - it's nice
> having solenv/ be reasonably self-contained.

Indeed - a useful tool is 'corelist', which will print the first
version of Perl which shipped a given CPAN module in the core:

$ corelist File::Spec

File::Spec was first released with perl 5.00405

(i.e. Perl 5.4)

Which leads to the question: what is the minimum version of Perl we
can rely on in LibreOffice?  Currently configure.in checks for Perl 5,
but the Perl currently in solenv almost certainly requires Perl 5.8
(first released 2002).

Even Perl 5.10 (first released 2007) is no longer maintained upstream,
although it is still the one shipped in Debian squeeze/lenny (current
stable/oldstable):

 http://www.cpan.org/src/
 http://packages.debian.org/squeeze/perl

Would it be reasonable to bump the configure.in check to look for Perl
5.10, for now?  I might try to replace the macro with one from the
autoconf archive:

http://git.savannah.gnu.org/gitweb/?p=autoconf-archive.git;a=blob_plain;f=m4/ax_prog_perl_version.m4

Kind regards,

-- 
Tim Retout 
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


[PATCH] Replace make_absolute_path with rel2abs in solenv

2012-02-19 Thread Tim Retout
These three patches remove some home-grown path manipulation from
solenv, and replace it with functions shipped with the Perl core.

Kind regards,

-- 
Tim Retout 
From 65e81a1935604058082929e772e2f789533eb610 Mon Sep 17 00:00:00 2001
From: Tim Retout 
Date: Sun, 19 Feb 2012 12:45:56 +
Subject: [PATCH 1/3] Remove unused pre2par::parameter::make_path_absolute

---
 solenv/bin/modules/pre2par/parameter.pm |   29 -
 1 files changed, 0 insertions(+), 29 deletions(-)

diff --git a/solenv/bin/modules/pre2par/parameter.pm b/solenv/bin/modules/pre2par/parameter.pm
index a39dbd0..efda79d 100644
--- a/solenv/bin/modules/pre2par/parameter.pm
+++ b/solenv/bin/modules/pre2par/parameter.pm
@@ -130,35 +130,6 @@ sub control_parameter
 pre2par::files::check_file($pre2par::globals::prefilename);
 }
 
-##
-# The path parameters can be relative or absolute.
-# This function creates absolute paths.
-##
-
-sub make_path_absolute
-{
-my ($pathref) = @_;
-
-if ( $pre2par::globals::isunix )
-{
-if (!($$pathref =~ /^\s*\//))   # this is a relative unix path
-{
-$$pathref = cwd() . $pre2par::globals::separator . $$pathref;
-}
-}
-
-if ( $pre2par::globals::iswin )
-{
-if (!($$pathref =~ /^\s*\w\:/)) # this is a relative windows path
-{
-$$pathref = cwd() . $pre2par::globals::separator . $$pathref;
-$$pathref =~ s/\//\\/g;
-}
-}
-
-$$pathref =~ s/\Q$pre2par::globals::separator\E\s*$//;  # removing ending slashes
-}
-
 #
 # Writing parameter to shell
 #
-- 
1.7.8.3

From ca4f8f6a043b4883f67bb8489114eab75f5ecc21 Mon Sep 17 00:00:00 2001
From: Tim Retout 
Date: Sun, 19 Feb 2012 14:04:09 +
Subject: [PATCH 2/3] Avoid using installer::parameter in installer::ziplist

---
 solenv/bin/modules/installer/ziplist.pm |9 +
 1 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/solenv/bin/modules/installer/ziplist.pm b/solenv/bin/modules/installer/ziplist.pm
index 5ee0bb6..6435445 100644
--- a/solenv/bin/modules/installer/ziplist.pm
+++ b/solenv/bin/modules/installer/ziplist.pm
@@ -27,10 +27,11 @@
 
 package installer::ziplist;
 
+use File::Spec::Functions qw(rel2abs);
+
 use installer::exiter;
 use installer::globals;
 use installer::logger;
-use installer::parameter;
 use installer::remover;
 use installer::systemactions;
 
@@ -702,10 +703,10 @@ sub resolve_relative_pathes
 {
 my ( $patharrayref ) = @_;
 
-for ( my $i = 0; $i <= $#{$patharrayref}; $i++ )
+for my $path ( @{$patharrayref} )
 {
-installer::parameter::make_path_absolute(\${$patharrayref}[$i]);
-simplify_path(\${$patharrayref}[$i]);
+$path = rel2abs($path);
+simplify_path(\$path);
 }
 }
 
-- 
1.7.8.3

From 4842da3479edaba35bdeb3044992d07a596e17e9 Mon Sep 17 00:00:00 2001
From: Tim Retout 
Date: Sun, 19 Feb 2012 13:14:22 +
Subject: [PATCH 3/3] Replace installer::parameter::make_absolute_path.

---
 solenv/bin/modules/installer/parameter.pm |   62 +++--
 1 files changed, 6 insertions(+), 56 deletions(-)

diff --git a/solenv/bin/modules/installer/parameter.pm b/solenv/bin/modules/installer/parameter.pm
index 3ea13f8..7335c01 100644
--- a/solenv/bin/modules/installer/parameter.pm
+++ b/solenv/bin/modules/installer/parameter.pm
@@ -28,6 +28,8 @@
 package installer::parameter;
 
 use Cwd;
+use File::Spec::Functions qw(rel2abs);
+
 use installer::exiter;
 use installer::files;
 use installer::globals;
@@ -195,58 +197,6 @@ sub control_fundamental_parameter
 }
 }
 
-##
-# The path parameters can be relative or absolute.
-# This function creates absolute paths.
-##
-
-sub make_path_absolute
-{
-my ($pathref) = @_;
-
-if ( $installer::globals::isunix )
-{
-if (!($$pathref =~ /^\s*\//))   # this is a relative unix path
-{
-$$pathref = cwd() . $installer::globals::separator . $$pathref;
-}
-}
-
-if ( $installer::globals::iswin )
-{
-if ( $^O =~ /cygwin/i )
-{
-if ( $$pathref !~ /^\s*\// && $$pathref !~ /^\s*\w\:/ ) # not an absolute POSIX or DOS path
-{
-$$pathref = cwd() . $installer::globals::separator . $$pathref;
-}
-my $p = $$pathref;
-chomp( $p );
-my $q = '';
-# Avoid the $(LANG) problem.
-if ($p =~ /(\A.*)(\$\(.*\Z)/) {
-$p = $1;
-$q = $2;
-}
-$p =~ s/\\//g;
-chomp( $p = qx{cygpath -w "$p"} );
-$$pathref = $p.$q;
-# U

Unused solenv tools - can I remove these?

2012-02-18 Thread Tim Retout
Could someone help me figure out whether these solenv tools are used
anywhere?  :)  I'm trying to shrink the LO Perl line count.

Probably unused:

concat-deps.pl   # recently replaced with a C implementation
convertlinks.pl# specific to api.openoffice.org
gen_userfeedback_VCL_names.pl
licinserter.pl
mkdir.pl
oochkpatch# Never called?
oochkpatch.pl # Used only by oochkpatch
rmdir.pl
touch.pl # 4nt support was removed in ae0228c

Possibly unused:

cleandiff.pl   # used in 'create_patch' target of
solenv/inc/tg_ext.mk, but I can't find 'create_patch' in any
makefiles.  Is this likely to be called manually?

Look unused, but probably aren't:

make_download.pl # looks like it ought to be really important, from the name
remangle32to64.pl # Committed in Jan 2011, seems relevant to w64 porting.

-- 
Tim Retout 
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


[PATCH] Remove installer debug logging.

2012-02-18 Thread Tim Retout
Hi,

The -debug option to make_installer.pl is not usually called; it logs
function calls at various points during the installer.  However, it is
not used consistently within the code, and the same information can be
obtained via the Perl debugger or profiling tools.

Kind regards,

-- 
Tim Retout 
From 68d629a9195a3f54fea313b89f72bbe5ecbe0db6 Mon Sep 17 00:00:00 2001
From: Tim Retout 
Date: Sat, 18 Feb 2012 13:28:08 +
Subject: [PATCH] Remove installer debug logging.

The -debug option to make_installer.pl is not usually called; it logs
function calls at various points during the installer.  However, it is
not used consistently within the code, and the same information can be
obtained via the Perl debugger or profiling tools.
---
 solenv/bin/make_installer.pl |   29 --
 solenv/bin/modules/installer/archivefiles.pm |2 -
 solenv/bin/modules/installer/exiter.pm   |4 --
 solenv/bin/modules/installer/files.pm|   16 --
 solenv/bin/modules/installer/globals.pm  |3 -
 solenv/bin/modules/installer/logger.pm   |   27 -
 solenv/bin/modules/installer/parameter.pm|   19 ---
 solenv/bin/modules/installer/scriptitems.pm  |   74 --
 8 files changed, 0 insertions(+), 174 deletions(-)

diff --git a/solenv/bin/make_installer.pl b/solenv/bin/make_installer.pl
index a823306..23fea7a 100644
--- a/solenv/bin/make_installer.pl
+++ b/solenv/bin/make_installer.pl
@@ -120,10 +120,6 @@ installer::environment::set_global_environment_variables($environmentvariablesha
 installer::parameter::saveparameter();
 installer::parameter::getparameter();
 
-# debugging can start after function "getparameter"
-if ( $installer::globals::debug ) { installer::logger::debuginfo("\nPart 1: The platform independent part\n"); }
-if ( $installer::globals::debug ) { installer::logger::debuginfo("\nPart 1a: The language independent part\n"); }
-
 installer::parameter::control_fundamental_parameter();
 installer::parameter::setglobalvariables();
 installer::parameter::control_required_parameter();
@@ -594,11 +590,6 @@ if (!($installer::globals::is_copy_only_project))
 if ( $installer::globals::globallogging ) { installer::files::save_array_of_hashes($loggingdir . "productdirectories2aa.log", $dirsinproductarrayref); }
 }
 
-if ( $installer::globals::debug ) { installer::logger::debuginfo("\nEnd of part 1a: The language independent part\n"); }
-
-# saving debug info, before staring part 1b
-if ( $installer::globals::debug ) { installer::logger::savedebug($installer::globals::exitlog); }
-
 #
 # Part 1b: The language dependent part
 # (still platform independent)
@@ -612,8 +603,6 @@ if ( $installer::globals::debug ) { installer::logger::savedebug($installer::glo
 # The for iterates over all products, separated by an # in the language list
 ###
 
-if ( $installer::globals::debug ) { installer::logger::debuginfo("\nPart 1b: The language dependent part\n"); }
-
 for ( my $n = 0; $n <= $#installer::globals::languageproducts; $n++ )
 {
 my $languagesarrayref = installer::languages::get_all_languages_for_one_product($installer::globals::languageproducts[$n], $allvariableshashref);
@@ -1217,23 +1206,14 @@ for ( my $n = 0; $n <= $#installer::globals::languageproducts; $n++ )
 installer::packagelist::log_packages_content($packages);
 installer::packagelist::create_module_destination_hash($packages, $allvariableshashref);
 
-if ( $installer::globals::debug ) { installer::logger::debuginfo("\nEnd of part 1b: The language dependent part\n"); }
-
-# saving debug info, before starting part 2
-if ( $installer::globals::debug ) { installer::logger::savedebug($installer::globals::exitlog); }
-
 #
 # Part 2: The platform dependent part
 #
 
-if ( $installer::globals::debug ) { installer::logger::debuginfo("\nPart 2: The platform dependent part\n"); }
-
 #
 # Part 2a: All non-Windows platforms
 #
 
-if ( $installer::globals::debug ) { installer::logger::debuginfo("\nPart 2a: All non-Windows platforms\n"); }
-
 #
 # ... creating epm list file ...
 # Only for non-Windows platforms
@@ -1767,14 +1747,10 @@ for ( my $n = 0; $n <= $#installer::globals::languageproducts; $n++ )
 }
 }   # end of "if (!( $installer::globals::iswindowsbuild ))"
 
-if ( $installer::globals::debug ) { installer::logger::debuginfo("\nEnd of part 2a: All non-Windows platforms\n"); }
-
 #

[PATCH] Remove various unused Perl functions from installer

2012-02-16 Thread Tim Retout
These patches remove some unused functions from installer::worker and
installer::download.

The unpack_all_targzfiles_in_directory sub only becomes unused after
copy_install_sets_to_ship is removed.

Kind regards,

-- 
Tim Retout 
From 6929246241ca9ee034bc36ad98e9c1b7f60ef492 Mon Sep 17 00:00:00 2001
From: Tim Retout 
Date: Thu, 16 Feb 2012 22:52:08 +
Subject: [PATCH 1/6] Remove unused md5sum subs from installer::download

---
 solenv/bin/modules/installer/download.pm |   64 --
 1 files changed, 0 insertions(+), 64 deletions(-)

diff --git a/solenv/bin/modules/installer/download.pm b/solenv/bin/modules/installer/download.pm
index 5f186b7..facdd16 100644
--- a/solenv/bin/modules/installer/download.pm
+++ b/solenv/bin/modules/installer/download.pm
@@ -157,70 +157,6 @@ sub put_checksum_and_size_into_script
 }
 
 #
-# Calling md5sum
-#
-
-sub call_md5sum
-{
-my ($filename) = @_;
-
-$md5sumfile = "/usr/bin/md5sum";
-
-if ( ! -f $md5sumfile ) { installer::exiter::exit_program("ERROR: No file /usr/bin/md5sum", "call_md5sum"); }
-
-my $systemcall = "$md5sumfile $filename |";
-
-my $md5sumoutput = "";
-
-open (SUM, "$systemcall");
-$md5sumoutput = ;
-close (SUM);
-
-my $returnvalue = $?;   # $? contains the return value of the 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);
-}
-
-return $md5sumoutput;
-}
-
-#
-# Calling md5sum
-#
-
-sub get_md5sum
-{
-($md5sumoutput) = @_;
-
-my $md5sum;
-
-if  ( $md5sumoutput =~ /^\s*(\w+?)\s+/ )
-{
-$md5sum = $1;
-}
-else
-{
-installer::exiter::exit_program("ERROR: Incorrect return value from /usr/bin/md5sum: $md5sumoutput", "get_md5sum");
-}
-
-my $infoline = "Setting md5sum: $md5sum\n";
-push( @installer::globals::logfileinfo, $infoline);
-
-return $md5sum;
-}
-
-#
 # Determining checksum and size of tar file
 #########
 
-- 
1.7.8.3

From 3d5447af462cf476cdd2afc0a089b37151ca8988 Mon Sep 17 00:00:00 2001
From: Tim Retout 
Date: Thu, 16 Feb 2012 22:55:18 +
Subject: [PATCH 2/6] Remove unused solaris subs from installer::worker

---
 solenv/bin/modules/installer/worker.pm |  135 
 1 files changed, 0 insertions(+), 135 deletions(-)

diff --git a/solenv/bin/modules/installer/worker.pm b/solenv/bin/modules/installer/worker.pm
index 445f1dc..5bc052f 100644
--- a/solenv/bin/modules/installer/worker.pm
+++ b/solenv/bin/modules/installer/worker.pm
@@ -2439,141 +2439,6 @@ sub filter_pkgmapfile
 return \@pkgmap;
 }
 
-##
-# Creating double packages for Solaris x86.
-# One package with ARCH=i386 and one with
-# ARCH=i86pc.
-##
-
-sub fix_solaris_x86_patch
-{
-my ($packagename, $subdir) = @_;
-
-# changing into directory of packages, important for soft linking
-my $startdir = cwd();
-chdir($subdir);
-
-# $packagename is: "SUNWstaroffice-core01"
-# Current working directory is: "/install/en-US_inprogress"
-
-# create new folder in "packages": $packagename . ".i"
-my $newpackagename = $packagename . "\.i";
-my $newdir = $newpackagename;
-installer::systemactions::create_directory($newdir);
-
-# collecting all directories in the package
-my $olddir = $packagename;
-my $allsubdirs = installer::systemactions::get_all_directories_without_path($olddir);
-
-# link all directories from $packagename to $packagename . ".i"
-for ( my $i = 0; $i <= $#{$allsubdirs}; $i++ )
-{
-my $sourcedir = $olddir . $installer::globals::separator . ${$allsubdirs}[$i];
-my $destdir = $newdir . $installer::globals::separator . ${$allsubdirs}[$i];
-my $directory_depth = 2; # important for soft links, two directories already exist
-installer::systemactions::softlink_complete_directory($sourcedir, $destdir, $directory_depth);
-}
-
-# copy "pkginfo" and "pkgmap" from $packagename to $packagename . ".i"
-my @allcopyfiles = 

[PATCH] Initial cleanup of installer::logger

2012-02-16 Thread Tim Retout
Hi,

This patch series removes some unused functions from
installer::logger, and merges two very similar functions.  Plus
general cleanup.

Kind regards,

-- 
Tim Retout 
From 35b6a2c9ae816cbb99dbe4e79cae7115fdd26137 Mon Sep 17 00:00:00 2001
From: Tim Retout 
Date: Thu, 16 Feb 2012 19:46:12 +
Subject: [PATCH 1/5] Remove unreferenced subroutines from installer::logger

---
 solenv/bin/modules/installer/logger.pm |   44 
 1 files changed, 0 insertions(+), 44 deletions(-)

diff --git a/solenv/bin/modules/installer/logger.pm b/solenv/bin/modules/installer/logger.pm
index 0130369..f86c4df 100644
--- a/solenv/bin/modules/installer/logger.pm
+++ b/solenv/bin/modules/installer/logger.pm
@@ -247,19 +247,6 @@ sub get_time_string
 }
 
 ###
-# Returning the age of a file (in seconds)
-###
-
-sub get_file_age
-{
-my ( $filename ) = @_;
-
-my $filetime = (stat($filename))[9];
-my $timediff = time() - $filetime;
-return $timediff;
-}
-
-###
 # Stopping the time
 ###
 
@@ -270,29 +257,6 @@ sub stoptime
 }
 
 ###
-# Set date string, format: yymmdd
-###
-
-sub set_installation_date
-{
-my $datestring = "";
-
-my @timearray = localtime(time);
-
-my $day = $timearray[3];
-my $month = $timearray[4] + 1;
-my $year = $timearray[5] - 100;
-
-if ( $year < 10 ) { $year = "0" . $year; }
-if ( $month < 10 ) { $month = "0" . $month; }
-if ( $day < 10 ) { $day = "0" . $day; }
-
-$datestring = $year . $month . $day;
-
-return $datestring;
-}
-
-###
 # Console output: messages
 ###
 
@@ -305,14 +269,6 @@ sub print_message
 return;
 }
 
-sub print_message_without_newline
-{
-my $message = shift;
-chomp $message;
-print "$message" if ( ! $installer::globals::quiet );
-return;
-}
-
 ###
 # Console output: warnings
 ###
-- 
1.7.8.3

From 29f1b00bc2c97684ade08de6b238e761e66aad51 Mon Sep 17 00:00:00 2001
From: Tim Retout 
Date: Thu, 16 Feb 2012 20:22:42 +
Subject: [PATCH 2/5] Use Exporter in installer::logger.

Also rename private subroutines to start with an underscore.
---
 solenv/bin/modules/installer/logger.pm |   34 ---
 1 files changed, 26 insertions(+), 8 deletions(-)

diff --git a/solenv/bin/modules/installer/logger.pm b/solenv/bin/modules/installer/logger.pm
index f86c4df..2ec0360 100644
--- a/solenv/bin/modules/installer/logger.pm
+++ b/solenv/bin/modules/installer/logger.pm
@@ -30,9 +30,27 @@ package installer::logger;
 use strict;
 use warnings;
 
+use base 'Exporter';
+
 use installer::files;
 use installer::globals;
 
+our @EXPORT_OK = qw(
+include_header_into_logfile
+include_header_into_globallogfile
+include_timestamp_into_logfile
+log_hashref
+globallog
+copy_globalinfo_into_logfile
+debuginfo
+savedebug
+starttime
+stoptime
+print_message
+print_warning
+print_error
+);
+
 
 # Including header files into the logfile
 
@@ -43,7 +61,7 @@ sub include_header_into_logfile
 
 my $infoline;
 
-$infoline = "\n" . get_time_string();
+$infoline = "\n" . _get_time_string();
 push( @installer::globals::logfileinfo, $infoline);
 
 $infoline = "##\n";
@@ -67,7 +85,7 @@ sub include_header_into_globallogfile
 
 my $infoline;
 
-$infoline = "\n" . get_time_string();
+$infoline = "\n" . _get_time_string();
 push( @installer::globals::globallogfileinfo, $infoline);
 
 $infoline = "##\n";
@@ -90,7 +108,7 @@ sub include_timestamp_into_logfile
 my ($message) = @_;
 
 my $infoline;
-my $timestring = get_time_string();
+my $timestring = _get_time_string();
 $infoline = "$message\t$timestring";
 push( @installer::globals::logfileinfo, $infoline);
 }
@@ -131,7 +149,7 @@ sub globallog
 
 my $infoline;
 
-$infoline = "\n" . get_time_string();
+$infoline = "\n" . _get_time_string();
 push( @installer::globals::globallogfileinfo, $infoline);
 
 $infoline = "#

[PATCH] Inline and remove installer::sorter

2012-02-16 Thread Tim Retout
Hi,

I didn't expect my previous patch series to be merged so quickly!
This follow-up patch removes the installer::sorter module altogether -
the Schwartzian transform was not appropriate, as the overhead of
map-sort-map is greater than just looking up the hash values for most
workloads.

So this also removes Libreoffice's only Perl unit test. ;)

-- 
Tim Retout 
From 3bef665d3939fd9b714bc783ac691ccb737be823 Mon Sep 17 00:00:00 2001
From: Tim Retout 
Date: Thu, 16 Feb 2012 18:58:20 +
Subject: [PATCH] Inline and remove installer::sorter

---
 solenv/bin/make_installer.pl|7 ++--
 solenv/bin/modules/installer/sorter.pm  |   53 ---
 solenv/bin/modules/t/installer-sorter.t |   48 
 3 files changed, 3 insertions(+), 105 deletions(-)
 delete mode 100644 solenv/bin/modules/installer/sorter.pm
 delete mode 100644 solenv/bin/modules/t/installer-sorter.t

diff --git a/solenv/bin/make_installer.pl b/solenv/bin/make_installer.pl
index 45dede0..08c118b 100644
--- a/solenv/bin/make_installer.pl
+++ b/solenv/bin/make_installer.pl
@@ -57,7 +57,6 @@ use installer::scpzipfiles;
 use installer::scriptitems;
 use installer::setupscript;
 use installer::simplepackage;
-use installer::sorter qw(sorting_array_of_hashes);
 use installer::strip;
 use installer::substfilenamefiles;
 use installer::systemactions;
@@ -1101,7 +1100,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); }
-sorting_array_of_hashes($directoriesforepmarrayref, "HostName");
+@$directoriesforepmarrayref = sort { $a->{"HostName"} cmp $b->{"HostName"} } @$directoriesforepmarrayref;
 if ( $installer::globals::globallogging ) { installer::files::save_array_of_hashes($loggingdir . "directoriesforepmlist3clangpack.log", $directoriesforepmarrayref); }
 
 if ( $installer::globals::iswindowsbuild )
@@ -1130,7 +1129,7 @@ for ( my $n = 0; $n <= $#installer::globals::languageproducts; $n++ )
 if ( $installer::globals::globallogging ) { installer::files::save_array_of_hashes($loggingdir . "directoriesforepmlist3ahelppack.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 . "directoriesforepmlist3bhelppack.log", $directoriesforepmarrayref); }
-sorting_array_of_hashes($directoriesforepmarrayref, "HostName");
+@$directoriesforepmarrayref = sort { $a->{"HostName"} cmp $b->{"HostName"} } @$directoriesforepmarrayref;
 if ( $installer::globals::globallogging ) { installer::files::save_array_of_hashes($loggingdir . "directoriesforepmlist3chelppack.log", $directoriesforepmarrayref); }
 
 if ( $installer::globals::iswindowsbuild )
@@ -1171,7 +1170,7 @@ for ( my $n = 0; $n <= $#installer::globals::languageproducts; $n++ )
 ($directoriesforepmarrayref, $alldirectoryhash) = installer::scriptitems::collect_directories_from_filesarray($filesinproductlanguageresolvedarrayref);
 if ( $installer::globals::globallogging ) { installer::files::save_array_of_hashes($loggingdir . "directoriesforepmlist4_patch.log", $directoriesforepmarrayref); }
 
-sorting_array_of_hashes($directoriesforepmarrayref, "HostName");
+@$directoriesforepmarrayref = sort { $a->{"HostName"} cmp $b->{"HostName"} } @$directoriesforepmarrayref;
 if ( $installer::globals::globallogging ) { installer::files::save_array_of_hashes($loggingdir . "directoriesforepmlist5_patch.log", $directoriesforepmarrayref); }
 }
 }
diff --git a/solenv/bin/modules/installer/sorter.pm b/solenv/bin/modules/installer/sorter.pm
deleted file mode 100644
index b08dd80..000
--- a/solenv/bin/modules/installer/sorter.pm
+++ /dev/null
@@ -1,53 +0,0 @@
-#*
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-pl

Re: [PUSHED] Refactor installer::sorter

2012-02-16 Thread Tim Retout
On 16 February 2012 17:46, Markus Mohrhard
 wrote:
> Lovely. It is always a great pleasure to see more tests in our code base ;)
>
> Do you see a benefit for us if we execute the test regularly? If so we
> can search for a nice place where we can integrate the test into our
> build system and execute it during a build.

In this case, I'm about to mail in a patch that removes
installer::sorter (and its test) altogether. :(

But in general, I think it would be worth adding Perl unit tests into
the build - I guess when 'make check' is called?  I'll have some more
tests soon.

-- 
Tim Retout 
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


Re: [PUSHED] Turn on strictures for some installer Perl modules

2012-02-16 Thread Tim Retout
On 15 February 2012 11:58, Michael Meeks  wrote:
>        Also the 'make_installer.pl' takes about 20 options, AFAIR there are
> however only a few legitimate parameters / configurations that are
> possible in the LibreOffice world.
>
>        So - digging out the call sites (luckily the ooinstall wrapper seems to
> have swallowed most of them outside of instsetoo_native) and simplifying
> those paths would prolly expose much more redundancy to perl.

Ah, thanks for pointing me to that.  There's some nice cleanup
possible in installer::parameter.

>        Norbert reports you want:
>
>        make cmd cmd="solenv/bin/ooinstall ..."

Running this under Devel::NYTProf, I found that a good deal of the
slowness of make_installer.pl was due to Archive::Zip, which could be
replaced by a call to 'unzip'.  So some more nice cleanup should be
possible in installer::archivefiles. :)

Kind regards,

-- 
Tim Retout 
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


Re: [PATCH] Refactor installer::sorter

2012-02-16 Thread Tim Retout
On 15 February 2012 21:58, Tim Retout  wrote:
> subroutines, and replaced the third with a Schwartzian Transform
> (which might be overkill for this case, but I need to check the
> callers).

Yeah, I've woken up and benchmarked this, and the complexity just
makes it slower compared to just doing the hash lookups.  So I'll
probably revise or add to the last few patches later to just inline
installer::sorter altogether.

-- 
Tim Retout 
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


Refactor installer::sorter

2012-02-15 Thread Tim Retout
Hi!

Here are a few patches related to installer::sorter.  I've tried to
keep them low-risk, because much of the code is called during Windows
builds, which I'm not yet testing.

I think the sort algorithm used currently in installer::sorter must be
equivalent to bubble sort; in any case, I removed two of the
subroutines, and replaced the third with a Schwartzian Transform
(which might be overkill for this case, but I need to check the
callers).

I added a unit test for the remaining sort function, but I haven't
tried to plug it in to the build system or anything.  I tried to adapt
the standard license header template to Perl comments.

Kind regards,

-- 
Tim Retout 
From ba069516f1e512552a00a45cb7900822fab95ae3 Mon Sep 17 00:00:00 2001
From: Tim Retout 
Date: Wed, 15 Feb 2012 18:02:44 +
Subject: [PATCH 1/6] Turn on strictures in installer::sorter

---
 solenv/bin/modules/installer/sorter.pm |3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/solenv/bin/modules/installer/sorter.pm b/solenv/bin/modules/installer/sorter.pm
index dd983c06..4f3b9eb 100644
--- a/solenv/bin/modules/installer/sorter.pm
+++ b/solenv/bin/modules/installer/sorter.pm
@@ -27,6 +27,9 @@
 
 package installer::sorter;
 
+use strict;
+use warnings;
+
 #
 # Sorting an array of hashes
 #
-- 
1.7.8.3

From 2328049c111c5979e7ed10aa9fce8740f17ebd88 Mon Sep 17 00:00:00 2001
From: Tim Retout 
Date: Wed, 15 Feb 2012 19:17:04 +
Subject: [PATCH 2/6] Remove unnecessary sorting subroutines.

---
 solenv/bin/modules/installer/sorter.pm |   26 --
 solenv/bin/modules/installer/worker.pm |   20 +---
 2 files changed, 1 insertions(+), 45 deletions(-)

diff --git a/solenv/bin/modules/installer/sorter.pm b/solenv/bin/modules/installer/sorter.pm
index 4f3b9eb..b61bb5b 100644
--- a/solenv/bin/modules/installer/sorter.pm
+++ b/solenv/bin/modules/installer/sorter.pm
@@ -90,30 +90,4 @@ sub sort_array_of_hashes_numerically
 }
 }
 
-#
-# Sorting an array of of strings
-#
-
-sub sorting_array_of_strings
-{
-my ($arrayref) = @_;
-
-for ( my $i = 0; $i <= $#{$arrayref}; $i++ )
-{
-my $onestringunder = ${$arrayref}[$i];
-
-for ( my $j = $i + 1; $j <= $#{$arrayref}; $j++ )
-{
-my $onestringover = ${$arrayref}[$j];
-
-if ( $onestringunder gt $onestringover)
-{
-${$arrayref}[$i] = $onestringover;
-${$arrayref}[$j] = $onestringunder;
-$onestringunder = $onestringover;
-}
-}
-}
-}
-
 1;
diff --git a/solenv/bin/modules/installer/worker.pm b/solenv/bin/modules/installer/worker.pm
index c91ece7..445f1dc 100644
--- a/solenv/bin/modules/installer/worker.pm
+++ b/solenv/bin/modules/installer/worker.pm
@@ -42,7 +42,6 @@ use installer::logger;
 use installer::pathanalyzer;
 use installer::scpzipfiles;
 use installer::scriptitems;
-use installer::sorter;
 use installer::systemactions;
 use installer::windows::language;
 
@@ -1533,23 +1532,6 @@ sub shift_file_to_end
 }
 
 ###
-# Putting hash content into array and sorting it
-###
-
-sub sort_hash
-{
-my ( $hashref ) =  @_;
-
-my $item = "";
-my @sortedarray = ();
-
-foreach $item (keys %{$hashref}) { push(@sortedarray, $item); }
-installer::sorter::sorting_array_of_strings(\@sortedarray);
-
-return \@sortedarray;
-}
-
-###
 # Renaming Windows files in Patch and creating file
 # patchfiles.txt
 ###
@@ -1611,7 +1593,7 @@ sub prepare_windows_patchfiles
 my $patchlistfile = installer::existence::get_specified_file_by_name($filesref, $patchfilename);
 
 # reorganizing the patchfile content, sorting for directory to decrease the file size
-my $sorteddirectorylist = sort_hash(\%patchfiledirectories);
+my $sorteddirectorylist = [ sort keys %patchfiledirectories ];
 my $patchfilelist = reorg_patchfile(\@patchfiles, $sorteddirectorylist);
 
 # shifting version.ini to the end of the list, to guarantee, that all files are patched
-- 
1.7.8.3

From 11df243b53f42348a1b6b697719ceef9c21688e1 Mon Sep 17 00:00:00 2001
From: Tim Retout 
Date: Wed, 15 Feb 2012 19:55:46 +
Subject: [PATCH 3/6] Inline and simplify
 installer::sorter::sort_array_of_hashes_numerically.

---
 solenv/bin/modules/installer/sorter.pm  |   30 ---
 solenv/bin/modules/installer/windows/feature.pm |   13 --
 2 files changed, 5 insertions(+), 38 deletions(-)

diff --git a/solenv/bin/modules/installer/sorter.pm b/solenv/bin/modules/installer/sorter.pm
index b61bb5b..91ed9ae 

[PATCH] Turn on strictures for some installer Perl modules

2012-02-14 Thread Tim Retout
Hi,

I'd like to try to clean up some of the code in the solenv Perl
modules - as a first task, I want to turn on 'use strict', which I'd
consider a bare minimum for maintainable Perl.  Longer-term,
Perl::Critic flags up lots of nice stuff, and then there's performance
and so on.

My first few attempts at this have ended up ballooning into large
tasks - for instance, there seem to be lots of unused subroutines in
the installer code, which could safely be removed.  But I then end up
not sending in any patches, and have no idea if I'm going way beyond
what's acceptable. :)

So here's a first small patch that should be quite safe.

One thing I'd like to check: is the best way to test make_installer.pl to run:

  source config_host.mk
  solenv/bin/ooinstall /tmp/foo

(I get a few errors when sourcing config_host.mk.)

I've added my name to
https://wiki.documentfoundation.org/Development/Developers with a link
to my previous license statement on the mailing list.

Kind regards,

-- 
Tim Retout 
From 4548143f004c2d04b77c608bc6d0a52146b0461f Mon Sep 17 00:00:00 2001
From: Tim Retout 
Date: Tue, 14 Feb 2012 22:19:46 +
Subject: [PATCH] Turn on strictures for some installer Perl modules.

---
 solenv/bin/modules/installer/copyproject.pm |3 +++
 solenv/bin/modules/installer/exiter.pm  |3 +++
 solenv/bin/modules/installer/files.pm   |5 -
 solenv/bin/modules/installer/logger.pm  |3 +++
 4 files changed, 13 insertions(+), 1 deletions(-)

diff --git a/solenv/bin/modules/installer/copyproject.pm b/solenv/bin/modules/installer/copyproject.pm
index 8157db4..2e4f93a 100644
--- a/solenv/bin/modules/installer/copyproject.pm
+++ b/solenv/bin/modules/installer/copyproject.pm
@@ -27,6 +27,9 @@
 
 package installer::copyproject;
 
+use strict;
+use warnings;
+
 use installer::control;
 use installer::converter;
 use installer::files;
diff --git a/solenv/bin/modules/installer/exiter.pm b/solenv/bin/modules/installer/exiter.pm
index 18b3b31..243bef4 100644
--- a/solenv/bin/modules/installer/exiter.pm
+++ b/solenv/bin/modules/installer/exiter.pm
@@ -27,6 +27,9 @@
 
 package installer::exiter;
 
+use strict;
+use warnings;
+
 use installer::files;
 use installer::globals;
 use installer::logger;
diff --git a/solenv/bin/modules/installer/files.pm b/solenv/bin/modules/installer/files.pm
index 73ea267..379144e 100644
--- a/solenv/bin/modules/installer/files.pm
+++ b/solenv/bin/modules/installer/files.pm
@@ -27,6 +27,9 @@
 
 package installer::files;
 
+use strict;
+use warnings;
+
 use installer::exiter;
 use installer::logger;
 
@@ -58,7 +61,7 @@ sub read_file
 #   Don't use "my @localfile = " here, because
 #   perl has a problem with the internal "large_and_huge_malloc" function
 #   when calling perl using MacOS 10.5 with a perl built with MacOS 10.4
-while ( $line =  ) {
+while ( my $line =  ) {
 push @localfile, $line;
 }
 
diff --git a/solenv/bin/modules/installer/logger.pm b/solenv/bin/modules/installer/logger.pm
index c5982c6..0130369 100644
--- a/solenv/bin/modules/installer/logger.pm
+++ b/solenv/bin/modules/installer/logger.pm
@@ -27,6 +27,9 @@
 
 package installer::logger;
 
+use strict;
+use warnings;
+
 use installer::files;
 use installer::globals;
 
-- 
1.7.8.3

___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


[Libreoffice] [PATCH] emacs.el: Replace all mentions of OOo with LO

2010-10-30 Thread Tim Retout
Hello, world!

This is a naive replacement of "OpenOffice.org" with "LibreOffice" in
emacs.el in the "build" repository.

Will patches sent with git send-email be accepted?  Also, this and any
future patches I send will of course be under LGPLv3+/MPL.

Thanks,

-- 
Tim Retout 
>From 038c55d03c22f38ad4583dd6b7a698c2b3cd899f Mon Sep 17 00:00:00 2001
From: Tim Retout 
Date: Sat, 30 Oct 2010 10:59:59 +0100
Subject: [PATCH] emacs.el: Replace all mentions of OOo with LO.

Signed-off-by: Tim Retout 
---
 emacs.el |   32 
 1 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/emacs.el b/emacs.el
index 76dfd55..497ade1 100644
--- a/emacs.el
+++ b/emacs.el
@@ -1,34 +1,34 @@
-(defvar openoffice.org-path-regexp
-  "openoffice"
-  "Regexp that matches paths into your OpenOffice.org source tree.")
+(defvar libreoffice-path-regexp
+  "libreoffice"
+  "Regexp that matches paths into your LibreOffice source tree.")
 
-(defun openoffice.org-c-hook ()
-  "Set C++ style and tab stopsto match OOo style."
-  (when (string-match openoffice.org-path-regexp buffer-file-name)
-  (message "Using OpenOffice.org code settings")
+(defun libreoffice-c-hook ()
+  "Set C++ style and tab stops to match LO style."
+  (when (string-match libreoffice-path-regexp buffer-file-name)
+  (message "Using LibreOffice code settings")
   (setq tab-width 4)
   (setq tab-stop-list '(4 8 12 16 20 24 28 32 36 40 44 48 52 56 60 64 68 72
 			76 80 84 88 92 96 100 104 108 112 116 120))
   (c-set-style "stroustrup")
   (set-variable 'c-basic-offset 4)
   (set-variable 'indent-tabs-mode nil)
-  (let ((env-file (openoffice.org-set-env-file buffer-file-name)))
+  (let ((env-file (libreoffice-set-env-file buffer-file-name)))
 (setq compile-command (if (null env-file)
   "dmake"
 (concat ". "
 (file-relative-name env-file)
 "; dmake"))
 
-(add-hook 'c-mode-common-hook 'openoffice.org-c-hook)
+(add-hook 'c-mode-common-hook 'libreoffice-c-hook)
 
 (add-to-list 'auto-mode-alist (cons "\\.sdi\\'" 'c++-mode))
 (add-to-list 'auto-mode-alist (cons "\\.hrc\\'" 'c++-mode))
 (add-to-list 'auto-mode-alist (cons "\\.src\\'" 'c++-mode))
 
 ;; stolen from vc-hooks.el (vc-find-root)
-(defun openoffice.org-src-dir (file)
-  "Find the root of an OpenOffice.org source directory.
-Find the root of the OpenOffice.org source directory that
+(defun libreoffice-src-dir (file)
+  "Find the root of an LibreOffice source directory.
+Find the root of the LibreOffice source directory that
 contains FILE, or nil if FILE is not in such a directory"
   (let ((dir nil))
 (while (not (or dir
@@ -39,11 +39,11 @@ contains FILE, or nil if FILE is not in such a directory"
 (setq file (directory-file-name file
 dir))
 
-(defun openoffice.org-set-env-file (file)
-  "Find OOo *Env.Set.sh script.
+(defun libreoffice-set-env-file (file)
+  "Find LO *Env.Set.sh script.
 Returns the name of the solar environment setter script for the
-OpenOffice.org source tree to which FILE belongs. Unix-only."
-  (let* ((root (openoffice.org-src-dir file))
+LibreOffice source tree to which FILE belongs. Unix-only."
+  (let* ((root (libreoffice-src-dir file))
 (files (and root
 (file-expand-wildcards
  (expand-file-name "*Env.Set.sh" root)
-- 
1.7.2.3

___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice