From 347fa47507fce9758b60d9126a1beed04c45dc35 Mon Sep 17 00:00:00 2001 From: Mike Kaganski Date: Sun, 30 Oct 2022 12:39:27 +0300 Subject: Fix errors in scriptitems.pm found by 'use strict' Besides some stylistic changes (adding 'my' in due places), this fixes two errors: 1. An omission from commit cb02ea85db6f38b792c17f5f971f81a28b595b4e Date Fri Oct 13 09:36:29 2006 +0000 INTEGRATION: CWS native62 (1.28.42); FILE MERGED not passing '$allvariableshashref' to 'replace_userdir_variable', and so using a local empty variable instead, ignoring custom value of LOCALUSERDIR in *.lst; 2. Use of wrong scalar variable '$alldirectoryhash' instead of hash '%alldirectoryhash' in 'collect_directories_from_filesarray', from commit 8c6467a785037309d2a2cec56c8e38cf52da0aee Date Sat Oct 29 23:38:12 2022 +0300 MSI: fix handling empty directories which resulted in the loss of empty directories found by that call. Change-Id: I126575a51044186bc6c7fdf898942abf71ddb4b1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142034 Tested-by: Jenkins Reviewed-by: Mike Kaganski --- solenv/bin/modules/installer.pm | 2 +- solenv/bin/modules/installer/scriptitems.pm | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) (limited to 'solenv') diff --git a/solenv/bin/modules/installer.pm b/solenv/bin/modules/installer.pm index 99866b2fb7f2..071d31b13b14 100644 --- a/solenv/bin/modules/installer.pm +++ b/solenv/bin/modules/installer.pm @@ -714,7 +714,7 @@ sub run { # ancient (not MSP) "patch" thing, I think. if ( $installer::globals::patch_user_dir ) { - installer::scriptitems::replace_userdir_variable($profileitemsinproductlanguageresolvedarrayref); + installer::scriptitems::replace_userdir_variable($profileitemsinproductlanguageresolvedarrayref, $allvariableshashref); } installer::scriptitems::get_Destination_Directory_For_Item_From_Directorylist($profilesinproductlanguageresolvedarrayref, $dirsinproductarrayref); diff --git a/solenv/bin/modules/installer/scriptitems.pm b/solenv/bin/modules/installer/scriptitems.pm index e541be45b1f0..7b552622fb9b 100644 --- a/solenv/bin/modules/installer/scriptitems.pm +++ b/solenv/bin/modules/installer/scriptitems.pm @@ -660,8 +660,8 @@ sub replace_setup_variables chomp; if (/^s*(\S+)=(\S+)$/) { - $key = $1; - $val = $2; + my $key = $1; + my $val = $2; if ($key eq "channel") { $updatechannel = $val; @@ -700,7 +700,7 @@ sub replace_setup_variables sub replace_userdir_variable { - my ($itemsarrayref) = @_; + my ($itemsarrayref, $allvariableshashref) = @_; my $userdir = ""; if ( $allvariableshashref->{'LOCALUSERDIR'} ) { $userdir = $allvariableshashref->{'LOCALUSERDIR'}; } @@ -1659,7 +1659,7 @@ sub collect_directories_from_filesarray { my $sourcepath = $onefile->{'sourcepath'}; # Do the same as collect_directories_with_create_flag_from_directoryarray does - $alldirectoryhash = recursive_add_directory_with_create_flag_hash(\%alldirectoryhash, $onefile->{'destination'}, $onefile->{'specificlanguage'}, $onefile->{'gid'}, "(CREATE)", $onefile->{'modules'}); + %alldirectoryhash = %{recursive_add_directory_with_create_flag_hash(\%alldirectoryhash, $onefile->{'destination'}, $onefile->{'specificlanguage'}, $onefile->{'gid'}, "(CREATE)", $onefile->{'modules'})}; next; } @@ -1810,7 +1810,7 @@ sub get_destination_link_path_for_links for ( my $j = 0; $j <= $#{$linksarrayref}; $j++ ) { my $destlink = ${$linksarrayref}[$j]; - $shortcutgid = $destlink->{'gid'}; + my $shortcutgid = $destlink->{'gid'}; if ( $shortcutgid eq $shortcutid ) { @@ -2161,7 +2161,7 @@ sub collect_all_parent_feature if ( $found_root_module ) { installer::exiter::exit_program("ERROR: Only one module without ParentID or with empty ParentID allowed ($installer::globals::rootmodulegid, $onefeature->{'gid'}).", "collect_all_parent_feature"); } $installer::globals::rootmodulegid = $onefeature->{'gid'}; $found_root_module = 1; - $infoline = "Setting Root Module: $installer::globals::rootmodulegid\n"; + my $infoline = "Setting Root Module: $installer::globals::rootmodulegid\n"; push( @installer::globals::globallogfileinfo, $infoline); } @@ -2353,7 +2353,7 @@ sub _key_in_a_is_also_key_in_b if ( ! exists($hashref_b->{$key}) ) { print "*****\n"; - foreach $keyb ( keys %{$hashref_b} ) { print "$keyb : $hashref_b->{$keyb}\n"; } + foreach my $keyb ( keys %{$hashref_b} ) { print "$keyb : $hashref_b->{$keyb}\n"; } print "*****\n"; $returnvalue = 0; } -- cgit v1.2.3