diff options
author | Christian Lohmaier <lohmaier+LibreOffice@googlemail.com> | 2024-04-19 14:54:12 +0200 |
---|---|---|
committer | Christian Lohmaier <lohmaier+LibreOffice@googlemail.com> | 2024-04-26 14:00:43 +0200 |
commit | a97d983b501b28a2b5a9387efb6206b50097ffa1 (patch) | |
tree | c3241afffa6208b2a18c2d8dcb03199a73f64acb /solenv/bin | |
parent | 3c54cb2a9d731d8315f32ad8a4ced2a8d6b508de (diff) |
don't throw away command output when packaging installsets
and adjust installer to work with MSWin-style perl (like strawberry
perl)
Change-Id: I9305c7cb6ef72560bbf77626f113f3ee439b3ef3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166331
Tested-by: Jenkins
Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
Diffstat (limited to 'solenv/bin')
-rw-r--r-- | solenv/bin/modules/installer.pm | 2 | ||||
-rw-r--r-- | solenv/bin/modules/installer/control.pm | 4 | ||||
-rw-r--r-- | solenv/bin/modules/installer/globals.pm | 2 | ||||
-rw-r--r-- | solenv/bin/modules/installer/parameter.pm | 1 | ||||
-rw-r--r-- | solenv/bin/modules/installer/windows/msiglobal.pm | 21 |
5 files changed, 17 insertions, 13 deletions
diff --git a/solenv/bin/modules/installer.pm b/solenv/bin/modules/installer.pm index 8c5c275adb91..5f9214e09e88 100644 --- a/solenv/bin/modules/installer.pm +++ b/solenv/bin/modules/installer.pm @@ -580,8 +580,6 @@ sub run { installer::scriptitems::changing_name_of_language_dependent_keys($filesinproductlanguageresolvedarrayref); - if ( $installer::globals::iswin and $^O =~ /MSWin/i ) { installer::converter::convert_slash_to_backslash($filesinproductlanguageresolvedarrayref); } - $filesinproductlanguageresolvedarrayref = installer::scriptitems::remove_non_existent_languages_in_productlists($filesinproductlanguageresolvedarrayref, $languagestringref, "Name", "file"); installer::scriptitems::get_Destination_Directory_For_Item_From_Directorylist($filesinproductlanguageresolvedarrayref, $dirsinproductarrayref); diff --git a/solenv/bin/modules/installer/control.pm b/solenv/bin/modules/installer/control.pm index d126e917b57f..4faff4f39b9f 100644 --- a/solenv/bin/modules/installer/control.pm +++ b/solenv/bin/modules/installer/control.pm @@ -87,6 +87,8 @@ sub check_system_path map { my $dir = qx{cygpath -m "$_"}; chomp($dir); $dir } split /\Q$local_pathseparator\E\s*/, $pathvariable; $local_pathseparator = ';'; + } elsif ( $^O =~ /MSWin/i ) { + $local_pathseparator = ';'; } my $patharrayref = installer::converter::convert_stringlist_into_array(\$pathvariable, $local_pathseparator); @@ -96,7 +98,7 @@ sub check_system_path if (($installer::globals::iswin) && ($installer::globals::iswindowsbuild)) { - @needed_files_in_path = ("zip.exe", "msiinfo.exe", "msidb.exe", "uuidgen", "makecab.exe", "msitran.exe", "expand.exe"); + @needed_files_in_path = ("msiinfo.exe", "msidb.exe", "uuidgen.exe", "makecab.exe", "msitran.exe", "expand.exe"); } elsif ($installer::globals::iswin) { diff --git a/solenv/bin/modules/installer/globals.pm b/solenv/bin/modules/installer/globals.pm index 045d9d6afde9..0dc148a9155a 100644 --- a/solenv/bin/modules/installer/globals.pm +++ b/solenv/bin/modules/installer/globals.pm @@ -265,7 +265,7 @@ BEGIN @installer::globals::removedirs = (); @installer::globals::removefiletable = (); - if ( $^O =~ /cygwin/i ) + if ( $^O =~ /cygwin/i || $^O =~ /MSWin/i ) { $installer::globals::zippath = "zip"; # Has to be in the path: /usr/bin/zip $installer::globals::separator = "/"; diff --git a/solenv/bin/modules/installer/parameter.pm b/solenv/bin/modules/installer/parameter.pm index b183057eac1e..98910d53b756 100644 --- a/solenv/bin/modules/installer/parameter.pm +++ b/solenv/bin/modules/installer/parameter.pm @@ -187,6 +187,7 @@ sub control_fundamental_parameter sub make_path_absolute { my ($pathref) = @_; + return if ( $^O =~ /MSWin/i ); # no need to do anything here if ( $installer::globals::isunix ) { diff --git a/solenv/bin/modules/installer/windows/msiglobal.pm b/solenv/bin/modules/installer/windows/msiglobal.pm index 38146abb51d2..51e91af12be3 100644 --- a/solenv/bin/modules/installer/windows/msiglobal.pm +++ b/solenv/bin/modules/installer/windows/msiglobal.pm @@ -461,7 +461,7 @@ sub create_msi_database $msifilename = installer::converter::make_path_conform($msifilename); - if ( $^O =~ /cygwin/i ) { + if ( $^O =~ /cygwin/i || $^O =~ /MSWin/i ) { # msidb.exe really wants backslashes. (And double escaping because system() expands the string.) $idtdirbase =~ s/\//\\\\/g; $msifilename =~ s/\//\\\\/g; @@ -472,14 +472,15 @@ sub create_msi_database } my $systemcall = $msidb . " -f " . $idtdirbase . " -d " . $msifilename . " -c " . "-i " . $extraslash . "*"; - my $returnvalue = system($systemcall); + my $systemcall_output = `$systemcall`; + my $returnvalue = $? >> 8; my $infoline = "Systemcall: $systemcall\n"; push( @installer::globals::logfileinfo, $infoline); if ($returnvalue) { - $infoline = "ERROR: Could not execute $msidb!\n"; + $infoline = "ERROR: Could not execute $msidb! - returncode: $returnvalue - output:\n$systemcall_output\n"; push( @installer::globals::logfileinfo, $infoline); } else @@ -625,14 +626,15 @@ sub write_summary_into_msi_database . " -j " . $subject . " -o " . $comment . " -k " . $keywords . " -n " . $appname . " -u " . $security . " -w " . $wordcount; - my $returnvalue = system($systemcall); + my $systemcall_output = `$systemcall`; + my $returnvalue = $? >> 8; my $infoline = "Systemcall: $systemcall\n"; push( @installer::globals::logfileinfo, $infoline); if ($returnvalue) { - $infoline = "ERROR: Could not execute $systemcall (return $returnvalue)\n"; + $infoline = "ERROR: Could not execute $systemcall (return $returnvalue) - output:\n$systemcall_output\n"; push( @installer::globals::logfileinfo, $infoline); } else @@ -808,16 +810,17 @@ sub create_transforms } } - my $systemcall = "TEMP=$ENV{'TMPDIR'} $cscript \"$wilangid\" $basedbname Package $templatevalue"; - - my $returnvalue = system($systemcall); + $ENV{TEMP} = $ENV{TMPDIR}; + my $systemcall = "$cscript \"$wilangid\" $basedbname Package $templatevalue"; + my $systemcall_output = `$systemcall`; + my $returnvalue = $? >> 8; my $infoline = "Systemcall: $systemcall\n"; push( @installer::globals::logfileinfo, $infoline); if ($returnvalue) { - $infoline = "ERROR: $returnvalue from $systemcall\n"; + $infoline = "ERROR: $returnvalue from $systemcall - output:\n$systemcall_output\n"; push( @installer::globals::logfileinfo, $infoline); } else |