This is an automated email from the ASF dual-hosted git repository.
mseidel pushed a commit to branch AOO42X
in repository https://gitbox.apache.org/repos/asf/openoffice.git
The following commit(s) were added to refs/heads/AOO42X by this push:
new 1dba2a1 Re-enable adapted texts for NSIS installer.
1dba2a1 is described below
commit 1dba2a1a2c1f347af183c49af8f576e6af818285
Author: mseidel <[email protected]>
AuthorDate: Fri May 21 20:31:39 2021 +0200
Re-enable adapted texts for NSIS installer.
This fixes https://bz.apache.org/ooo/show_bug.cgi?id=127628
(cherry picked from commit 8a06ca12497f3a3d665ff5a87c811bd891703f59)
---
main/solenv/bin/modules/installer/download.pm | 341 +++++++++++++-------------
1 file changed, 172 insertions(+), 169 deletions(-)
diff --git a/main/solenv/bin/modules/installer/download.pm
b/main/solenv/bin/modules/installer/download.pm
index 05f9237..c2ae7b9 100644
--- a/main/solenv/bin/modules/installer/download.pm
+++ b/main/solenv/bin/modules/installer/download.pm
@@ -34,7 +34,7 @@ use installer::systemactions;
use strict;
-BEGIN { # This is needed so that cygwin's perl evaluates ACLs
+BEGIN { # This is needed so that Cygwin's perl evaluates ACLs
# (needed for correctly evaluating the -x test.)
if( $^O =~ /cygwin/i ) {
require filetest; import filetest "access";
@@ -48,7 +48,7 @@ BEGIN { # This is needed so that cygwin's perl evaluates ACLs
sub put_productname_into_script
{
my ($scriptfile, $variableshashref) = @_;
-
+
my $productname = $variableshashref->{'PRODUCTNAME'};
$productname = lc($productname);
$productname =~ s/\.//g; # openoffice.org -> openofficeorg
@@ -69,7 +69,7 @@ sub put_productname_into_script
sub put_linenumber_into_script
{
my ( $scriptfile ) = @_;
-
+
my $linenumber = $#{$scriptfile} + 2;
$installer::logger::Lang->printf("Adding linenumber %d into download
shell script\n", $linenumber);
@@ -77,7 +77,7 @@ sub put_linenumber_into_script
for ( my $i = 0; $i <= $#{$scriptfile}; $i++ )
{
${$scriptfile}[$i] =~ s/LINENUMBERPLACEHOLDER/$linenumber/;
- }
+ }
}
#########################################################
@@ -104,7 +104,7 @@ sub determine_scriptfile_name
sub save_script_file
{
my ($directory, $newscriptfilename, $scriptfile) = @_;
-
+
$newscriptfilename = $directory . $installer::globals::separator .
$newscriptfilename;
installer::files::save_file($newscriptfilename, $scriptfile);
@@ -115,7 +115,7 @@ sub save_script_file
my $localcall = "chmod 775 $newscriptfilename \>\/dev\/null
2\>\&1";
system($localcall);
}
-
+
return $newscriptfilename;
}
@@ -129,11 +129,11 @@ sub put_checksum_and_size_into_script
my $checksum = "";
my $size = "";
-
- if ( $sumout =~ /^\s*(\d+)\s+(\d+)\s*$/ )
+
+ if ( $sumout =~ /^\s*(\d+)\s+(\d+)\s*$/ )
{
$checksum = $1;
- $size = $2;
+ $size = $2;
}
else
{
@@ -148,7 +148,7 @@ sub put_checksum_and_size_into_script
${$scriptfile}[$i] =~ s/CHECKSUMPLACEHOLDER/$checksum/;
${$scriptfile}[$i] =~ s/DISCSPACEPLACEHOLDER/$size/;
}
-
+
}
#########################################################
@@ -160,11 +160,11 @@ sub call_md5sum
my ($filename) = @_;
my $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");
@@ -174,7 +174,7 @@ sub call_md5sum
my $returnvalue = $?; # $? contains the return value of the systemcall
$installer::logger::Lang->printf("Systemcall: %s\n", $systemcall);
-
+
if ($returnvalue)
{
$installer::logger::Lang->printf("ERROR: Could not execute
\"%s\"!\n", $systemcall);
@@ -183,8 +183,8 @@ sub call_md5sum
{
$installer::logger::Lang->print("Success: Executed \"%s\"
successfully!\n", $systemcall);
}
-
- return $md5sumoutput;
+
+ return $md5sumoutput;
}
#########################################################
@@ -194,10 +194,10 @@ sub call_md5sum
sub get_md5sum
{
my ($md5sumoutput) = @_;
-
+
my $md5sum;
-
- if ( $md5sumoutput =~ /^\s*(\w+?)\s+/ )
+
+ if ( $md5sumoutput =~ /^\s*(\w+?)\s+/ )
{
$md5sum = $1;
}
@@ -220,7 +220,7 @@ sub call_sum
my ($filename, $getuidlibrary) = @_;
my $systemcall = "/usr/bin/sum $filename |";
-
+
my $sumoutput = "";
open (SUM, "$systemcall");
@@ -230,7 +230,7 @@ sub call_sum
my $returnvalue = $?; # $? contains the return value of the systemcall
$installer::logger::Lang->printf("Systemcall: %s\n", $systemcall);
-
+
if ($returnvalue)
{
$installer::logger::Lang->printf("ERROR: Could not execute
\"%s\"!\n", $systemcall);
@@ -239,9 +239,9 @@ sub call_sum
{
$installer::logger::Lang->printf("Success: Executed \"%s\"
successfully!\n", $systemcall);
}
-
+
$sumoutput =~ s/\s+$filename\s$//;
- return $sumoutput;
+ return $sumoutput;
}
#########################################################
@@ -251,7 +251,7 @@ sub call_sum
sub get_path_for_library
{
my ($includepatharrayref) = @_;
-
+
my $getuidlibraryname = "getuid.so";
my $getuidlibraryref = "";
@@ -266,7 +266,7 @@ sub get_path_for_library
}
if ($$getuidlibraryref eq "") { installer::exiter::exit_program("ERROR:
Could not find $getuidlibraryname!", "get_path_for_library"); }
-
+
return $$getuidlibraryref;
}
@@ -282,7 +282,7 @@ sub include_tar_into_script
my $returnvalue = system($systemcall);
$installer::logger::Lang->printf("Systemcall: %s\n", $systemcall);
-
+
if ($returnvalue)
{
$installer::logger::Lang->printf("ERROR: Could not execute
\"%s\"!\n", $systemcall);
@@ -305,11 +305,11 @@ sub tar_package
my $ldpreloadstring = $ENV{'FAKEROOT'};
my $systemcall = "cd $installdir; $ldpreloadstring tar -cf - * >
$tarfilename";
-
+
my $returnvalue = system($systemcall);
$installer::logger::Lang->printf("Systemcall: %s\n", $systemcall);
-
+
if ($returnvalue)
{
$installer::logger::Lang->printf("ERROR: Could not execute
\"%s\"!\n", $systemcall);
@@ -318,7 +318,7 @@ sub tar_package
{
$installer::logger::Lang->printf("Success: Executed \"\"
successfully!\n", $systemcall);
}
-
+
my $localcall = "chmod 775 $tarfilename \>\/dev\/null 2\>\&1";
$returnvalue = system($localcall);
@@ -346,7 +346,7 @@ sub create_tar_gz_file_from_package
my $returnvalue = system($systemcall);
$installer::logger::Lang->printf("Systemcall: %s\n",
$systemcall);
-
+
if ($returnvalue)
{
$installer::logger::Lang->printf("ERROR: Could not
execute \"%s\"!\n", $systemcall);
@@ -358,11 +358,11 @@ sub create_tar_gz_file_from_package
}
$alldirs = installer::systemactions::get_all_directories($installdir);
- my $packagename = ${$alldirs}[0]; # only taking the first Solaris
package
+ my $packagename = ${$alldirs}[0]; # only taking the first Solaris
package
if ( $packagename eq "" ) { installer::exiter::exit_program("ERROR:
Could not find package in directory $installdir!", "determine_packagename"); }
installer::pathanalyzer::make_absolute_filename_to_relative_filename(\$packagename);
-
+
$installer::globals::downloadfileextension = ".tar.gz";
my $targzname = $packagename .
$installer::globals::downloadfileextension;
$installer::globals::downloadfilename = $targzname;
@@ -375,7 +375,7 @@ sub create_tar_gz_file_from_package
my $returnvalue = system($systemcall);
$installer::logger::Lang->printf("Systemcall: %s\n", $systemcall);
-
+
if ($returnvalue)
{
$installer::logger::Lang->printf("ERROR: Could not execute
\"%s\"!\n", $systemcall);
@@ -393,10 +393,10 @@ sub create_tar_gz_file_from_package
sub get_installation_type
{
my $type = "";
-
+
if ( $installer::globals::languagepack ) { $type = "langpack"; }
else { $type = "install"; }
-
+
return $type;
}
@@ -418,11 +418,11 @@ sub get_downloadname_language
# en-US is default language and can be removed therefore
# for one-language installation sets
-
+
# if ( $languages =~ /^\s*en-US\s*$/ )
# {
# $languages = "";
- # }
+ # }
if ( length ($languages) > $installer::globals::max_lang_length )
{
@@ -485,12 +485,12 @@ sub get_downloadname_productname
sub get_download_version
{
my ($allvariables) = @_;
-
+
my $version = "";
-
+
my $devproduct = 0;
if (( $allvariables->{'DEVELOPMENTPRODUCT'} ) && (
$allvariables->{'DEVELOPMENTPRODUCT'} == 1 )) { $devproduct = 1; }
-
+
my $cwsproduct = 0;
# the environment variable CWS_WORK_STAMP is set only in CWS
if ( $ENV{'CWS_WORK_STAMP'} ) { $cwsproduct = 1; }
@@ -507,9 +507,9 @@ sub get_download_version
{
$version = $allvariables->{'PRODUCTVERSION'};
if (( $allvariables->{'ABOUTBOXPRODUCTVERSION'} ) && (
$allvariables->{'ABOUTBOXPRODUCTVERSION'} ne "" )) { $version =
$allvariables->{'ABOUTBOXPRODUCTVERSION'}; }
- if (( $allvariables->{'SHORT_PRODUCTEXTENSION'} ) && (
$allvariables->{'SHORT_PRODUCTEXTENSION'} ne "" )) { $version = $version .
$allvariables->{'SHORT_PRODUCTEXTENSION'}; }
+ if (( $allvariables->{'SHORT_PRODUCTEXTENSION'} ) && (
$allvariables->{'SHORT_PRODUCTEXTENSION'} ne "" )) { $version = $version .
$allvariables->{'SHORT_PRODUCTEXTENSION'}; }
}
-
+
return $version;
}
@@ -525,13 +525,13 @@ sub set_date_string
my $devproduct = 0;
if (( $allvariables->{'DEVELOPMENTPRODUCT'} ) && (
$allvariables->{'DEVELOPMENTPRODUCT'} == 1 )) { $devproduct = 1; }
-
+
my $cwsproduct = 0;
# the environment variable CWS_WORK_STAMP is set only in CWS
if ( $ENV{'CWS_WORK_STAMP'} ) { $cwsproduct = 1; }
my $releasebuild = 1;
- if (( $allvariables->{'SHORT_PRODUCTEXTENSION'} ) && (
$allvariables->{'SHORT_PRODUCTEXTENSION'} ne "" )) { $releasebuild = 0; }
+ if (( $allvariables->{'SHORT_PRODUCTEXTENSION'} ) && (
$allvariables->{'SHORT_PRODUCTEXTENSION'} ne "" )) { $releasebuild = 0; }
if (( ! $devproduct ) && ( ! $cwsproduct ) && ( ! $releasebuild ))
{
@@ -540,7 +540,7 @@ sub set_date_string
my $day = $timearray[3];
my $month = $timearray[4] + 1;
my $year = $timearray[5] + 1900;
-
+
if ( $month < 10 ) { $month = "0" . $month; }
if ( $day < 10 ) { $day = "0" . $day; }
@@ -557,7 +557,7 @@ sub set_date_string
sub get_download_platformname
{
my $platformname = "";
-
+
if ( $installer::globals::islinuxbuild )
{
$platformname = "Linux";
@@ -572,7 +572,7 @@ sub get_download_platformname
}
elsif ( $installer::globals::isfreebsdbuild )
{
- $platformname = "FreeBSD";
+ $platformname = "FreeBSD";
}
elsif ( $installer::globals::ismacbuild )
{
@@ -581,9 +581,9 @@ sub get_download_platformname
else
{
# $platformname = $installer::globals::packageformat;
- $platformname = $installer::globals::compiler;
+ $platformname = $installer::globals::compiler;
}
-
+
return $platformname;
}
@@ -594,7 +594,7 @@ sub get_download_platformname
sub get_download_architecture
{
my $arch = "";
-
+
if(( $installer::globals::compiler =~ /^unxlngi/ )
|| ( $installer::globals::compiler =~ /^unxmac.i/ )
|| ( $installer::globals::issolarisx86build )
@@ -616,8 +616,8 @@ sub get_download_architecture
{
$arch = "PPC";
}
-
- return $arch;
+
+ return $arch;
}
#########################################################
@@ -627,9 +627,9 @@ sub get_download_architecture
sub get_install_type
{
my ($allvariables) = @_;
-
+
my $type = "";
-
+
if ( $installer::globals::languagepack )
{
$type = "langpack";
@@ -638,15 +638,15 @@ sub get_install_type
{
$type = $type . "-rpm";
}
-
+
if ( $installer::globals::islinuxdebbuild )
{
$type = $type . "-deb";
}
-
+
if ( $installer::globals::packageformat eq "archive" )
{
- $type = $type . "-arc";
+ $type = $type . "-arc";
}
}
else
@@ -657,19 +657,19 @@ sub get_install_type
{
$type = $type . "-rpm";
}
-
+
if ( $installer::globals::islinuxdebbuild )
{
$type = $type . "-deb";
}
-
+
if ( $installer::globals::packageformat eq "archive" )
{
- $type = $type . "-arc";
+ $type = $type . "-arc";
}
}
-
+
return $type;
}
@@ -682,7 +682,7 @@ sub get_downloadname_addon
my $addon = "";
if ( $installer::globals::islinuxdebbuild ) { $addon = $addon . "_deb";
}
-
+
return $addon;
}
@@ -694,13 +694,13 @@ sub get_downloadname_addon
sub get_versionstring
{
my ( $versionfile ) = @_;
-
+
my $versionstring = "";
for ( my $i = 0; $i <= $#{$versionfile}; $i++ )
{
my $oneline = ${$versionfile}[$i];
-
+
if ( $oneline =~ /^\s*\#/ ) { next; } # comment line
if ( $oneline =~ /^\s*\"\s*(.*?)\s*\"\s*$/ )
{
@@ -708,7 +708,7 @@ sub get_versionstring
last;
}
}
-
+
return $versionstring;
}
@@ -723,7 +723,7 @@ sub get_current_version
my $versionstring = "";
my $filename = "version.info";
# $filename = $installer::globals::ooouploaddir .
$installer::globals::separator . $filename;
-
+
if ( -f $filename )
{
$installer::logger::Lang->printf("File %s exists. Trying to
find current version.\n", $filename);
@@ -737,7 +737,7 @@ sub get_current_version
}
$installer::globals::oooversionstring = $versionstring;
-
+
return $versionstring;
}
@@ -752,7 +752,7 @@ sub get_current_version
sub set_download_filename
{
my ($languagestringref, $allvariables) = @_;
-
+
my $start = get_downloadname_productname($allvariables);
my $versionstring = get_download_version($allvariables);
my $date = set_date_string($allvariables);
@@ -760,16 +760,16 @@ sub set_download_filename
my $architecture = get_download_architecture();
my $type = get_install_type($allvariables);
my $language = get_downloadname_language($languagestringref);
-
+
# Setting the extension happens automatically
my $filename = $start . "_" . $versionstring . "_" . $date . "_" .
$platform . "_" . $architecture . "_" . $type . "_" . $language;
-
+
$filename =~ s/\_\_/\_/g; # necessary, if $versionstring or
$platform or $language are empty
$filename =~ s/\_\s*$//; # necessary, if $language and $addon
are empty
-
+
$installer::globals::ooodownloadfilename = $filename;
-
+
return $filename;
}
@@ -793,11 +793,11 @@ sub create_tar_gz_file_from_directory
my $targzname = $downloaddir . $installer::globals::separator .
$installer::globals::downloadfilename;
my $systemcall = "cd $changedir; $ldpreloadstring tar -cf - $packdir |
gzip > $targzname";
-
+
my $returnvalue = system($systemcall);
$installer::logger::Lang->printf("Systemcall: %s\n", $systemcall);
-
+
if ($returnvalue)
{
$installer::logger::Lang->printf("ERROR: Could not execute
\"%s\"!\n", $systemcall);
@@ -806,7 +806,7 @@ sub create_tar_gz_file_from_directory
{
$installer::logger::Lang->printf("Success: Executed \"%s\"
successfully!\n", $systemcall);
}
-
+
return $targzname;
}
@@ -841,12 +841,12 @@ sub resolve_variables_in_downloadname
elsif ( $installer::globals::compiler =~ /unxmac.i/ ) { $os = "macosi";
}
elsif ( $installer::globals::compiler =~ /unxmac.x/ ) { $os = "macosx";
}
elsif ( $installer::globals::compiler =~ /unxmacxp/ ) { $os = "macosp";
}
- else { $os = ""; }
+ else { $os = ""; }
$downloadname =~ s/\{os\}/$os/;
my $languages = $$languagestringref;
$downloadname =~ s/\{languages\}/$languages/;
-
+
$downloadname =~ s/\-\-\-/\-/g;
$downloadname =~ s/\-\-/\-/g;
$downloadname =~ s/\-\s*$//;
@@ -878,16 +878,16 @@ sub replace_one_variable
sub convert_to_unicode
{
my ($string) = @_;
-
+
my $unicodestring = "";
-
+
my $stringlength = length($string);
-
+
for ( my $i = 0; $i < $stringlength; $i++ )
{
$unicodestring = $unicodestring . substr($string, $i, 1);
$unicodestring = $unicodestring . chr(0);
- }
+ }
return $unicodestring;
}
@@ -899,7 +899,7 @@ sub convert_to_unicode
sub put_windows_productname_into_template
{
my ($templatefile, $variableshashref) = @_;
-
+
my $productname = $variableshashref->{'PRODUCTNAME'};
$productname =~ s/\.//g; # OpenOffice.org -> OpenOfficeorg
@@ -913,7 +913,7 @@ sub put_windows_productname_into_template
sub put_banner_bmp_into_template
{
my ($templatefile, $includepatharrayref, $allvariables) = @_;
-
+
# my $filename = "downloadbanner.bmp";
if ( ! $allvariables->{'DOWNLOADBANNER'} ) {
installer::exiter::exit_program("ERROR: DOWNLOADBANNER not defined in product
definition!", "put_banner_bmp_into_template"); }
my $filename = $allvariables->{'DOWNLOADBANNER'};
@@ -922,7 +922,7 @@ sub put_banner_bmp_into_template
if ( $installer::globals::include_pathes_read )
{
- $completefilenameref =
installer::scriptitems::get_sourcepath_from_filename_and_includepath(\$filename,
$includepatharrayref, 0);
+ $completefilenameref =
installer::scriptitems::get_sourcepath_from_filename_and_includepath(\$filename,
$includepatharrayref, 0);
}
else
{
@@ -1003,7 +1003,7 @@ sub put_setup_ico_into_template
sub put_publisher_into_template ($$)
{
my ($templatefile, $variables) = @_;
-
+
my $publisher = $variables->{'OOOVENDOR'};
$publisher = "" unless defined $publisher;
@@ -1031,11 +1031,11 @@ sub put_website_into_template ($$)
sub put_javafilename_into_template
{
my ($templatefile, $variableshashref) = @_;
-
+
my $javaversion = "";
-
+
if ( $variableshashref->{'WINDOWSJAVAFILENAME'} ) { $javaversion =
$variableshashref->{'WINDOWSJAVAFILENAME'}; }
-
+
replace_one_variable($templatefile, "WINDOWSJAVAFILENAMEPLACEHOLDER",
$javaversion);
}
@@ -1046,9 +1046,9 @@ sub put_javafilename_into_template
sub put_windows_productversion_into_template
{
my ($templatefile, $variableshashref) = @_;
-
+
my $productversion = $variableshashref->{'PRODUCTVERSION'};
-
+
replace_one_variable($templatefile, "PRODUCTVERSIONPLACEHOLDER",
$productversion);
}
@@ -1059,14 +1059,14 @@ sub put_windows_productversion_into_template
sub put_windows_productpath_into_template
{
my ($templatefile, $variableshashref, $languagestringref,
$localnsisdir) = @_;
-
+
my $productpath = $variableshashref->{'PROPERTYTABLEPRODUCTNAME'};
-
+
my $locallangs = $$languagestringref;
$locallangs =~ s/_/ /g;
if (length($locallangs) > $installer::globals::max_lang_length) {
$locallangs = "multi lingual"; }
- if ( ! $installer::globals::languagepack ) { $productpath =
$productpath . " (" . $locallangs . ")"; }
+ if ( ! $installer::globals::languagepack ) { $productpath =
$productpath . " (" . $locallangs . ")"; }
replace_one_variable($templatefile, "PRODUCTPATHPLACEHOLDER",
$productpath);
}
@@ -1078,7 +1078,7 @@ sub put_windows_productpath_into_template
sub put_outputfilename_into_template
{
my ($templatefile, $downloadname) = @_;
-
+
$installer::globals::downloadfileextension = ".exe";
$downloadname = $downloadname .
$installer::globals::downloadfileextension;
$installer::globals::downloadfilename = $downloadname;
@@ -1098,11 +1098,11 @@ sub get_file_list
my $alldirs = installer::systemactions::get_all_directories($basedir);
unshift(@{$alldirs}, $basedir); # $basedir is the first directory in
$alldirs
-
+
for ( my $i = 0; $i <= $#{$alldirs}; $i++ )
{
my $onedir = ${$alldirs}[$i];
-
+
# Syntax:
# SetOutPath "$INSTDIR"
@@ -1110,20 +1110,20 @@ sub get_file_list
$relativedir =~ s/\Q$basedir\E//;
my $oneline = " " . "SetOutPath" . " " . "\"\$INSTDIR" .
$relativedir . "\"" . "\n";
-
+
if ( $^O =~ /cygwin/i ) {
$oneline =~ s/\//\\/g;
}
push(@filelist, $oneline);
-
+
# Collecting all files in the specific directory
-
+
my $files =
installer::systemactions::get_all_files_from_one_directory($onedir);
-
+
for ( my $j = 0; $j <= $#{$files}; $j++ )
{
my $onefile = ${$files}[$j];
-
+
my $fileline = " " . "File" . " " . "\"" . $onefile .
"\"" . "\n";
if ( $^O =~ /cygwin/i ) {
@@ -1143,7 +1143,7 @@ sub get_file_list
sub put_filelist_into_template
{
my ($templatefile, $installationdir) = @_;
-
+
my $filelist = get_file_list($installationdir);
my $filestring = "";
@@ -1152,9 +1152,9 @@ sub put_filelist_into_template
{
$filestring = $filestring . ${$filelist}[$i];
}
-
+
$filestring =~ s/\s*$//;
-
+
replace_one_variable($templatefile, "ALLFILESPLACEHOLDER", $filestring);
}
@@ -1165,7 +1165,7 @@ sub put_filelist_into_template
sub nsis_language_converter
{
my ($language) = @_;
-
+
my $nsislanguage = "";
# Assign language used by NSIS.
@@ -1266,12 +1266,12 @@ sub put_language_list_into_template
}
else
{
- $alllangstring = $alllangstring . $langstring;
+ $alllangstring = $alllangstring . $langstring;
}
}
$alllangstring =~ s/\s*$//;
-
+
replace_one_variable($templatefile, "ALLLANGUAGESPLACEHOLDER",
$alllangstring);
}
@@ -1282,9 +1282,9 @@ sub put_language_list_into_template
sub get_identifier
{
my ( $mlffile ) = @_;
-
+
my @identifier = ();
-
+
for ( my $i = 0; $i <= $#{$mlffile}; $i++ )
{
my $oneline = ${$mlffile}[$i];
@@ -1311,24 +1311,24 @@ sub get_language_block_from_language_file
my @language_block = ();
for ( my $i = 0; $i <= $#{$languagefile}; $i++ )
- {
+ {
if ( ${$languagefile}[$i] =~ /^\s*\[\s*$searchstring\s*\]\s*$/ )
{
my $counter = $i;
push(@language_block, ${$languagefile}[$counter]);
$counter++;
-
+
while (( $counter <= $#{$languagefile} ) && (!(
${$languagefile}[$counter] =~ /^\s*\[/ )))
{
push(@language_block,
${$languagefile}[$counter]);
$counter++;
}
-
+
last;
}
- }
-
+ }
+
return \@language_block;
}
@@ -1340,7 +1340,7 @@ sub get_language_block_from_language_file
sub get_language_string_from_language_block
{
my ($language_block, $language) = @_;
-
+
my $newstring = "";
for ( my $i = 0; $i <= $#{$language_block}; $i++ )
@@ -1349,15 +1349,15 @@ sub get_language_string_from_language_block
{
$newstring = $1;
last;
- }
- }
-
+ }
+ }
+
if ( $newstring eq "" )
{
- $language = "en-US"; # defaulting to english
+ $language = "en-US"; # defaulting to English
for ( my $i = 0; $i <= $#{$language_block}; $i++ )
- {
+ {
if ( ${$language_block}[$i] =~
/^\s*$language\s*\=\s*\"(.*)\"\s*$/ )
{
$newstring = $1;
@@ -1365,7 +1365,7 @@ sub get_language_string_from_language_block
}
}
}
-
+
return $newstring;
}
@@ -1379,6 +1379,9 @@ sub replace_identifier_in_nshfile
{
my ( $nshfile, $identifier, $newstring, $nshfilename, $onelanguage ) =
@_;
+ $newstring =~ s/\\r/\$\\r/g; # \r -> $\r in modern nsis versions
+ $newstring =~ s/\\n/\$\\n/g; # \n -> $\n in modern nsis versions
+
for ( my $i = 0; $i <= $#{$nshfile}; $i++ )
{
if ( ${$nshfile}[$i] =~ /\s+\Q$identifier\E\s+\"(.+)\"\s*$/ )
@@ -1419,7 +1422,7 @@ sub replace_identifier_in_nlffile
$oldstring,
$newstring);
}
- }
+ }
}
##################################################################
@@ -1432,19 +1435,19 @@ sub translate_nsh_nlf_file
# Analyzing the mlf file, collecting all Identifier
my $allidentifier = get_identifier($mlffile);
-
+
$onelanguage = "en-US" if ( $nsislanguage eq "English" && $onelanguage
ne "en-US");
for ( my $i = 0; $i <= $#{$allidentifier}; $i++ )
{
my $identifier = ${$allidentifier}[$i];
my $language_block =
get_language_block_from_language_file($identifier, $mlffile);
my $newstring =
get_language_string_from_language_block($language_block, $onelanguage);
-
+
# removing mask
$newstring =~ s/\\\'/\'/g;
-
+
replace_identifier_in_nshfile($nshfile, $identifier,
$newstring, $nshfilename, $onelanguage);
- replace_identifier_in_nlffile($nlffile, $identifier,
$newstring, $nlffilename, $onelanguage);
+ replace_identifier_in_nlffile($nlffile, $identifier,
$newstring, $nlffilename, $onelanguage);
}
}
@@ -1473,7 +1476,7 @@ sub convert_utf16_to_utf8
if ( open( OUT, ">:utf8", $filename ) )
{
print OUT @localfile;
- close(OUT);
+ close(OUT);
}
$savfilename = $filename . "_before.utf8";
@@ -1503,7 +1506,7 @@ sub convert_utf8_to_utf16
if ( open( OUT, ">:raw:encoding(UTF16-LE):crlf:utf8", $filename ) )
{
print OUT @localfile;
- close(OUT);
+ close(OUT);
}
$savfilename = $filename . "_after.utf16";
@@ -1537,7 +1540,7 @@ sub convert_textstring_to_utf16
sub copy_and_translate_nsis_language_files
{
my ($nsispath, $localnsisdir, $languagesarrayref, $allvariables) = @_;
-
+
my $nlffilepath = $nsispath . $installer::globals::separator .
"Contrib" . $installer::globals::separator . "Language\ files" .
$installer::globals::separator;
my $nshfilepath = $nsispath . $installer::globals::separator .
"Contrib" . $installer::globals::separator . "Modern\ UI" .
$installer::globals::separator . "Language files" .
$installer::globals::separator;
@@ -1552,7 +1555,7 @@ sub copy_and_translate_nsis_language_files
my $nlffilename = $localnsisdir .
$installer::globals::separator . $nsislanguage . "_pack.nlf";
if ( $^O =~ /cygwin/i ) { $nlffilename =~ s/\//\\/g; }
installer::systemactions::copy_one_file($sourcepath,
$nlffilename);
-
+
# Copying the nsh file
# In newer nsis versions, the nsh file is located next to the
nlf file
$sourcepath = $nshfilepath . $nsislanguage . "\.nsh";
@@ -1567,26 +1570,26 @@ sub copy_and_translate_nsis_language_files
}
my $nshfilename = $localnsisdir .
$installer::globals::separator . $nsislanguage . "_pack.nsh";
if ( $^O =~ /cygwin/i ) { $nshfilename =~ s/\//\\/g; }
- installer::systemactions::copy_one_file($sourcepath,
$nshfilename);
+ installer::systemactions::copy_one_file($sourcepath,
$nshfilename);
# Changing the macro name in nsh file: MUI_LANGUAGEFILE_BEGIN
-> MUI_LANGUAGEFILE_PACK_BEGIN
- convert_utf16_to_utf8($nshfilename);
- convert_utf16_to_utf8($nlffilename);
+ #convert_utf16_to_utf8($nshfilename);
+ #convert_utf16_to_utf8($nlffilename);
my $nshfile = installer::files::read_file($nshfilename);
replace_one_variable($nshfile, "MUI_LANGUAGEFILE_BEGIN",
"MUI_LANGUAGEFILE_PACK_BEGIN");
# find the ulf file for translation
my $mlffile = get_translation_file($allvariables);
-
+
# Translate the files
my $nlffile = installer::files::read_file($nlffilename);
translate_nsh_nlf_file($nshfile, $nlffile, $mlffile,
$onelanguage, $nshfilename, $nlffilename, $nsislanguage);
-
+
installer::files::save_file($nshfilename, $nshfile);
installer::files::save_file($nlffilename, $nlffile);
- convert_utf8_to_utf16($nshfilename);
- convert_utf8_to_utf16($nlffilename);
+ #convert_utf8_to_utf16($nshfilename);
+ #convert_utf8_to_utf16($nlffilename);
}
}
@@ -1635,7 +1638,7 @@ sub get_path_to_nsis_sdk
{
installer::exiter::exit_program("ERROR: NSIS path $nsispath
does not exist!", "get_path_to_nsis_sdk");
}
-
+
return $nsispath;
}
@@ -1646,7 +1649,7 @@ sub get_path_to_nsis_sdk
sub call_nsis
{
my ( $nsispath, $nsifile ) = @_;
-
+
my $makensisexe = $nsispath . $installer::globals::separator .
"makensis.exe";
$installer::logger::Info->printf("... starting %s ... \n",
$makensisexe);
@@ -1672,7 +1675,7 @@ sub call_nsis
else
{
$installer::logger::Lang->printf("Success: %s\n", $systemcall);
- }
+ }
foreach my $line (@nsisoutput)
{
@@ -1687,11 +1690,11 @@ sub call_nsis
sub replace_one_variable_in_translationfile
{
my ($translationfile, $variable, $searchstring) = @_;
-
+
for ( my $i = 0; $i <= $#{$translationfile}; $i++ )
{
${$translationfile}[$i] =~ s/\%$searchstring/$variable/g;
- }
+ }
}
#################################################################################
@@ -1726,12 +1729,12 @@ sub get_translation_file
replace_variables($translationfile, $allvariableshashref);
$installer::logger::Lang->printf("Reading translation file: %s\n",
$translationfilename);
-
+
return $translationfile;
}
####################################################
-# Removing english, if it was added before
+# Removing English, if it was added before
####################################################
sub remove_english_for_nsis_installer
@@ -1741,7 +1744,7 @@ sub remove_english_for_nsis_installer
# $$languagestringref =~ s/en-US_//;
# shift(@{$languagesarrayref});
- @{$languagesarrayref} = ("en-US"); # only english for NSIS
installer!
+ @{$languagesarrayref} = ("en-US"); # only English for NSIS
installer!
}
####################################################
@@ -1751,21 +1754,21 @@ sub remove_english_for_nsis_installer
sub create_link_tree
{
my ($sourcedownloadfile, $destfilename, $versionstring) = @_;
-
+
if ( ! $installer::globals::ooouploaddir ) {
installer::exiter::exit_program("ERROR: Directory for AOO upload not defined!",
"create_link_tree"); }
my $versiondir = $installer::globals::ooouploaddir .
$installer::globals::separator . $versionstring;
$installer::logger::Lang->printf("Directory for the link: %s\n",
$versiondir);
-
+
if ( ! -d $versiondir ) {
installer::systemactions::create_directory_structure($versiondir); }
-
- # inside directory $versiondir all links have to be created
+
+ # 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); }
$installer::logger::Lang->printf("Creating hard link from %s to %s\n",
$sourcedownloadfile, $linkdestination);
- installer::systemactions::hardlink_one_file($sourcedownloadfile,
$linkdestination);
+ installer::systemactions::hardlink_one_file($sourcedownloadfile,
$linkdestination);
}
#######################################################
@@ -1775,7 +1778,7 @@ sub create_link_tree
sub is_supported_platform
{
my $is_supported = 0;
-
+
if (( $installer::globals::islinuxrpmbuild ) ||
( $installer::globals::issolarissparcbuild ) ||
( $installer::globals::issolarisx86build ) ||
@@ -1794,7 +1797,7 @@ sub is_supported_platform
sub create_download_sets
{
my ($installationdir, $includepatharrayref, $allvariableshashref,
$downloadname, $languagestringref, $languagesarrayref) = @_;
-
+
$installer::logger::Info->print("\n");
$installer::logger::Info->print("******************************************\n");
$installer::logger::Info->print("... creating download installation set
...\n", 1);
@@ -1807,7 +1810,7 @@ sub create_download_sets
my $firstdir = $installationdir;
installer::pathanalyzer::get_path_from_fullqualifiedname(\$firstdir);
-
+
my $lastdir = $installationdir;
installer::pathanalyzer::make_absolute_filename_to_relative_filename(\$lastdir);
@@ -1817,9 +1820,9 @@ sub create_download_sets
# removing existing directory "_native_packed_inprogress" and
"_native_packed_witherror" and "_native_packed"
my $downloaddir = $firstdir . $lastdir;
-
+
if ( -d $downloaddir ) {
installer::systemactions::remove_complete_directory($downloaddir); }
-
+
my $olddir = $downloaddir;
$olddir =~ s/_inprogress/_witherror/;
if ( -d $olddir ) {
installer::systemactions::remove_complete_directory($olddir); }
@@ -1829,7 +1832,7 @@ sub create_download_sets
if ( -d $olddir ) {
installer::systemactions::remove_complete_directory($olddir); }
# creating the new directory
-
+
installer::systemactions::create_directory($downloaddir);
$installer::globals::saveinstalldir = $downloaddir;
@@ -1876,7 +1879,7 @@ sub create_download_sets
my $scriptfile =
installer::files::read_file($$scriptref);
$installer::logger::Lang->printf("Found script file %s:
%s \n", $scriptfilename, $$scriptref);
-
+
# add product name into script template
put_productname_into_script($scriptfile,
$allvariableshashref);
@@ -1890,10 +1893,10 @@ sub create_download_sets
# calling sum to determine checksum and size of the tar
file
my $sumout = call_sum($temporary_tarfile_name);
-
+
# writing checksum and size into scriptfile
put_checksum_and_size_into_script($scriptfile, $sumout);
-
+
# saving the script file
my $newscriptfilename =
determine_scriptfile_name($downloadname);
$newscriptfilename = save_script_file($downloaddir,
$newscriptfilename, $scriptfile);
@@ -1922,7 +1925,7 @@ sub create_download_sets
# copy language files into nsis directory and translate them
copy_and_translate_nsis_language_files($nsispath,
$localnsisdir, $languagesarrayref, $allvariableshashref);
-
+
# find and read the nsi file template
my $templatefilename = "downloadtemplate.nsi";
@@ -1955,15 +1958,15 @@ sub create_download_sets
put_language_list_into_template($templatefile,
$languagesarrayref);
put_nsis_path_into_template($templatefile, $localnsisdir);
put_output_path_into_template($templatefile, $downloaddir);
-
+
my $nsifilename = save_script_file($localnsisdir,
$templatefilename, $templatefile);
$installer::logger::Info->printf("... created NSIS file %s ...
\n", $nsifilename);
-
+
# starting the NSIS SDK to create the download file
- call_nsis($nsispath, $nsifilename);
+ call_nsis($nsispath, $nsifilename);
}
-
+
return $downloaddir;
}
@@ -1988,14 +1991,14 @@ sub create_download_link_tree
{
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.
$installer::logger::Lang->printf("Version string is set to:
%s\n", $versionstring);
-
+
if ( $versionstring )
{
# Now the downloadfilename has to be set (if not
already done)
@@ -2016,14 +2019,14 @@ sub create_download_link_tree
create_link_tree($sourcedownloadfile,
$destdownloadfilename, $versionstring);
# my $md5sumoutput = call_md5sum($downloadfile);
# my $md5sum = get_md5sum($md5sumoutput);
-
+
}
}
else
{
$installer::logger::Lang->printf("Version string is
empty. Nothing to do!\n");
}
- }
+ }
else
{
$installer::logger::Lang->printf("Platform not used for hard
linking. Nothing to do!\n");