Filename | /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer/scriptitems.pm |
Statements | Executed 39442532 statements in 171s |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
11 | 11 | 1 | 105s | 158s | resolving_all_languages_in_productlists | installer::scriptitems::
21828612 | 38 | 1 | 31.8s | 31.8s | CORE:match (opcode) | installer::scriptitems::
7194 | 1 | 1 | 12.9s | 14.3s | get_languagespecific_module | installer::scriptitems::
10477226 | 14 | 1 | 8.76s | 8.76s | CORE:regcomp (opcode) | installer::scriptitems::
1 | 1 | 1 | 3.21s | 3.28s | remove_not_required_language_modules | installer::scriptitems::
11 | 11 | 1 | 3.01s | 3.56s | changing_name_of_language_dependent_keys | installer::scriptitems::
1 | 1 | 1 | 1.40s | 1.40s | CORE:backtick (opcode) | installer::scriptitems::
1 | 1 | 1 | 1.31s | 2.51s | collect_directories_from_filesarray | installer::scriptitems::
119480 | 34 | 1 | 554ms | 554ms | CORE:subst (opcode) | installer::scriptitems::
7512 | 1 | 1 | 520ms | 520ms | get_Directoryname_From_Directorygid | installer::scriptitems::
1 | 1 | 1 | 311ms | 365ms | select_required_language_strings | installer::scriptitems::
1 | 1 | 1 | 247ms | 280ms | collect_all_languagemodules | installer::scriptitems::
8888 | 10 | 7 | 214ms | 215ms | get_sourcepath_from_filename_and_includepath | installer::scriptitems::
2 | 2 | 1 | 212ms | 439ms | get_Source_Directory_For_Files_From_Includepathlist | installer::scriptitems::
4 | 4 | 1 | 206ms | 800ms | get_Destination_Directory_For_Item_From_Directorylist | installer::scriptitems::
3682 | 2 | 1 | 174ms | 353ms | optimize_list | installer::scriptitems::
109966 | 4 | 1 | 143ms | 143ms | CORE:substcont (opcode) | installer::scriptitems::
842 | 1 | 1 | 141ms | 141ms | CORE:ftfile (opcode) | installer::scriptitems::
1 | 1 | 1 | 118ms | 119ms | remove_not_required_spellcheckerlanguage_modules | installer::scriptitems::
1 | 1 | 1 | 98.8ms | 114ms | add_License_Files_into_Installdir | installer::scriptitems::
3 | 1 | 1 | 82.7ms | 151ms | build_modulegids_table | installer::scriptitems::
1 | 1 | 1 | 76.1ms | 81.3ms | resolve_all_directory_names | installer::scriptitems::
1 | 1 | 1 | 59.9ms | 59.9ms | remove_not_required_spellcheckerlanguage_files | installer::scriptitems::
1 | 1 | 1 | 56.7ms | 100ms | set_children_flag | installer::scriptitems::
9555 | 1 | 1 | 56.1ms | 56.1ms | insert_for_item | installer::scriptitems::
1 | 1 | 1 | 53.4ms | 56.5ms | make_filename_language_specific | installer::scriptitems::
1 | 1 | 1 | 52.5ms | 55.7ms | remove_office_start_language_files | installer::scriptitems::
1 | 1 | 1 | 43.5ms | 43.7ms | remove_non_existent_languages_in_productlists | installer::scriptitems::
1 | 1 | 1 | 43.4ms | 43.4ms | collect_all_parent_feature | installer::scriptitems::
820 | 1 | 1 | 35.4ms | 45.3ms | get_string_of_modulegids_for_itemgid | installer::scriptitems::
1 | 1 | 1 | 32.9ms | 34.5ms | resolve_assigned_modules | installer::scriptitems::
1 | 1 | 1 | 32.3ms | 102ms | collect_directories_with_create_flag_from_directoryarray | installer::scriptitems::
83 | 1 | 1 | 25.7ms | 25.7ms | determine_directory_language_dependency | installer::scriptitems::
1 | 1 | 1 | 23.9ms | 23.9ms | remove_Files_Without_Sourcedirectory | installer::scriptitems::
3684 | 3 | 1 | 17.2ms | 17.2ms | CORE:sort (opcode) | installer::scriptitems::
3 | 3 | 1 | 16.0ms | 212ms | assigning_modules_to_items | installer::scriptitems::
116 | 2 | 2 | 13.3ms | 166ms | get_sourcepath_from_filename_and_includepath_classic | installer::scriptitems::
1 | 1 | 1 | 10.9ms | 11.7ms | set_global_directory_hostnames | installer::scriptitems::
1 | 1 | 1 | 10.4ms | 11.3ms | remove_template_modules | installer::scriptitems::
1 | 1 | 1 | 8.83ms | 9.46ms | remove_uninstall_regitems_from_script | installer::scriptitems::
1 | 1 | 1 | 7.27ms | 7.27ms | checking_directories_with_corrupt_hostname | installer::scriptitems::
1 | 1 | 1 | 5.67ms | 6.06ms | remove_Languagepacklibraries_from_Installset | installer::scriptitems::
1 | 1 | 1 | 5.22ms | 5.68ms | remove_Helppacklibraries_from_Installset | installer::scriptitems::
1 | 1 | 1 | 5.15ms | 5.53ms | remove_patchonlyfiles_from_Installset | installer::scriptitems::
1 | 1 | 1 | 3.71ms | 1.40s | replace_setup_variables | installer::scriptitems::
1 | 1 | 1 | 2.27ms | 14.1ms | BEGIN@33 | installer::scriptitems::
1 | 1 | 1 | 339µs | 342µs | BEGIN@30 | installer::scriptitems::
83 | 1 | 1 | 84µs | 84µs | CORE:print (opcode) | installer::scriptitems::
1 | 1 | 1 | 34µs | 47µs | get_office_directory_gid_and_hostname | installer::scriptitems::
1 | 1 | 1 | 17µs | 58µs | BEGIN@34 | installer::scriptitems::
1 | 1 | 1 | 16µs | 18µs | BEGIN@35 | installer::scriptitems::
1 | 1 | 1 | 14µs | 16µs | BEGIN@36 | installer::scriptitems::
1 | 1 | 1 | 14µs | 15µs | BEGIN@31 | installer::scriptitems::
1 | 1 | 1 | 13µs | 13µs | change_keys_of_scpactions | installer::scriptitems::
1 | 1 | 1 | 13µs | 15µs | BEGIN@37 | installer::scriptitems::
1 | 1 | 1 | 13µs | 15µs | BEGIN@32 | installer::scriptitems::
1 | 1 | 1 | 13µs | 13µs | get_destination_file_path_for_links | installer::scriptitems::
1 | 1 | 1 | 10µs | 10µs | get_destination_link_path_for_links | installer::scriptitems::
1 | 1 | 1 | 9µs | 9µs | remove_workstation_only_items | installer::scriptitems::
1 | 1 | 1 | 8µs | 8µs | resolve_links_with_flag_relative | installer::scriptitems::
0 | 0 | 0 | 0s | 0s | add_rootpath_to_directories | installer::scriptitems::
0 | 0 | 0 | 0s | 0s | add_rootpath_to_files | installer::scriptitems::
0 | 0 | 0 | 0s | 0s | add_rootpath_to_links | installer::scriptitems::
0 | 0 | 0 | 0s | 0s | get_children | installer::scriptitems::
0 | 0 | 0 | 0s | 0s | quoting_illegal_filenames | installer::scriptitems::
0 | 0 | 0 | 0s | 0s | remove_Files_For_Languagepacks | installer::scriptitems::
0 | 0 | 0 | 0s | 0s | replace_userdir_variable | installer::scriptitems::
0 | 0 | 0 | 0s | 0s | set_officedirectory_name | installer::scriptitems::
0 | 0 | 0 | 0s | 0s | shift_basis_directory_parents | installer::scriptitems::
0 | 0 | 0 | 0s | 0s | use_devversion_copy_scpaction | installer::scriptitems::
0 | 0 | 0 | 0s | 0s | use_langpack_copy_scpaction | installer::scriptitems::
0 | 0 | 0 | 0s | 0s | use_langpack_hostname | installer::scriptitems::
0 | 0 | 0 | 0s | 0s | use_patch_copy_scpaction | installer::scriptitems::
0 | 0 | 0 | 0s | 0s | use_patch_hostname | installer::scriptitems::
Line | State ments |
Time on line |
Calls | Time in subs |
Code |
---|---|---|---|---|---|
1 | #************************************************************************* | ||||
2 | # | ||||
3 | # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. | ||||
4 | # | ||||
5 | # Copyright 2000, 2010 Oracle and/or its affiliates. | ||||
6 | # | ||||
7 | # OpenOffice.org - a multi-platform office productivity suite | ||||
8 | # | ||||
9 | # This file is part of OpenOffice.org. | ||||
10 | # | ||||
11 | # OpenOffice.org is free software: you can redistribute it and/or modify | ||||
12 | # it under the terms of the GNU Lesser General Public License version 3 | ||||
13 | # only, as published by the Free Software Foundation. | ||||
14 | # | ||||
15 | # OpenOffice.org is distributed in the hope that it will be useful, | ||||
16 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||||
17 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||||
18 | # GNU Lesser General Public License version 3 for more details | ||||
19 | # (a copy is included in the LICENSE file that accompanied this code). | ||||
20 | # | ||||
21 | # You should have received a copy of the GNU Lesser General Public License | ||||
22 | # version 3 along with OpenOffice.org. If not, see | ||||
23 | # <http://www.openoffice.org/license.html> | ||||
24 | # for a copy of the LGPLv3 License. | ||||
25 | # | ||||
26 | #************************************************************************* | ||||
27 | |||||
28 | package installer::scriptitems; | ||||
29 | |||||
30 | 2 | 60µs | 2 | 345µs | # spent 342µs (339+3) within installer::scriptitems::BEGIN@30 which was called:
# once (339µs+3µs) by installer::control::BEGIN@36 at line 30 # spent 342µs making 1 call to installer::scriptitems::BEGIN@30
# spent 3µs making 1 call to UNIVERSAL::import |
31 | 2 | 52µs | 2 | 16µs | # spent 15µs (14+1) within installer::scriptitems::BEGIN@31 which was called:
# once (14µs+1µs) by installer::control::BEGIN@36 at line 31 # spent 15µs making 1 call to installer::scriptitems::BEGIN@31
# spent 2µs making 1 call to UNIVERSAL::import |
32 | 2 | 52µs | 2 | 18µs | # spent 15µs (13+3) within installer::scriptitems::BEGIN@32 which was called:
# once (13µs+3µs) by installer::control::BEGIN@36 at line 32 # spent 15µs making 1 call to installer::scriptitems::BEGIN@32
# spent 2µs making 1 call to UNIVERSAL::import |
33 | 2 | 1.02ms | 2 | 14.1ms | # spent 14.1ms (2.27+11.8) within installer::scriptitems::BEGIN@33 which was called:
# once (2.27ms+11.8ms) by installer::control::BEGIN@36 at line 33 # spent 14.1ms making 1 call to installer::scriptitems::BEGIN@33
# spent 3µs making 1 call to UNIVERSAL::import |
34 | 2 | 58µs | 2 | 98µs | # spent 58µs (17+41) within installer::scriptitems::BEGIN@34 which was called:
# once (17µs+41µs) by installer::control::BEGIN@36 at line 34 # spent 58µs making 1 call to installer::scriptitems::BEGIN@34
# spent 41µs making 1 call to Exporter::import |
35 | 2 | 53µs | 2 | 20µs | # spent 18µs (16+2) within installer::scriptitems::BEGIN@35 which was called:
# once (16µs+2µs) by installer::control::BEGIN@36 at line 35 # spent 18µs making 1 call to installer::scriptitems::BEGIN@35
# spent 2µs making 1 call to UNIVERSAL::import |
36 | 2 | 50µs | 2 | 18µs | # spent 16µs (14+2) within installer::scriptitems::BEGIN@36 which was called:
# once (14µs+2µs) by installer::control::BEGIN@36 at line 36 # spent 16µs making 1 call to installer::scriptitems::BEGIN@36
# spent 2µs making 1 call to UNIVERSAL::import |
37 | 2 | 20.9ms | 2 | 17µs | # spent 15µs (13+2) within installer::scriptitems::BEGIN@37 which was called:
# once (13µs+2µs) by installer::control::BEGIN@36 at line 37 # spent 15µs making 1 call to installer::scriptitems::BEGIN@37
# spent 2µs making 1 call to UNIVERSAL::import |
38 | |||||
39 | ################################################################ | ||||
40 | # Resolving the GID for the directories defined in setup script | ||||
41 | ################################################################ | ||||
42 | |||||
43 | sub resolve_all_directory_names | ||||
44 | # spent 81.3ms (76.1+5.20) within installer::scriptitems::resolve_all_directory_names which was called:
# once (76.1ms+5.20ms) by installer::run at line 368 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer.pm | ||||
45 | 1 | 3µs | my ($directoryarrayref) = @_; | ||
46 | |||||
47 | # After this procedure the hash shall contain the complete language | ||||
48 | # dependent path, not only the language dependent HostName. | ||||
49 | |||||
50 | 1 | 2µs | my ($key, $value, $parentvalue, $parentgid, $parentdirectoryhashref); | ||
51 | |||||
52 | 1 | 335µs | for ( my $i = 0; $i <= $#{$directoryarrayref}; $i++ ) | ||
53 | { | ||||
54 | 244 | 191µs | my $directoryhashref = ${$directoryarrayref}[$i]; | ||
55 | 244 | 242µs | my $gid = $directoryhashref-> {'gid'}; | ||
56 | 244 | 168µs | my $parentid = $directoryhashref-> {'ParentID'}; | ||
57 | |||||
58 | 244 | 246µs | if ( $parentid ne "PREDEFINED_PROGDIR" ) | ||
59 | { | ||||
60 | # find the array of the parentid, which has to be defined before in setup script | ||||
61 | # and is therefore listed before in this array | ||||
62 | |||||
63 | 243 | 21.6ms | for ( my $j = 0; $j <= $i; $j++ ) | ||
64 | { | ||||
65 | 24586 | 11.2ms | $parentdirectoryhashref = ${$directoryarrayref}[$j]; | ||
66 | 24586 | 12.7ms | $parentgid = $parentdirectoryhashref->{'gid'}; | ||
67 | |||||
68 | 24586 | 10.0ms | if ( $parentid eq $parentgid) | ||
69 | { | ||||
70 | 243 | 133µs | last; | ||
71 | } | ||||
72 | } | ||||
73 | |||||
74 | # and now we can put the path together | ||||
75 | # But take care of the languages! | ||||
76 | |||||
77 | 243 | 140µs | my $dirismultilingual = $directoryhashref->{'ismultilingual'}; | ||
78 | 243 | 125µs | my $parentismultilingual = $parentdirectoryhashref->{'ismultilingual'}; | ||
79 | |||||
80 | # First: Both directories are language independent or both directories are language dependent | ||||
81 | |||||
82 | 243 | 421µs | if ((( ! $dirismultilingual ) && ( ! $parentismultilingual )) || | ||
83 | (( $dirismultilingual ) && ( $parentismultilingual ))) | ||||
84 | { | ||||
85 | 237 | 782µs | foreach $key (keys %{$directoryhashref}) | ||
86 | { | ||||
87 | # the key ("HostName (en-US)") must be usable for both hashes | ||||
88 | |||||
89 | 2067 | 11.5ms | 2067 | 3.60ms | if ( $key =~ /\bHostName\b/ ) # spent 3.60ms making 2067 calls to installer::scriptitems::CORE:match, avg 2µs/call |
90 | { | ||||
91 | 1327 | 628µs | $parentvalue = ""; | ||
92 | 1327 | 982µs | $value = $directoryhashref->{$key}; | ||
93 | 1327 | 902µs | if ( $parentdirectoryhashref->{$key} ) { $parentvalue = $parentdirectoryhashref->{$key}; } | ||
94 | |||||
95 | # It is possible, that in scp project, a directory is defined in more languages than | ||||
96 | # the directory parent (happened after automatic generation of macros.inc). | ||||
97 | # Therefore this is checked now and written with a warning into the logfile. | ||||
98 | # This is no error, because (in most cases) the concerned language is not build. | ||||
99 | |||||
100 | 1327 | 1.15ms | if ($parentvalue eq "") | ||
101 | { | ||||
102 | $directoryhashref->{$key} = "FAILURE"; | ||||
103 | my $infoline = "WARNING: No hostname for $parentid with \"$key\". Needed by child directory $gid !\n"; | ||||
104 | push( @installer::globals::globallogfileinfo, $infoline); | ||||
105 | } | ||||
106 | else | ||||
107 | { | ||||
108 | 1327 | 1.80ms | $directoryhashref->{$key} = $parentvalue . $installer::globals::separator . $value; | ||
109 | } | ||||
110 | } | ||||
111 | } | ||||
112 | } | ||||
113 | |||||
114 | # Second: The directory is language dependent, the parent not | ||||
115 | |||||
116 | 243 | 115µs | if (( $dirismultilingual ) && ( ! $parentismultilingual )) | ||
117 | { | ||||
118 | 4 | 3µs | $parentvalue = $parentdirectoryhashref->{'HostName'}; # there is only one | ||
119 | |||||
120 | 4 | 106µs | foreach $key (keys %{$directoryhashref}) # the current directory | ||
121 | { | ||||
122 | 453 | 2.82ms | 453 | 1.05ms | if ( $key =~ /\bHostName\b/ ) # spent 1.05ms making 453 calls to installer::scriptitems::CORE:match, avg 2µs/call |
123 | { | ||||
124 | 440 | 304µs | $value = $directoryhashref->{$key}; | ||
125 | 440 | 574µs | $directoryhashref->{$key} = $parentvalue . $installer::globals::separator . $value; | ||
126 | } | ||||
127 | } | ||||
128 | } | ||||
129 | |||||
130 | # Third: The directory is not language dependent, the parent is language dependent | ||||
131 | |||||
132 | 243 | 136µs | if (( ! $dirismultilingual ) && ( $parentismultilingual )) | ||
133 | { | ||||
134 | 2 | 2µs | $value = $directoryhashref->{'HostName'}; # there is only one | ||
135 | 2 | 8µs | delete($directoryhashref->{'HostName'}); | ||
136 | |||||
137 | 2 | 79µs | foreach $key (keys %{$parentdirectoryhashref}) # the parent directory | ||
138 | { | ||||
139 | 226 | 1.47ms | 226 | 552µs | if ( $key =~ /\bHostName\b/ ) # spent 552µs making 226 calls to installer::scriptitems::CORE:match, avg 2µs/call |
140 | { | ||||
141 | 220 | 148µs | $parentvalue = $parentdirectoryhashref->{$key}; # there is only one | ||
142 | 220 | 388µs | $directoryhashref->{$key} = $parentvalue . $installer::globals::separator . $value; | ||
143 | } | ||||
144 | } | ||||
145 | |||||
146 | 2 | 3µs | $directoryhashref->{'ismultilingual'} = 1; # now this directory is also language dependent | ||
147 | } | ||||
148 | } | ||||
149 | } | ||||
150 | } | ||||
151 | |||||
152 | ############################################################################# | ||||
153 | # Files with flag NOT_IN_SUITE do not need to be packed into | ||||
154 | # Suite installation sets | ||||
155 | ############################################################################# | ||||
156 | |||||
157 | sub remove_office_start_language_files | ||||
158 | # spent 55.7ms (52.5+3.26) within installer::scriptitems::remove_office_start_language_files which was called:
# once (52.5ms+3.26ms) by installer::run at line 651 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer.pm | ||||
159 | 1 | 2µs | my ($productarrayref) = @_; | ||
160 | |||||
161 | 1 | 1µs | my @newitems = (); | ||
162 | |||||
163 | 1 | 8.94ms | for ( my $i = 0; $i <= $#{$productarrayref}; $i++ ) | ||
164 | { | ||||
165 | 7921 | 4.88ms | my $oneitem = ${$productarrayref}[$i]; | ||
166 | 7921 | 3.42ms | my $styles = ""; | ||
167 | |||||
168 | 7921 | 9.95ms | if ( $oneitem->{'Styles'} ) { $styles = $oneitem->{'Styles'}; } | ||
169 | |||||
170 | 7921 | 28.5ms | 7921 | 3.26ms | if (!($styles =~ /\bSET_OFFICE_LANGUAGE\b/)) # spent 3.26ms making 7921 calls to installer::scriptitems::CORE:match, avg 412ns/call |
171 | { | ||||
172 | push(@newitems, $oneitem); | ||||
173 | } | ||||
174 | else | ||||
175 | { | ||||
176 | 1 | 8µs | my $infoline = "INFO: Flag SET_OFFICE_LANGUAGE \-\> Removing $oneitem->{'gid'} from file list.\n"; | ||
177 | 1 | 2µs | push( @installer::globals::logfileinfo, $infoline); | ||
178 | } | ||||
179 | } | ||||
180 | |||||
181 | 1 | 16µs | return \@newitems; | ||
182 | } | ||||
183 | |||||
184 | ############################################################################# | ||||
185 | # Registryitems for Uninstall have to be removed | ||||
186 | ############################################################################# | ||||
187 | |||||
188 | sub remove_uninstall_regitems_from_script | ||||
189 | # spent 9.46ms (8.83+634µs) within installer::scriptitems::remove_uninstall_regitems_from_script which was called:
# once (8.83ms+634µs) by installer::run at line 449 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer.pm | ||||
190 | 1 | 1µs | my ($registryarrayref) = @_; | ||
191 | |||||
192 | 1 | 1µs | my @newitems = (); | ||
193 | |||||
194 | 1 | 1.46ms | for ( my $i = 0; $i <= $#{$registryarrayref}; $i++ ) | ||
195 | { | ||||
196 | 1286 | 814µs | my $oneitem = ${$registryarrayref}[$i]; | ||
197 | 1286 | 543µs | my $subkey = ""; | ||
198 | |||||
199 | 1286 | 1.43ms | if ( $oneitem->{'Subkey'} ) { $subkey = $oneitem->{'Subkey'}; } | ||
200 | |||||
201 | 1295 | 4.35ms | 1286 | 634µs | if ( $subkey =~ /Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall/ ) { next; } # spent 634µs making 1286 calls to installer::scriptitems::CORE:match, avg 493ns/call |
202 | |||||
203 | 1277 | 851µs | push(@newitems, $oneitem); | ||
204 | } | ||||
205 | |||||
206 | 1 | 10µs | return \@newitems; | ||
207 | } | ||||
208 | |||||
209 | ############################################################################## | ||||
210 | # Searching the language module for a specified language | ||||
211 | ############################################################################## | ||||
212 | |||||
213 | sub get_languagespecific_module | ||||
214 | # spent 14.3s (12.9+1.32) within installer::scriptitems::get_languagespecific_module which was called 7194 times, avg 1.98ms/call:
# 7194 times (12.9s+1.32s) by installer::scriptitems::resolving_all_languages_in_productlists at line 287, avg 1.98ms/call | ||||
215 | 7194 | 12.6ms | my ( $lang, $modulestring ) = @_; | ||
216 | |||||
217 | 7194 | 3.58ms | my $langmodulestring = ""; | ||
218 | |||||
219 | 7194 | 2.45ms | my $module; | ||
220 | 7194 | 2.48s | foreach $module ( keys %installer::globals::alllangmodules ) | ||
221 | { | ||||
222 | 10287420 | 11.7s | 187044 | 1.30s | if (( $installer::globals::alllangmodules{$module} eq $lang ) && ( $modulestring =~ /\b$module\b/ )) # spent 1.08s making 93522 calls to installer::scriptitems::CORE:regcomp, avg 12µs/call
# spent 218ms making 93522 calls to installer::scriptitems::CORE:match, avg 2µs/call |
223 | { | ||||
224 | $langmodulestring = "$langmodulestring,$module"; | ||||
225 | } | ||||
226 | } | ||||
227 | |||||
228 | 7194 | 45.9ms | 7194 | 19.9ms | $langmodulestring =~ s/^\s*,//; # spent 19.9ms making 7194 calls to installer::scriptitems::CORE:subst, avg 3µs/call |
229 | |||||
230 | 7194 | 3.70ms | if ( $langmodulestring eq "" ) { installer::exiter::exit_program("ERROR: No language pack module found for language $lang in string \"$modulestring\"!", "get_languagespecific_module"); } | ||
231 | |||||
232 | 7194 | 36.0ms | return $langmodulestring; | ||
233 | } | ||||
234 | |||||
235 | ############################################################################## | ||||
236 | # Removing all items in product lists which do not have the correct languages | ||||
237 | ############################################################################## | ||||
238 | |||||
239 | sub resolving_all_languages_in_productlists | ||||
240 | # spent 158s (105+52.7) within installer::scriptitems::resolving_all_languages_in_productlists which was called 11 times, avg 14.3s/call:
# once (75.4s+27.7s) by installer::run at line 880 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer.pm
# once (18.9s+6.87s) by installer::run at line 865 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer.pm
# once (7.87s+17.1s) by installer::run at line 649 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer.pm
# once (1.95s+718ms) by installer::run at line 632 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer.pm
# once (1.04s+364ms) by installer::run at line 855 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer.pm
# once (436µs+0s) by installer::run at line 813 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer.pm
# once (62µs+0s) by installer::run at line 811 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer.pm
# once (29µs+0s) by installer::run at line 845 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer.pm
# once (16µs+0s) by installer::run at line 772 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer.pm
# once (13µs+0s) by installer::run at line 754 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer.pm
# once (7µs+0s) by installer::run at line 794 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer.pm | ||||
241 | 11 | 17µs | my ($productarrayref, $languagesarrayref) = @_; | ||
242 | |||||
243 | 11 | 12µs | my @itemsinalllanguages = (); | ||
244 | |||||
245 | 11 | 10µs | my ($key, $value); | ||
246 | |||||
247 | 11 | 4.58ms | for ( my $i = 0; $i <= $#{$productarrayref}; $i++ ) | ||
248 | { | ||||
249 | 3977 | 2.83ms | my $oneitem = ${$productarrayref}[$i]; | ||
250 | |||||
251 | 3977 | 3.52ms | my $ismultilingual = $oneitem->{'ismultilingual'}; | ||
252 | |||||
253 | 3977 | 3.89ms | if (!($ismultilingual)) # nothing to do with single language items | ||
254 | { | ||||
255 | 3425 | 4.17ms | $oneitem->{'specificlanguage'} = ""; | ||
256 | 3425 | 1.64ms | push(@itemsinalllanguages, $oneitem); | ||
257 | } | ||||
258 | else #all language dependent files | ||||
259 | { | ||||
260 | 552 | 107ms | for ( my $j = 0; $j <= $#{$languagesarrayref}; $j++ ) # iterating over all languages | ||
261 | { | ||||
262 | 60168 | 56.9ms | my $onelanguage = ${$languagesarrayref}[$j]; | ||
263 | |||||
264 | 60168 | 42.5ms | my %oneitemhash = (); | ||
265 | |||||
266 | 60168 | 2.51s | foreach $key (keys %{$oneitem}) | ||
267 | { | ||||
268 | 10690393 | 69.0s | 10690393 | 25.1s | if ( $key =~ /\(\S+\)/ ) # this are the language dependent keys # spent 25.1s making 10690393 calls to installer::scriptitems::CORE:match, avg 2µs/call |
269 | { | ||||
270 | 10281752 | 70.6s | 20563504 | 13.3s | if ( $key =~ /\(\Q$onelanguage\E\)/ ) # spent 7.59s making 10281752 calls to installer::scriptitems::CORE:regcomp, avg 739ns/call
# spent 5.72s making 10281752 calls to installer::scriptitems::CORE:match, avg 557ns/call |
271 | { | ||||
272 | 93470 | 77.7ms | $value = $oneitem->{$key}; | ||
273 | 93470 | 144ms | $oneitemhash{$key} = $value; | ||
274 | } | ||||
275 | } | ||||
276 | else | ||||
277 | { | ||||
278 | 408641 | 305ms | $value = $oneitem->{$key}; | ||
279 | 408641 | 551ms | $oneitemhash{$key} = $value; | ||
280 | } | ||||
281 | } | ||||
282 | |||||
283 | 60168 | 82.0ms | $oneitemhash{'specificlanguage'} = $onelanguage; | ||
284 | |||||
285 | 60168 | 36.8ms | if ( $oneitemhash{'haslanguagemodule'} ) | ||
286 | { | ||||
287 | 7194 | 26.6ms | 7194 | 14.3s | my $langmodulestring = get_languagespecific_module($onelanguage, $oneitemhash{'modules'}); # spent 14.3s making 7194 calls to installer::scriptitems::get_languagespecific_module, avg 1.98ms/call |
288 | 7194 | 7.54ms | $oneitemhash{'modules'} = $langmodulestring; | ||
289 | } | ||||
290 | |||||
291 | 60168 | 68.3ms | push(@itemsinalllanguages, \%oneitemhash); | ||
292 | } | ||||
293 | } | ||||
294 | } | ||||
295 | |||||
296 | 11 | 136µs | return \@itemsinalllanguages; | ||
297 | } | ||||
298 | |||||
299 | ################################################################################ | ||||
300 | # Removing all modules, that have the flag LANGUAGEMODULE, but do not | ||||
301 | # have the correct language | ||||
302 | ################################################################################ | ||||
303 | |||||
304 | sub remove_not_required_language_modules | ||||
305 | # spent 3.28s (3.21+61.3ms) within installer::scriptitems::remove_not_required_language_modules which was called:
# once (3.21s+61.3ms) by installer::run at line 882 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer.pm | ||||
306 | 1 | 2µs | my ($modulesarrayref, $languagesarrayref) = @_; | ||
307 | |||||
308 | 1 | 1µs | my @allmodules = (); | ||
309 | |||||
310 | 1 | 38.1ms | for ( my $i = 0; $i <= $#{$modulesarrayref}; $i++ ) | ||
311 | { | ||||
312 | 34939 | 23.0ms | my $module = ${$modulesarrayref}[$i]; | ||
313 | 34939 | 15.4ms | my $styles = ""; | ||
314 | 34939 | 44.5ms | if ( $module->{'Styles'} ) { $styles = $module->{'Styles'}; } | ||
315 | |||||
316 | 34939 | 201ms | 34939 | 61.3ms | if ( $styles =~ /\bLANGUAGEMODULE\b/ ) # spent 61.3ms making 34939 calls to installer::scriptitems::CORE:match, avg 2µs/call |
317 | { | ||||
318 | 25190 | 16.8ms | if ( ! exists($module->{'Language'}) ) { installer::exiter::exit_program("ERROR: \"$module->{'gid'}\" has flag LANGUAGEMODULE, but does not know its language!", "remove_not_required_language_modules"); } | ||
319 | 25190 | 20.8ms | my $modulelanguage = $module->{'Language'}; | ||
320 | # checking, if language is required | ||||
321 | 25190 | 10.2ms | my $doinclude = 0; | ||
322 | 25190 | 1.52s | for ( my $j = 0; $j <= $#{$languagesarrayref}; $j++ ) | ||
323 | { | ||||
324 | 1397816 | 705ms | my $onelanguage = ${$languagesarrayref}[$j]; | ||
325 | 1397816 | 629ms | if ( $onelanguage eq $modulelanguage ) | ||
326 | { | ||||
327 | 24961 | 10.1ms | $doinclude = 1; | ||
328 | 24961 | 15.4ms | last; | ||
329 | } | ||||
330 | } | ||||
331 | |||||
332 | 25190 | 18.0ms | if ( $doinclude ) { push(@allmodules, $module); } | ||
333 | } | ||||
334 | else | ||||
335 | { | ||||
336 | 9749 | 5.21ms | push(@allmodules, $module); | ||
337 | } | ||||
338 | } | ||||
339 | |||||
340 | 1 | 20µs | return \@allmodules; | ||
341 | } | ||||
342 | |||||
343 | ################################################################################ | ||||
344 | # Removing all modules, that have a spellchecker language that is not | ||||
345 | # required for this product (spellchecker selection). | ||||
346 | # All required spellchecker languages are stored in | ||||
347 | # %installer::globals::spellcheckerlanguagehash | ||||
348 | ################################################################################ | ||||
349 | |||||
350 | sub remove_not_required_spellcheckerlanguage_modules | ||||
351 | # spent 119ms (118+1.51) within installer::scriptitems::remove_not_required_spellcheckerlanguage_modules which was called:
# once (118ms+1.51ms) by installer::run at line 886 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer.pm | ||||
352 | 1 | 5µs | my ($modulesarrayref) = @_; | ||
353 | |||||
354 | 1 | 2µs | my $infoline = ""; | ||
355 | 1 | 2µs | my @allmodules = (); | ||
356 | |||||
357 | 1 | 34.8ms | for ( my $i = 0; $i <= $#{$modulesarrayref}; $i++ ) | ||
358 | { | ||||
359 | 34710 | 18.6ms | my $module = ${$modulesarrayref}[$i]; | ||
360 | 34710 | 40.9ms | if ( $module->{'Spellcheckerlanguage'} ) # selecting modules with Spellcheckerlanguage | ||
361 | { | ||||
362 | 5123 | 4.97ms | if ( exists($installer::globals::spellcheckerlanguagehash{$module->{'Spellcheckerlanguage'}}) ) | ||
363 | { | ||||
364 | push(@allmodules, $module); | ||||
365 | } | ||||
366 | else | ||||
367 | { | ||||
368 | 109 | 158µs | $infoline = "Spellchecker selection: Removing module $module->{'gid'}\n"; | ||
369 | 109 | 133µs | push( @installer::globals::logfileinfo, $infoline); | ||
370 | |||||
371 | # Collecting all files at modules that are removed | ||||
372 | |||||
373 | 109 | 133µs | if ( $module->{'Files'} ) | ||
374 | { | ||||
375 | 109 | 859µs | 109 | 365µs | if ( $module->{'Files'} =~ /^\s*\((.*?)\)\s*$/ ) # spent 365µs making 109 calls to installer::scriptitems::CORE:match, avg 3µs/call |
376 | { | ||||
377 | 109 | 127µs | my $filelist = $1; | ||
378 | |||||
379 | 109 | 398µs | 109 | 1.14ms | my $filelisthash = installer::converter::convert_stringlist_into_hash(\$filelist, ","); # spent 1.14ms making 109 calls to installer::converter::convert_stringlist_into_hash, avg 11µs/call |
380 | 218 | 533µs | foreach my $onefile ( keys %{$filelisthash} ) { $installer::globals::spellcheckerfilehash{$onefile} = 1; } | ||
381 | } | ||||
382 | } | ||||
383 | } | ||||
384 | } | ||||
385 | else | ||||
386 | { | ||||
387 | 29587 | 16.2ms | push(@allmodules, $module); | ||
388 | } | ||||
389 | } | ||||
390 | |||||
391 | 1 | 36µs | return \@allmodules; | ||
392 | } | ||||
393 | |||||
394 | ################################################################################ | ||||
395 | # Removing all modules, that belong to a module that was removed | ||||
396 | # in "remove_not_required_spellcheckerlanguage_modules" because of the | ||||
397 | # spellchecker language. The files belonging to the modules are collected | ||||
398 | # in %installer::globals::spellcheckerfilehash. | ||||
399 | ################################################################################ | ||||
400 | |||||
401 | sub remove_not_required_spellcheckerlanguage_files | ||||
402 | # spent 59.9ms within installer::scriptitems::remove_not_required_spellcheckerlanguage_files which was called:
# once (59.9ms+0s) by installer::run at line 888 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer.pm | ||||
403 | 1 | 3µs | my ($filesarrayref) = @_; | ||
404 | |||||
405 | 1 | 2µs | my @filesarray = (); | ||
406 | 1 | 2µs | my $infoline = ""; | ||
407 | |||||
408 | 1 | 23.6ms | for ( my $i = 0; $i <= $#{$filesarrayref}; $i++ ) | ||
409 | { | ||||
410 | 15903 | 9.38ms | my $onefile = ${$filesarrayref}[$i]; | ||
411 | 15903 | 18.9ms | if ( exists($installer::globals::spellcheckerfilehash{$onefile->{'gid'}}) ) | ||
412 | { | ||||
413 | 6 | 8µs | $infoline = "Spellchecker selection: Removing file $onefile->{'gid'}\n"; | ||
414 | 6 | 7µs | push( @installer::globals::logfileinfo, $infoline); | ||
415 | 6 | 4µs | next; | ||
416 | } | ||||
417 | 15897 | 8.02ms | push(@filesarray, $onefile); | ||
418 | } | ||||
419 | |||||
420 | 1 | 36µs | return \@filesarray; | ||
421 | } | ||||
422 | |||||
423 | ################################################################################ | ||||
424 | # Looking for directories without correct HostName | ||||
425 | ################################################################################ | ||||
426 | |||||
427 | sub checking_directories_with_corrupt_hostname | ||||
428 | # spent 7.27ms within installer::scriptitems::checking_directories_with_corrupt_hostname which was called:
# once (7.27ms+0s) by installer::run at line 639 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer.pm | ||||
429 | 1 | 3µs | my ($dirsref, $languagesarrayref) = @_; | ||
430 | |||||
431 | 1 | 2.01ms | for ( my $i = 0; $i <= $#{$dirsref}; $i++ ) | ||
432 | { | ||||
433 | 1972 | 1.10ms | my $onedir = ${$dirsref}[$i]; | ||
434 | |||||
435 | 1972 | 807µs | my $hostname = ""; | ||
436 | |||||
437 | 1972 | 1.69ms | if ( $onedir->{'HostName'} ) { $hostname = $onedir->{'HostName'}; } | ||
438 | |||||
439 | 1972 | 724µs | if ( $hostname eq "" ) | ||
440 | { | ||||
441 | my $langstring = ""; | ||||
442 | for ( my $j = 0; $j <= $#{$languagesarrayref}; $j++ ) { $langstring .= ${$languagesarrayref}[$j] . " "; } | ||||
443 | installer::exiter::exit_program("ERROR: HostName not defined for $onedir->{'gid'} for specified language. Probably you wanted to create an installation set, in a language not defined in scp2 project. You selected the following language(s): $langstring", "checking_directories_with_corrupt_hostname"); | ||||
444 | } | ||||
445 | |||||
446 | 1972 | 935µs | if ( $hostname eq "FAILURE" ) | ||
447 | { | ||||
448 | installer::exiter::exit_program("ERROR: Could not create HostName for $onedir->{'gid'} (missing language at parent). See logfile warning for more info!", "checking_directories_with_corrupt_hostname"); | ||||
449 | } | ||||
450 | } | ||||
451 | } | ||||
452 | |||||
453 | ################################################################################ | ||||
454 | # Setting global properties | ||||
455 | ################################################################################ | ||||
456 | |||||
457 | sub set_global_directory_hostnames | ||||
458 | # spent 11.7ms (10.9+783µs) within installer::scriptitems::set_global_directory_hostnames which was called:
# once (10.9ms+783µs) by installer::run at line 641 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer.pm | ||||
459 | 1 | 2µs | my ($dirsref, $allvariables) = @_; | ||
460 | |||||
461 | 1 | 2.16ms | for ( my $i = 0; $i <= $#{$dirsref}; $i++ ) | ||
462 | { | ||||
463 | 1972 | 1.06ms | my $onedir = ${$dirsref}[$i]; | ||
464 | 1972 | 865µs | my $styles = ""; | ||
465 | 1972 | 1.00ms | if ( $onedir->{'Styles'} ) { $styles = $onedir->{'Styles'}; } | ||
466 | |||||
467 | 1972 | 6.61ms | 1972 | 783µs | if ( $styles =~ /\bOFFICEDIRECTORY\b/ ) # spent 783µs making 1972 calls to installer::scriptitems::CORE:match, avg 397ns/call |
468 | { | ||||
469 | 1 | 3µs | $installer::globals::officedirhostname = $onedir->{'HostName'}; | ||
470 | 1 | 2µs | $installer::globals::officedirgid = $onedir->{'gid'}; | ||
471 | 1 | 2µs | $allvariables->{'OFFICEDIRECTORYHOSTNAME'} = $installer::globals::officedirhostname; | ||
472 | } | ||||
473 | } | ||||
474 | } | ||||
475 | |||||
476 | ######################################################## | ||||
477 | # Recursively defined procedure to order | ||||
478 | # modules and directories | ||||
479 | ######################################################## | ||||
480 | |||||
481 | sub get_children | ||||
482 | { | ||||
483 | my ($allitems, $startparent, $newitemorder) = @_; | ||||
484 | |||||
485 | for ( my $i = 0; $i <= $#{$allitems}; $i++ ) | ||||
486 | { | ||||
487 | my $gid = ${$allitems}[$i]->{'gid'}; | ||||
488 | my $parent = ""; | ||||
489 | if ( ${$allitems}[$i]->{'ParentID'} ) { $parent = ${$allitems}[$i]->{'ParentID'}; } | ||||
490 | |||||
491 | if ( $parent eq $startparent ) | ||||
492 | { | ||||
493 | push(@{$newitemorder}, ${$allitems}[$i]); | ||||
494 | my $parent = $gid; | ||||
495 | get_children($allitems, $parent, $newitemorder); # recursive! | ||||
496 | } | ||||
497 | } | ||||
498 | } | ||||
499 | |||||
500 | ################################################################################ | ||||
501 | # Using different HostName for language packs | ||||
502 | ################################################################################ | ||||
503 | |||||
504 | sub use_langpack_hostname | ||||
505 | { | ||||
506 | my ($dirsref) = @_; | ||||
507 | |||||
508 | for ( my $i = 0; $i <= $#{$dirsref}; $i++ ) | ||||
509 | { | ||||
510 | my $onedir = ${$dirsref}[$i]; | ||||
511 | if (( $onedir->{'LangPackHostName'} ) && ( $onedir->{'LangPackHostName'} ne "" )) { $onedir->{'HostName'} = $onedir->{'LangPackHostName'}; } | ||||
512 | } | ||||
513 | } | ||||
514 | |||||
515 | ################################################################################ | ||||
516 | # Using different HostName for language packs | ||||
517 | ################################################################################ | ||||
518 | |||||
519 | sub use_patch_hostname | ||||
520 | { | ||||
521 | my ($dirsref) = @_; | ||||
522 | |||||
523 | for ( my $i = 0; $i <= $#{$dirsref}; $i++ ) | ||||
524 | { | ||||
525 | my $onedir = ${$dirsref}[$i]; | ||||
526 | if (( $onedir->{'PatchHostName'} ) && ( $onedir->{'PatchHostName'} ne "" )) { $onedir->{'HostName'} = $onedir->{'PatchHostName'}; } | ||||
527 | } | ||||
528 | } | ||||
529 | |||||
530 | ################################################################################ | ||||
531 | # Using different HostName for language packs | ||||
532 | ################################################################################ | ||||
533 | |||||
534 | sub use_langpack_copy_scpaction | ||||
535 | { | ||||
536 | my ($scpactionsref) = @_; | ||||
537 | |||||
538 | for ( my $i = 0; $i <= $#{$scpactionsref}; $i++ ) | ||||
539 | { | ||||
540 | my $onescpaction = ${$scpactionsref}[$i]; | ||||
541 | if (( $onescpaction->{'LangPackCopy'} ) && ( $onescpaction->{'LangPackCopy'} ne "" )) { $onescpaction->{'Copy'} = $onescpaction->{'LangPackCopy'}; } | ||||
542 | } | ||||
543 | } | ||||
544 | |||||
545 | ################################################################################ | ||||
546 | # Using different HostName for dev builds | ||||
547 | ################################################################################ | ||||
548 | |||||
549 | sub use_devversion_copy_scpaction | ||||
550 | { | ||||
551 | my ($scpactionsref) = @_; | ||||
552 | |||||
553 | for ( my $i = 0; $i <= $#{$scpactionsref}; $i++ ) | ||||
554 | { | ||||
555 | my $onescpaction = ${$scpactionsref}[$i]; | ||||
556 | if (( $onescpaction->{'DevVersionCopy'} ) && ( $onescpaction->{'DevVersionCopy'} ne "" )) { $onescpaction->{'Copy'} = $onescpaction->{'DevVersionCopy'}; } | ||||
557 | } | ||||
558 | } | ||||
559 | |||||
560 | ################################################################################ | ||||
561 | # Using different HostName for language packs | ||||
562 | ################################################################################ | ||||
563 | |||||
564 | sub use_patch_copy_scpaction | ||||
565 | { | ||||
566 | my ($scpactionsref) = @_; | ||||
567 | |||||
568 | for ( my $i = 0; $i <= $#{$scpactionsref}; $i++ ) | ||||
569 | { | ||||
570 | my $onescpaction = ${$scpactionsref}[$i]; | ||||
571 | if (( $onescpaction->{'PatchCopy'} ) && ( $onescpaction->{'PatchCopy'} ne "" )) { $onescpaction->{'Copy'} = $onescpaction->{'PatchCopy'}; } | ||||
572 | } | ||||
573 | } | ||||
574 | |||||
575 | ################################################################################ | ||||
576 | # Shifting parent directories of URE and Basis layer, so that | ||||
577 | # these directories are located below the Brand layer. | ||||
578 | # Style: SHIFT_BASIS_INTO_BRAND_LAYER | ||||
579 | ################################################################################ | ||||
580 | |||||
581 | sub shift_basis_directory_parents | ||||
582 | { | ||||
583 | my ($dirsref) = @_; | ||||
584 | |||||
585 | my @alldirs = (); | ||||
586 | my @savedirs = (); | ||||
587 | my @shifteddirs = (); | ||||
588 | |||||
589 | my $officedirgid = ""; | ||||
590 | |||||
591 | for ( my $i = 0; $i <= $#{$dirsref}; $i++ ) | ||||
592 | { | ||||
593 | my $onedir = ${$dirsref}[$i]; | ||||
594 | my $styles = ""; | ||||
595 | if ( $onedir->{'Styles'} ) { $styles = $onedir->{'Styles'}; } | ||||
596 | |||||
597 | if ( $styles =~ /\bOFFICEDIRECTORY\b/ ) { $officedirgid = $onedir->{'gid'}; } | ||||
598 | } | ||||
599 | |||||
600 | if ( $officedirgid ne "" ) | ||||
601 | { | ||||
602 | for ( my $i = 0; $i <= $#{$dirsref}; $i++ ) | ||||
603 | { | ||||
604 | my $onedir = ${$dirsref}[$i]; | ||||
605 | my $styles = ""; | ||||
606 | if ( $onedir->{'Styles'} ) { $styles = $onedir->{'Styles'}; } | ||||
607 | |||||
608 | if (( $styles =~ /\bBASISDIRECTORY\b/ ) || ( $styles =~ /\bUREDIRECTORY\b/ )) | ||||
609 | { | ||||
610 | $onedir->{'ParentID'} = $officedirgid; | ||||
611 | } | ||||
612 | } | ||||
613 | |||||
614 | # Sorting directories | ||||
615 | my $startgid = "PREDEFINED_PROGDIR"; | ||||
616 | get_children($dirsref, $startgid, \@alldirs); | ||||
617 | } | ||||
618 | |||||
619 | return \@alldirs; | ||||
620 | } | ||||
621 | |||||
622 | ################################################################################ | ||||
623 | # Setting the name of the directory with style OFFICEDIRECTORY. | ||||
624 | # The name can be defined in property OFFICEDIRECTORYNAME. | ||||
625 | ################################################################################ | ||||
626 | |||||
627 | sub set_officedirectory_name | ||||
628 | { | ||||
629 | my ($dirsref, $officedirname) = @_; | ||||
630 | |||||
631 | for ( my $i = 0; $i <= $#{$dirsref}; $i++ ) | ||||
632 | { | ||||
633 | my $onedir = ${$dirsref}[$i]; | ||||
634 | my $styles = ""; | ||||
635 | if ( $onedir->{'Styles'} ) { $styles = $onedir->{'Styles'}; } | ||||
636 | if ( $styles =~ /\bOFFICEDIRECTORY\b/ ) | ||||
637 | { | ||||
638 | $onedir->{'HostName'} = $officedirname; | ||||
639 | last; | ||||
640 | } | ||||
641 | } | ||||
642 | } | ||||
643 | |||||
644 | ################################################################################ | ||||
645 | # Simplifying the name for language dependent items from "Name (xy)" to "Name" | ||||
646 | ################################################################################ | ||||
647 | |||||
648 | sub changing_name_of_language_dependent_keys | ||||
649 | # spent 3.56s (3.01+550ms) within installer::scriptitems::changing_name_of_language_dependent_keys which was called 11 times, avg 324ms/call:
# once (1.92s+380ms) by installer::run at line 891 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer.pm
# once (652ms+103ms) by installer::run at line 867 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer.pm
# once (326ms+48.6ms) by installer::run at line 656 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer.pm
# once (59.9ms+8.13ms) by installer::run at line 857 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer.pm
# once (54.6ms+9.48ms) by installer::run at line 637 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer.pm
# once (210µs+0s) by installer::run at line 817 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer.pm
# once (28µs+0s) by installer::run at line 815 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer.pm
# once (15µs+0s) by installer::run at line 847 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer.pm
# once (7µs+0s) by installer::run at line 774 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer.pm
# once (7µs+0s) by installer::run at line 756 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer.pm
# once (4µs+0s) by installer::run at line 796 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer.pm | ||||
650 | 11 | 16µs | my ($itemsarrayref) = @_; | ||
651 | |||||
652 | # Changing key for multilingual items from "Name ( )" to "Name" or "HostName ( )" to "HostName" | ||||
653 | |||||
654 | 11 | 142ms | for ( my $i = 0; $i <= $#{$itemsarrayref}; $i++ ) | ||
655 | { | ||||
656 | 63254 | 45.4ms | my $oneitem = ${$itemsarrayref}[$i]; | ||
657 | 63254 | 57.1ms | my $onelanguage = $oneitem->{'specificlanguage'}; | ||
658 | |||||
659 | 63254 | 67.0ms | if (!($onelanguage eq "" )) # language dependent item | ||
660 | { | ||||
661 | 59841 | 20.6ms | my $itemkey; | ||
662 | |||||
663 | 59841 | 221ms | foreach $itemkey (keys %{$oneitem}) | ||
664 | { | ||||
665 | 558682 | 2.58s | 558682 | 550ms | if ( $itemkey =~ /^\s*(\S+?)\s+\(\S+\)\s*$/ ) # spent 550ms making 558682 calls to installer::scriptitems::CORE:match, avg 984ns/call |
666 | { | ||||
667 | 92816 | 99.4ms | my $newitemkey = $1; | ||
668 | 92816 | 85.1ms | my $itemvalue = $oneitem->{$itemkey}; | ||
669 | 92816 | 125ms | $oneitem->{$newitemkey} = $itemvalue; | ||
670 | 92816 | 120ms | delete($oneitem->{$itemkey}); | ||
671 | } | ||||
672 | } | ||||
673 | } | ||||
674 | } | ||||
675 | } | ||||
676 | |||||
677 | ################################################################################ | ||||
678 | # Replacement of setup variables in ConfigurationItems and ProfileItems | ||||
679 | # <productkey>, <buildid>, <sequence_languages>, <productcode>, <upgradecode>, <productupdate> | ||||
680 | ################################################################################ | ||||
681 | |||||
682 | sub replace_setup_variables | ||||
683 | # spent 1.40s (3.71ms+1.40) within installer::scriptitems::replace_setup_variables which was called:
# once (3.71ms+1.40s) by installer::run at line 819 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer.pm | ||||
684 | 1 | 2µs | my ($itemsarrayref, $languagestringref, $hashref) = @_; | ||
685 | |||||
686 | 1 | 3µs | my $languagesstring = $$languagestringref; | ||
687 | 1 | 122µs | 1 | 115µs | $languagesstring =~ s/\_/ /g; # replacing underscore with whitespace # spent 115µs making 1 call to installer::scriptitems::CORE:subst |
688 | |||||
689 | 1 | 3µs | my $productname = $hashref->{'PRODUCTNAME'}; | ||
690 | 1 | 2µs | my $productversion = $hashref->{'PRODUCTVERSION'}; | ||
691 | 1 | 2µs | my $userdirproductversion = ""; | ||
692 | 1 | 2µs | if ( $hashref->{'USERDIRPRODUCTVERSION'} ) { $userdirproductversion = $hashref->{'USERDIRPRODUCTVERSION'}; } | ||
693 | 1 | 3µs | my $productkey = $productname . " " . $productversion; | ||
694 | |||||
695 | # string $buildid, which is used to replace the setup variable <buildid> | ||||
696 | |||||
697 | 1 | 1µs | my $localminor = "flat"; | ||
698 | 1 | 2µs | if ( $installer::globals::minor ne "" ) { $localminor = $installer::globals::minor; } | ||
699 | 1 | 2µs | else { $localminor = $installer::globals::lastminor; } | ||
700 | |||||
701 | 1 | 2µs | my $localbuild = $installer::globals::build; | ||
702 | |||||
703 | 1 | 15µs | 1 | 6µs | if ( $localbuild =~ /^\s*(\w+?)(\d+)\s*$/ ) { $localbuild = $2; } # using "680" instead of "src680" # spent 6µs making 1 call to installer::scriptitems::CORE:match |
704 | |||||
705 | 1 | 1.40s | 1 | 1.40s | my $buildidstring = join( '-', split( ' ', `$ENV{'SRC_ROOT'}/g -s log -n 1 --pretty=format:"%h "` )); # spent 1.40s making 1 call to installer::scriptitems::CORE:backtick |
706 | 1 | 6µs | if ($? || !$buildidstring) { | ||
707 | $buildidstring = $localbuild . $localminor . "(Build:" . $installer::globals::buildid . ")"; | ||||
708 | } | ||||
709 | else { | ||||
710 | 1 | 5µs | $buildidstring = substr($buildidstring, 0, -1); | ||
711 | } | ||||
712 | |||||
713 | 1 | 33µs | 1 | 20µs | if ( $localminor =~ /^\s*\w(\d+)\w*\s*$/ ) { $localminor = $1; } # spent 20µs making 1 call to installer::scriptitems::CORE:match |
714 | |||||
715 | 1 | 9µs | my $updateid = $productname . "_" . $userdirproductversion . "_" . $$languagestringref; | ||
716 | 1 | 11µs | 1 | 3µs | $updateid =~ s/ /_/g; # spent 3µs making 1 call to installer::scriptitems::CORE:subst |
717 | |||||
718 | 1 | 111µs | for ( my $i = 0; $i <= $#{$itemsarrayref}; $i++ ) | ||
719 | { | ||||
720 | 78 | 60µs | my $oneitem = ${$itemsarrayref}[$i]; | ||
721 | 78 | 107µs | my $value = $oneitem->{'Value'}; | ||
722 | |||||
723 | 78 | 285µs | 78 | 50µs | $value =~ s/\<buildid\>/$buildidstring/; # spent 50µs making 78 calls to installer::scriptitems::CORE:subst, avg 645ns/call |
724 | 78 | 254µs | 78 | 39µs | $value =~ s/\<sequence_languages\>/$languagesstring/; # spent 39µs making 78 calls to installer::scriptitems::CORE:subst, avg 500ns/call |
725 | 78 | 260µs | 78 | 45µs | $value =~ s/\<productkey\>/$productkey/; # spent 45µs making 78 calls to installer::scriptitems::CORE:subst, avg 573ns/call |
726 | 78 | 269µs | 78 | 48µs | $value =~ s/\<productcode\>/$installer::globals::productcode/; # spent 48µs making 78 calls to installer::scriptitems::CORE:subst, avg 610ns/call |
727 | 78 | 273µs | 78 | 49µs | $value =~ s/\<upgradecode\>/$installer::globals::upgradecode/; # spent 49µs making 78 calls to installer::scriptitems::CORE:subst, avg 623ns/call |
728 | 78 | 262µs | 78 | 42µs | $value =~ s/\<alllanguages\>/$languagesstring/; # spent 42µs making 78 calls to installer::scriptitems::CORE:subst, avg 535ns/call |
729 | 78 | 250µs | 78 | 39µs | $value =~ s/\<productmajor\>/$localbuild/; # spent 39µs making 78 calls to installer::scriptitems::CORE:subst, avg 495ns/call |
730 | 78 | 256µs | 78 | 38µs | $value =~ s/\<productminor\>/$localminor/; # spent 38µs making 78 calls to installer::scriptitems::CORE:subst, avg 486ns/call |
731 | 78 | 258µs | 78 | 41µs | $value =~ s/\<productbuildid\>/$installer::globals::buildid/; # spent 41µs making 78 calls to installer::scriptitems::CORE:subst, avg 531ns/call |
732 | 78 | 257µs | 78 | 41µs | $value =~ s/\<sourceid\>/$installer::globals::build/; # spent 41µs making 78 calls to installer::scriptitems::CORE:subst, avg 529ns/call |
733 | 78 | 257µs | 78 | 40µs | $value =~ s/\<updateid\>/$updateid/; # spent 40µs making 78 calls to installer::scriptitems::CORE:subst, avg 519ns/call |
734 | 78 | 269µs | 78 | 48µs | $value =~ s/\<pkgformat\>/$installer::globals::packageformat/; # spent 48µs making 78 calls to installer::scriptitems::CORE:subst, avg 618ns/call |
735 | 78 | 50µs | $ENV{'OOO_VENDOR'} = "" if !defined $ENV{'OOO_VENDOR'}; | ||
736 | 78 | 270µs | 78 | 43µs | $value =~ s/\<vendor\>/$ENV{'OOO_VENDOR'}/; # spent 43µs making 78 calls to installer::scriptitems::CORE:subst, avg 547ns/call |
737 | 78 | 41µs | $ENV{'BUILD_VER_STRING'} = "" if !defined $ENV{'BUILD_VER_STRING'}; | ||
738 | 78 | 262µs | 78 | 38µs | $value =~ s/\<buildversion\>/$ENV{'BUILD_VER_STRING'}/; # spent 38µs making 78 calls to installer::scriptitems::CORE:subst, avg 492ns/call |
739 | |||||
740 | 78 | 108µs | $oneitem->{'Value'} = $value; | ||
741 | } | ||||
742 | } | ||||
743 | |||||
744 | ################################################################################ | ||||
745 | # By defining variable LOCALUSERDIR in *.lst it is possible to change | ||||
746 | # the standard destination of user directory defined in scp2 ($SYSUSERCONFIG). | ||||
747 | ################################################################################ | ||||
748 | |||||
749 | sub replace_userdir_variable | ||||
750 | { | ||||
751 | my ($itemsarrayref) = @_; | ||||
752 | |||||
753 | my $userdir = ""; | ||||
754 | if ( $allvariableshashref->{'LOCALUSERDIR'} ) { $userdir = $allvariableshashref->{'LOCALUSERDIR'}; } | ||||
755 | else { $userdir = $installer::globals::simpledefaultuserdir; } | ||||
756 | |||||
757 | if ( $userdir ne "" ) | ||||
758 | { | ||||
759 | for ( my $i = 0; $i <= $#{$itemsarrayref}; $i++ ) | ||||
760 | { | ||||
761 | my $oneitem = ${$itemsarrayref}[$i]; | ||||
762 | $oneitem->{'Value'} =~ s/\$SYSUSERCONFIG/$userdir/; | ||||
763 | } | ||||
764 | } | ||||
765 | } | ||||
766 | |||||
767 | ##################################################################################### | ||||
768 | # Files and ConfigurationItems are not included for all languages. | ||||
769 | # For instance asian fonts. These can be removed, if no "Name" is found. | ||||
770 | # ConfigurationItems are not always defined in the linguistic configuration file. | ||||
771 | # The "Key" cannot be found for them. | ||||
772 | ##################################################################################### | ||||
773 | |||||
774 | sub remove_non_existent_languages_in_productlists | ||||
775 | # spent 43.7ms (43.5+150µs) within installer::scriptitems::remove_non_existent_languages_in_productlists which was called:
# once (43.5ms+150µs) by installer::run at line 660 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer.pm | ||||
776 | 1 | 5µs | my ($itemsarrayref, $languagestringref, $searchkey, $itemtype) = @_; | ||
777 | |||||
778 | # Removing of all non existent files, for instance asian fonts | ||||
779 | |||||
780 | 1 | 8µs | 1 | 150µs | installer::logger::include_header_into_logfile("Removing for this language $$languagestringref:"); # spent 150µs making 1 call to installer::logger::include_header_into_logfile |
781 | |||||
782 | 1 | 1µs | my @allexistentitems = (); | ||
783 | |||||
784 | 1 | 600ns | my $infoline; | ||
785 | |||||
786 | 1 | 8.02ms | for ( my $i = 0; $i <= $#{$itemsarrayref}; $i++ ) | ||
787 | { | ||||
788 | 7920 | 4.34ms | my $oneitem = ${$itemsarrayref}[$i]; | ||
789 | 7920 | 3.33ms | my $oneitemname = ""; # $searchkey is "Name" for files and "Key" for ConfigurationItems | ||
790 | |||||
791 | 7920 | 9.50ms | if ( $oneitem->{$searchkey} ) { $oneitemname = $oneitem->{$searchkey} } | ||
792 | |||||
793 | 7920 | 3.03ms | my $itemtoberemoved = 0; | ||
794 | |||||
795 | 7920 | 2.99ms | if ($oneitemname eq "") # for instance asian font in english installation set | ||
796 | { | ||||
797 | $itemtoberemoved = 1; | ||||
798 | } | ||||
799 | |||||
800 | 7920 | 6.45ms | if ($itemtoberemoved) | ||
801 | { | ||||
802 | 416 | 684µs | $infoline = "WARNING: Language $$languagestringref: No $itemtype packed for $oneitem->{'gid'}!\n"; | ||
803 | 416 | 732µs | push( @installer::globals::logfileinfo, $infoline); | ||
804 | } | ||||
805 | else | ||||
806 | { | ||||
807 | 7504 | 4.40ms | push(@allexistentitems, $oneitem); | ||
808 | } | ||||
809 | } | ||||
810 | |||||
811 | 1 | 1µs | $infoline = "\n"; | ||
812 | 1 | 1µs | push( @installer::globals::logfileinfo, $infoline); | ||
813 | |||||
814 | 1 | 28µs | return \@allexistentitems; | ||
815 | } | ||||
816 | |||||
817 | ######################################################################## | ||||
818 | # Input is the directory gid, output the "HostName" of the directory | ||||
819 | ######################################################################## | ||||
820 | |||||
821 | sub get_Directoryname_From_Directorygid | ||||
822 | # spent 520ms within installer::scriptitems::get_Directoryname_From_Directorygid which was called 7512 times, avg 69µs/call:
# 7512 times (520ms+0s) by installer::scriptitems::get_Destination_Directory_For_Item_From_Directorylist at line 917, avg 69µs/call | ||||
823 | 7512 | 7.92ms | my ($dirsarrayref ,$searchgid, $onelanguage, $oneitemgid) = @_; | ||
824 | |||||
825 | 7512 | 6.94ms | my $directoryname = ""; | ||
826 | 7512 | 2.57ms | my $onedirectory; | ||
827 | 7512 | 3.15ms | my $foundgid = 0; | ||
828 | |||||
829 | 7512 | 193ms | for ( my $i = 0; $i <= $#{$dirsarrayref}; $i++ ) | ||
830 | { | ||||
831 | 182088 | 84.7ms | $onedirectory = ${$dirsarrayref}[$i]; | ||
832 | 182088 | 101ms | my $directorygid = $onedirectory->{'gid'}; | ||
833 | |||||
834 | 182088 | 77.8ms | if ($directorygid eq $searchgid) | ||
835 | { | ||||
836 | 7512 | 3.24ms | $foundgid = 1; | ||
837 | 7512 | 4.65ms | last; | ||
838 | } | ||||
839 | } | ||||
840 | |||||
841 | 7512 | 2.78ms | if (!($foundgid)) | ||
842 | { | ||||
843 | installer::exiter::exit_program("ERROR: Gid $searchgid not defined in $installer::globals::setupscriptname", "get_Directoryname_From_Directorygid"); | ||||
844 | } | ||||
845 | |||||
846 | 7512 | 10.5ms | if ( ! ( $onedirectory->{'ismultilingual'} )) # the directory is not language dependent | ||
847 | { | ||||
848 | $directoryname = $onedirectory->{'HostName'}; | ||||
849 | } | ||||
850 | else | ||||
851 | { | ||||
852 | 109 | 229µs | $directoryname = $onedirectory->{"HostName ($onelanguage)"}; | ||
853 | } | ||||
854 | |||||
855 | # gid_Dir_Template_Wizard_Letter is defined as language dependent directory, but the file gid_Dir_Template_Wizard_Letter | ||||
856 | # is not language dependent. Therefore $onelanguage is not defined. But which language is the correct language for the | ||||
857 | # directory? | ||||
858 | # Perhaps better solution: In scp it must be forbidden to have a language independent file in a language dependent directory. | ||||
859 | |||||
860 | 7512 | 3.01ms | if (( ! $directoryname ) && ( $onelanguage eq "" )) | ||
861 | { | ||||
862 | installer::exiter::exit_program("ERROR (in scp): Directory $searchgid is language dependent, but not $oneitemgid inside this directory", "get_Directoryname_From_Directorygid"); | ||||
863 | } | ||||
864 | |||||
865 | 7512 | 34.5ms | return \$directoryname; | ||
866 | } | ||||
867 | |||||
868 | ################################################################## | ||||
869 | # Getting destination direcotory for links, files and profiles | ||||
870 | ################################################################## | ||||
871 | |||||
872 | sub get_Destination_Directory_For_Item_From_Directorylist # this is used for Files, Profiles and Links | ||||
873 | # spent 800ms (206+594) within installer::scriptitems::get_Destination_Directory_For_Item_From_Directorylist which was called 4 times, avg 200ms/call:
# once (206ms+594ms) by installer::run at line 662 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer.pm
# once (254µs+216µs) by installer::run at line 826 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer.pm
# once (8µs+0s) by installer::run at line 778 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer.pm
# once (4µs+0s) by installer::run at line 798 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer.pm | ||||
874 | 4 | 8µs | my ($itemarrayref, $dirsarrayref) = @_; | ||
875 | |||||
876 | 4 | 8.95ms | for ( my $i = 0; $i <= $#{$itemarrayref}; $i++ ) | ||
877 | { | ||||
878 | 7512 | 5.77ms | my $oneitem = ${$itemarrayref}[$i]; | ||
879 | 7512 | 7.51ms | my $oneitemgid = $oneitem->{'gid'}; | ||
880 | 7512 | 5.81ms | my $directorygid = $oneitem->{'Dir'}; # for instance gid_Dir_Program | ||
881 | 7512 | 3.55ms | my $netdirectorygid = ""; | ||
882 | 7512 | 4.80ms | my $onelanguage = $oneitem->{'specificlanguage'}; | ||
883 | 7512 | 3.06ms | my $ispredefinedprogdir = 0; | ||
884 | 7512 | 3.05ms | my $ispredefinedconfigdir = 0; | ||
885 | |||||
886 | 7512 | 5.14ms | my $oneitemname = $oneitem->{'Name'}; | ||
887 | |||||
888 | 7512 | 4.12ms | if ( $oneitem->{'NetDir'} ) { $netdirectorygid = $oneitem->{'NetDir'}; } | ||
889 | |||||
890 | 7512 | 19.7ms | 7512 | 68.1ms | installer::pathanalyzer::make_absolute_filename_to_relative_filename(\$oneitemname); # making /registry/schema/org/openoffice/VCL.xcs to VCL.xcs # spent 68.1ms making 7512 calls to installer::pathanalyzer::make_absolute_filename_to_relative_filename, avg 9µs/call |
891 | |||||
892 | 7512 | 2.88ms | my $searchdirgid; | ||
893 | |||||
894 | 7512 | 4.80ms | if ( $netdirectorygid eq "" ) # if NetDir is defined, it is privileged | ||
895 | { | ||||
896 | $searchdirgid = $directorygid | ||||
897 | } | ||||
898 | else | ||||
899 | { | ||||
900 | 55 | 31µs | $searchdirgid = $netdirectorygid | ||
901 | } | ||||
902 | |||||
903 | 7512 | 26.5ms | 7512 | 3.48ms | if ($searchdirgid =~ /PREDEFINED_PROGDIR/) # the root directory is not defined in setup script # spent 3.48ms making 7512 calls to installer::scriptitems::CORE:match, avg 463ns/call |
904 | { | ||||
905 | $ispredefinedprogdir = 1; | ||||
906 | } | ||||
907 | |||||
908 | 7512 | 24.6ms | 7512 | 2.93ms | if ($searchdirgid =~ /PREDEFINED_CONFIGDIR/) # the root directory is not defined in setup script # spent 2.93ms making 7512 calls to installer::scriptitems::CORE:match, avg 390ns/call |
909 | { | ||||
910 | $ispredefinedconfigdir = 1; | ||||
911 | } | ||||
912 | |||||
913 | 7512 | 2.78ms | my $destfilename; | ||
914 | |||||
915 | 7512 | 6.83ms | if ((!( $ispredefinedprogdir )) && (!( $ispredefinedconfigdir ))) | ||
916 | { | ||||
917 | 7512 | 19.4ms | 7512 | 520ms | my $directorynameref = get_Directoryname_From_Directorygid($dirsarrayref, $searchdirgid, $onelanguage, $oneitemgid); # spent 520ms making 7512 calls to installer::scriptitems::get_Directoryname_From_Directorygid, avg 69µs/call |
918 | 7512 | 10.5ms | $destfilename = $$directorynameref . $installer::globals::separator . $oneitemname; | ||
919 | } | ||||
920 | else | ||||
921 | { | ||||
922 | $destfilename = $oneitemname; | ||||
923 | } | ||||
924 | |||||
925 | 7512 | 13.0ms | $oneitem->{'destination'} = $destfilename; | ||
926 | } | ||||
927 | } | ||||
928 | |||||
929 | ########################################################################## | ||||
930 | # Searching a file in a list of paths | ||||
931 | ########################################################################## | ||||
932 | |||||
933 | sub get_sourcepath_from_filename_and_includepath_classic | ||||
934 | # spent 166ms (13.3+153) within installer::scriptitems::get_sourcepath_from_filename_and_includepath_classic which was called 116 times, avg 1.43ms/call:
# 109 times (12.1ms+141ms) by installer::windows::shortcut::create_shortcut_table at line 644 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer/windows/shortcut.pm, avg 1.41ms/call
# 7 times (1.15ms+11.5ms) by installer::control::check_system_path at line 129 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer/control.pm, avg 1.81ms/call | ||||
935 | 116 | 150µs | my ($searchfilenameref, $includepatharrayref, $write_logfile) = @_; | ||
936 | |||||
937 | 116 | 69µs | my ($onefile, $includepath, $infoline); | ||
938 | |||||
939 | 116 | 63µs | my $foundsourcefile = 0; | ||
940 | |||||
941 | 116 | 1.52ms | for ( my $j = 0; $j <= $#{$includepatharrayref}; $j++ ) | ||
942 | { | ||||
943 | 842 | 809µs | $includepath = ${$includepatharrayref}[$j]; | ||
944 | 842 | 2.79ms | 842 | 11.9ms | installer::remover::remove_leading_and_ending_whitespaces(\$includepath); # spent 11.9ms making 842 calls to installer::remover::remove_leading_and_ending_whitespaces, avg 14µs/call |
945 | |||||
946 | 842 | 1.14ms | $onefile = $includepath . $installer::globals::separator . $$searchfilenameref; | ||
947 | |||||
948 | 842 | 146ms | 842 | 141ms | if ( -f $onefile ) # spent 141ms making 842 calls to installer::scriptitems::CORE:ftfile, avg 168µs/call |
949 | { | ||||
950 | 116 | 81µs | $foundsourcefile = 1; | ||
951 | 116 | 157µs | last; | ||
952 | } | ||||
953 | } | ||||
954 | |||||
955 | 116 | 136µs | if (!($foundsourcefile)) | ||
956 | { | ||||
957 | $onefile = ""; # the sourcepath has to be empty | ||||
958 | if ( $write_logfile) | ||||
959 | { | ||||
960 | if ( $ENV{'DEFAULT_TO_ENGLISH_FOR_PACKING'} ) | ||||
961 | { | ||||
962 | $infoline = "WARNING: Source for $$searchfilenameref not found!\n"; # Important message in log file | ||||
963 | } | ||||
964 | else | ||||
965 | { | ||||
966 | $infoline = "ERROR: Source for $$searchfilenameref not found!\n"; # Important message in log file | ||||
967 | } | ||||
968 | |||||
969 | push( @installer::globals::logfileinfo, $infoline); | ||||
970 | } | ||||
971 | } | ||||
972 | else | ||||
973 | { | ||||
974 | 116 | 62µs | if ( $write_logfile) | ||
975 | { | ||||
976 | $infoline = "SUCCESS: Source for $$searchfilenameref: $onefile\n"; | ||||
977 | push( @installer::globals::logfileinfo, $infoline); | ||||
978 | } | ||||
979 | } | ||||
980 | |||||
981 | 116 | 747µs | return \$onefile; | ||
982 | } | ||||
983 | |||||
984 | ########################################################################## | ||||
985 | # Input is one file name, output the complete absolute path of this file | ||||
986 | ########################################################################## | ||||
987 | |||||
988 | sub get_sourcepath_from_filename_and_includepath | ||||
989 | # spent 215ms (214+846µs) within installer::scriptitems::get_sourcepath_from_filename_and_includepath which was called 8888 times, avg 24µs/call:
# 7504 times (181ms+846µs) by installer::scriptitems::get_Source_Directory_For_Files_From_Includepathlist at line 1128, avg 24µs/call
# 1283 times (29.9ms+0s) by installer::packagelist::collectpackages at line 661 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer/packagelist.pm, avg 23µs/call
# 83 times (2.54ms+0s) by installer::scriptitems::get_Source_Directory_For_Files_From_Includepathlist at line 1144, avg 31µs/call
# 7 times (144µs+0s) by installer::packagelist::check_packagelist at line 519 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer/packagelist.pm, avg 21µs/call
# 5 times (213µs+0s) by installer::windows::mergemodule::merge_mergemodules_into_msi_database at line 87 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer/windows/mergemodule.pm, avg 43µs/call
# 2 times (60µs+0s) by installer::worker::add_variables_from_inc_to_hashref at line 984 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer/worker.pm, avg 30µs/call
# once (40µs+0s) by installer::windows::update::readdatabase at line 320 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer/windows/update.pm
# once (40µs+0s) by installer::worker::set_spellcheckerlanguages at line 1425 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer/worker.pm
# once (32µs+0s) by installer::control::read_encodinglist at line 418 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer/control.pm
# once (24µs+0s) by installer::setupscript::set_setupscript_name at line 82 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer/setupscript.pm | ||||
990 | 8888 | 8.40ms | my ($searchfilenameref, $unused, $write_logfile) = @_; | ||
991 | |||||
992 | 8888 | 4.23ms | my ($onefile, $includepath, $infoline); | ||
993 | |||||
994 | 8888 | 3.87ms | my $foundsourcefile = 0; | ||
995 | 8888 | 3.22ms | my $foundnewname = 0; | ||
996 | |||||
997 | 8888 | 50.4ms | for ( my $j = 0; $j <= $#installer::globals::allincludepaths; $j++ ) | ||
998 | { | ||||
999 | 47074 | 23.5ms | my $allfiles = $installer::globals::allincludepaths[$j]; | ||
1000 | |||||
1001 | 47074 | 32.4ms | if ( exists( $allfiles->{$$searchfilenameref} )) | ||
1002 | { | ||||
1003 | 8805 | 13.8ms | $onefile = $allfiles->{'includepath'} . $installer::globals::separator . $$searchfilenameref; | ||
1004 | 8805 | 3.75ms | $foundsourcefile = 1; | ||
1005 | 8805 | 5.99ms | last; | ||
1006 | } | ||||
1007 | } | ||||
1008 | |||||
1009 | 8888 | 3.42ms | if (!($foundsourcefile)) # testing with lowercase filename | ||
1010 | { | ||||
1011 | # Attention: README01.html is copied for Windows to readme01.html, not case sensitive | ||||
1012 | |||||
1013 | 83 | 1.07ms | for ( my $j = 0; $j <= $#installer::globals::allincludepaths; $j++ ) | ||
1014 | { | ||||
1015 | 830 | 439µs | my $allfiles = $installer::globals::allincludepaths[$j]; | ||
1016 | |||||
1017 | 830 | 418µs | my $newfilename = $$searchfilenameref; | ||
1018 | 830 | 3.05ms | 830 | 450µs | $newfilename =~ s/readme/README/; # special handling for readme files # spent 450µs making 830 calls to installer::scriptitems::CORE:subst, avg 542ns/call |
1019 | 830 | 2.82ms | 830 | 396µs | $newfilename =~ s/license/LICENSE/; # special handling for license files # spent 396µs making 830 calls to installer::scriptitems::CORE:subst, avg 477ns/call |
1020 | |||||
1021 | 830 | 682µs | if ( exists( $allfiles->{$newfilename} )) | ||
1022 | { | ||||
1023 | $onefile = $allfiles->{'includepath'} . $installer::globals::separator . $newfilename; | ||||
1024 | $foundsourcefile = 1; | ||||
1025 | $foundnewname = 1; | ||||
1026 | last; | ||||
1027 | } | ||||
1028 | } | ||||
1029 | } | ||||
1030 | |||||
1031 | 8888 | 7.42ms | if (!($foundsourcefile)) | ||
1032 | { | ||||
1033 | 83 | 90µs | $onefile = ""; # the sourcepath has to be empty | ||
1034 | 83 | 69µs | if ( $write_logfile) | ||
1035 | { | ||||
1036 | 83 | 114µs | if ( $ENV{'DEFAULT_TO_ENGLISH_FOR_PACKING'} ) | ||
1037 | { | ||||
1038 | $infoline = "WARNING: Source for $$searchfilenameref not found!\n"; # Important message in log file | ||||
1039 | } | ||||
1040 | else | ||||
1041 | { | ||||
1042 | $infoline = "ERROR: Source for $$searchfilenameref not found!\n"; # Important message in log file | ||||
1043 | } | ||||
1044 | |||||
1045 | 83 | 103µs | push( @installer::globals::logfileinfo, $infoline); | ||
1046 | } | ||||
1047 | } | ||||
1048 | else | ||||
1049 | { | ||||
1050 | 8805 | 6.50ms | if ( $write_logfile) | ||
1051 | { | ||||
1052 | 7514 | 7.74ms | if (!($foundnewname)) | ||
1053 | { | ||||
1054 | $infoline = "SUCCESS: Source for $$searchfilenameref: $onefile\n"; | ||||
1055 | } | ||||
1056 | else | ||||
1057 | { | ||||
1058 | $infoline = "SUCCESS/WARNING: Special handling for $$searchfilenameref: $onefile\n"; | ||||
1059 | } | ||||
1060 | 7514 | 8.92ms | push( @installer::globals::logfileinfo, $infoline); | ||
1061 | } | ||||
1062 | } | ||||
1063 | |||||
1064 | 8888 | 42.7ms | return \$onefile; | ||
1065 | } | ||||
1066 | |||||
1067 | ############################################################## | ||||
1068 | # Determining, whether a specified directory is language | ||||
1069 | # dependent | ||||
1070 | ############################################################## | ||||
1071 | |||||
1072 | sub determine_directory_language_dependency | ||||
1073 | # spent 25.7ms within installer::scriptitems::determine_directory_language_dependency which was called 83 times, avg 309µs/call:
# 83 times (25.7ms+0s) by installer::scriptitems::get_Source_Directory_For_Files_From_Includepathlist at line 1161, avg 309µs/call | ||||
1074 | 83 | 85µs | my($directorygid, $dirsref) = @_; | ||
1075 | |||||
1076 | 83 | 35µs | my $is_multilingual = 0; | ||
1077 | |||||
1078 | 83 | 10.2ms | for ( my $i = 0; $i <= $#{$dirsref}; $i++ ) | ||
1079 | { | ||||
1080 | 9877 | 4.82ms | my $onedir = ${$dirsref}[$i]; | ||
1081 | 9877 | 5.75ms | my $gid = $onedir->{'gid'}; | ||
1082 | |||||
1083 | 9877 | 4.43ms | if ( $gid eq $directorygid ) | ||
1084 | { | ||||
1085 | 83 | 49µs | $is_multilingual = $onedir->{'ismultilingual'}; | ||
1086 | 83 | 58µs | last; | ||
1087 | } | ||||
1088 | } | ||||
1089 | |||||
1090 | 83 | 426µs | return $is_multilingual; | ||
1091 | } | ||||
1092 | |||||
1093 | ############################################################## | ||||
1094 | # Getting all source paths for all files to be packed | ||||
1095 | # $item can be "Files" or "ScpActions" | ||||
1096 | ############################################################## | ||||
1097 | |||||
1098 | sub get_Source_Directory_For_Files_From_Includepathlist | ||||
1099 | # spent 439ms (212+227) within installer::scriptitems::get_Source_Directory_For_Files_From_Includepathlist which was called 2 times, avg 219ms/call:
# once (212ms+227ms) by installer::run at line 664 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer.pm
# once (18µs+145µs) by installer::run at line 758 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer.pm | ||||
1100 | 2 | 4µs | my ($filesarrayref, $includepatharrayref, $dirsref, $item) = @_; | ||
1101 | |||||
1102 | 2 | 11µs | 2 | 287µs | installer::logger::include_header_into_logfile("$item:"); # spent 287µs making 2 calls to installer::logger::include_header_into_logfile, avg 144µs/call |
1103 | |||||
1104 | 2 | 2µs | my $infoline = ""; | ||
1105 | |||||
1106 | 2 | 9.21ms | for ( my $i = 0; $i <= $#{$filesarrayref}; $i++ ) | ||
1107 | { | ||||
1108 | 7504 | 5.49ms | my $onefile = ${$filesarrayref}[$i]; | ||
1109 | 7504 | 7.13ms | my $onelanguage = $onefile->{'specificlanguage'}; | ||
1110 | |||||
1111 | 7504 | 4.54ms | if ( ! $onefile->{'Name'} ) { installer::exiter::exit_program("ERROR: $item without name ! GID: $onefile->{'gid'} ! Language: $onelanguage", "get_Source_Directory_For_Files_From_Includepathlist"); } | ||
1112 | |||||
1113 | 7504 | 4.66ms | my $onefilename = $onefile->{'Name'}; | ||
1114 | 7504 | 3.41ms | if ( $item eq "ScpActions" ) { $onefilename =~ s/\//$installer::globals::separator/g; } | ||
1115 | 7504 | 59.3ms | 15008 | 11.4ms | $onefilename =~ s/^\s*\Q$installer::globals::separator\E//; # filename begins with a slash, for instance /registry/schema/org/openoffice/VCL.xcs # spent 6.05ms making 7504 calls to installer::scriptitems::CORE:regcomp, avg 806ns/call
# spent 5.38ms making 7504 calls to installer::scriptitems::CORE:subst, avg 717ns/call |
1116 | |||||
1117 | 7504 | 3.45ms | my $styles = ""; | ||
1118 | 7504 | 3.20ms | my $file_can_miss = 0; | ||
1119 | 7504 | 8.57ms | if ( $onefile->{'Styles'} ) { $styles = $onefile->{'Styles'}; } | ||
1120 | 7504 | 26.8ms | 7504 | 3.47ms | if ( $styles =~ /\bFILE_CAN_MISS\b/ ) { $file_can_miss = 1; } # spent 3.47ms making 7504 calls to installer::scriptitems::CORE:match, avg 462ns/call |
1121 | |||||
1122 | 7504 | 3.13ms | if (( $installer::globals::languagepack ) && ( ! $onefile->{'ismultilingual'} ) && ( ! ( $styles =~ /\bFORCELANGUAGEPACK\b/ ))) { $file_can_miss = 1; } | ||
1123 | 7504 | 2.72ms | if (( $installer::globals::helppack ) && ( ! $onefile->{'ismultilingual'} ) && ( ! ( $styles =~ /\bFORCEHELPPACK\b/ ))) { $file_can_miss = 1; } | ||
1124 | |||||
1125 | 7504 | 6.46ms | my $sourcepathref = ""; | ||
1126 | |||||
1127 | 7504 | 7.10ms | if ( $file_can_miss ) { $sourcepathref = get_sourcepath_from_filename_and_includepath(\$onefilename, $includepatharrayref, 0); } | ||
1128 | 7504 | 21.8ms | 7504 | 182ms | else { $sourcepathref = get_sourcepath_from_filename_and_includepath(\$onefilename, $includepatharrayref, 1); } # spent 182ms making 7504 calls to installer::scriptitems::get_sourcepath_from_filename_and_includepath, avg 24µs/call |
1129 | |||||
1130 | 7504 | 10.3ms | $onefile->{'sourcepath'} = $$sourcepathref; # This $$sourcepathref is empty, if no source was found | ||
1131 | |||||
1132 | # defaulting to english for multilingual files if DEFAULT_TO_ENGLISH_FOR_PACKING is set | ||||
1133 | |||||
1134 | 7504 | 13.3ms | if ( $ENV{'DEFAULT_TO_ENGLISH_FOR_PACKING'} ) | ||
1135 | { | ||||
1136 | 7504 | 4.25ms | if (( ! $onefile->{'sourcepath'} ) && ( $onefile->{'ismultilingual'} )) | ||
1137 | { | ||||
1138 | 83 | 53µs | my $oldname = $onefile->{'Name'}; | ||
1139 | 83 | 55µs | my $oldlanguage = $onefile->{'specificlanguage'}; | ||
1140 | 83 | 43µs | my $newlanguage = "en-US"; | ||
1141 | 83 | 53µs | $onefilename = $onefile->{'Name'}; | ||
1142 | 83 | 2.47ms | 332 | 1.36ms | $onefilename =~ s/$oldlanguage\./$newlanguage\./; # Example: tplwizfax_it.zip -> tplwizfax_en-US.zip # spent 878µs making 83 calls to installer::scriptitems::CORE:regcomp, avg 11µs/call
# spent 267µs making 83 calls to installer::scriptitems::CORE:subst, avg 3µs/call
# spent 216µs making 166 calls to installer::scriptitems::CORE:substcont, avg 1µs/call |
1143 | 83 | 654µs | 166 | 129µs | $onefilename =~ s/^\s*\Q$installer::globals::separator\E//; # filename begins with a slash, for instance /registry/schema/org/openoffice/VCL.xcs # spent 70µs making 83 calls to installer::scriptitems::CORE:regcomp, avg 843ns/call
# spent 59µs making 83 calls to installer::scriptitems::CORE:subst, avg 711ns/call |
1144 | 83 | 287µs | 83 | 2.54ms | $sourcepathref = get_sourcepath_from_filename_and_includepath(\$onefilename, $includepatharrayref, 1); # spent 2.54ms making 83 calls to installer::scriptitems::get_sourcepath_from_filename_and_includepath, avg 31µs/call |
1145 | 83 | 117µs | $onefile->{'sourcepath'} = $$sourcepathref; # This $$sourcepathref is empty, if no source was found | ||
1146 | |||||
1147 | 83 | 195µs | if ($onefile->{'sourcepath'}) # defaulting to english was successful | ||
1148 | { | ||||
1149 | 83 | 87µs | $infoline = "WARNING: Using $onefilename instead of $oldname\n"; | ||
1150 | 83 | 94µs | push( @installer::globals::logfileinfo, $infoline); | ||
1151 | 83 | 396µs | 83 | 84µs | print " $infoline"; # spent 84µs making 83 calls to installer::scriptitems::CORE:print, avg 1µs/call |
1152 | |||||
1153 | # If the directory, in which the new file is installed, is not language dependent, | ||||
1154 | # the filename has to be changed to avoid installation conflicts | ||||
1155 | # No mechanism for resource files! | ||||
1156 | # -> implementing for the content of ARCHIVE files | ||||
1157 | |||||
1158 | 83 | 586µs | 83 | 231µs | if ( $onefile->{'Styles'} =~ /\bARCHIVE\b/ ) # spent 231µs making 83 calls to installer::scriptitems::CORE:match, avg 3µs/call |
1159 | { | ||||
1160 | 83 | 78µs | my $directorygid = $onefile->{'Dir'}; | ||
1161 | 83 | 243µs | 83 | 25.7ms | my $islanguagedependent = determine_directory_language_dependency($directorygid, $dirsref); # spent 25.7ms making 83 calls to installer::scriptitems::determine_directory_language_dependency, avg 309µs/call |
1162 | |||||
1163 | 83 | 48µs | if ( ! $islanguagedependent ) | ||
1164 | { | ||||
1165 | $onefile->{'Styles'} =~ s/\bARCHIVE\b/ARCHIVE, RENAME_TO_LANGUAGE/; # Setting new flag RENAME_TO_LANGUAGE | ||||
1166 | $infoline = "Setting flag RENAME_TO_LANGUAGE: File $onefile->{'Name'} in directory: $directorygid\n"; | ||||
1167 | push( @installer::globals::logfileinfo, $infoline); | ||||
1168 | } | ||||
1169 | } | ||||
1170 | } | ||||
1171 | else | ||||
1172 | { | ||||
1173 | $infoline = "WARNING: Using $onefile->{'Name'} instead of $oldname was not successful\n"; | ||||
1174 | push( @installer::globals::logfileinfo, $infoline); | ||||
1175 | $onefile->{'Name'} = $oldname; # Switching back to old file name | ||||
1176 | } | ||||
1177 | } | ||||
1178 | } | ||||
1179 | } | ||||
1180 | |||||
1181 | 2 | 2µs | $infoline = "\n"; # empty line after listing of all files | ||
1182 | 2 | 21µs | push( @installer::globals::logfileinfo, $infoline); | ||
1183 | } | ||||
1184 | |||||
1185 | ################################################################################# | ||||
1186 | # Removing files, that shall not be included into languagepacks | ||||
1187 | # (because of rpm conflicts) | ||||
1188 | ################################################################################# | ||||
1189 | |||||
1190 | sub remove_Files_For_Languagepacks | ||||
1191 | { | ||||
1192 | my ($itemsarrayref) = @_; | ||||
1193 | |||||
1194 | my $infoline; | ||||
1195 | |||||
1196 | my @newitemsarray = (); | ||||
1197 | |||||
1198 | for ( my $i = 0; $i <= $#{$itemsarrayref}; $i++ ) | ||||
1199 | { | ||||
1200 | my $oneitem = ${$itemsarrayref}[$i]; | ||||
1201 | my $gid = $oneitem->{'gid'}; | ||||
1202 | |||||
1203 | # scp Todo: Remove asap after removal of old setup | ||||
1204 | |||||
1205 | if (( $gid eq "gid_File_Extra_Fontunxpsprint" ) || | ||||
1206 | ( $gid eq "gid_File_Extra_Migration_Lang" )) | ||||
1207 | { | ||||
1208 | $infoline = "ATTENTION: Removing item $oneitem->{'gid'} from the installation set.\n"; | ||||
1209 | push( @installer::globals::logfileinfo, $infoline); | ||||
1210 | |||||
1211 | next; | ||||
1212 | } | ||||
1213 | |||||
1214 | push(@newitemsarray, $oneitem); | ||||
1215 | } | ||||
1216 | |||||
1217 | return \@newitemsarray; | ||||
1218 | } | ||||
1219 | |||||
1220 | ################################################################################# | ||||
1221 | # Files, whose source directory is not found, are removed now (this is an ERROR) | ||||
1222 | ################################################################################# | ||||
1223 | |||||
1224 | sub remove_Files_Without_Sourcedirectory | ||||
1225 | # spent 23.9ms within installer::scriptitems::remove_Files_Without_Sourcedirectory which was called:
# once (23.9ms+0s) by installer::run at line 666 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer.pm | ||||
1226 | 1 | 2µs | my ($filesarrayref) = @_; | ||
1227 | |||||
1228 | 1 | 500ns | my $infoline; | ||
1229 | |||||
1230 | 1 | 500ns | my $error_occurred = 0; | ||
1231 | 1 | 1µs | my @missingfiles = (); | ||
1232 | 1 | 2µs | push(@missingfiles, "ERROR: The following files could not be found: \n"); | ||
1233 | |||||
1234 | 1 | 1µs | my @newfilesarray = (); | ||
1235 | |||||
1236 | 1 | 7.66ms | for ( my $i = 0; $i <= $#{$filesarrayref}; $i++ ) | ||
1237 | { | ||||
1238 | 7504 | 4.59ms | my $onefile = ${$filesarrayref}[$i]; | ||
1239 | 7504 | 4.97ms | my $sourcepath = $onefile->{'sourcepath'}; | ||
1240 | |||||
1241 | 7504 | 2.78ms | if ($sourcepath eq "") | ||
1242 | { | ||||
1243 | my $styles = $onefile->{'Styles'}; | ||||
1244 | my $filename = $onefile->{'Name'}; | ||||
1245 | |||||
1246 | if ( ! $installer::globals::languagepack && !$installer::globals::helppack) | ||||
1247 | { | ||||
1248 | $infoline = "ERROR: Removing file $filename from file list.\n"; | ||||
1249 | push( @installer::globals::logfileinfo, $infoline); | ||||
1250 | |||||
1251 | push(@missingfiles, "ERROR: File not found: $filename\n"); | ||||
1252 | $error_occurred = 1; | ||||
1253 | |||||
1254 | next; # removing this file from list, if sourcepath is empty | ||||
1255 | } | ||||
1256 | elsif ( $installer::globals::languagepack ) # special case for language packs | ||||
1257 | { | ||||
1258 | if (( $onefile->{'ismultilingual'} ) || ( $styles =~ /\bFORCELANGUAGEPACK\b/ )) | ||||
1259 | { | ||||
1260 | $infoline = "ERROR: Removing file $filename from file list.\n"; | ||||
1261 | push( @installer::globals::logfileinfo, $infoline); | ||||
1262 | |||||
1263 | push(@missingfiles, "ERROR: File not found: $filename\n"); | ||||
1264 | $error_occurred = 1; | ||||
1265 | |||||
1266 | next; # removing this file from list, if sourcepath is empty | ||||
1267 | } | ||||
1268 | else | ||||
1269 | { | ||||
1270 | $infoline = "INFO: Removing file $filename from file list. It is not language dependent.\n"; | ||||
1271 | push( @installer::globals::logfileinfo, $infoline); | ||||
1272 | $infoline = "INFO: It is not language dependent and can be ignored in language packs.\n"; | ||||
1273 | push( @installer::globals::logfileinfo, $infoline); | ||||
1274 | |||||
1275 | next; # removing this file from list, if sourcepath is empty | ||||
1276 | } | ||||
1277 | } | ||||
1278 | else # special case for help packs | ||||
1279 | { | ||||
1280 | if (( $onefile->{'ismultilingual'} ) || ( $styles =~ /\bFORCEHELPPACK\b/ )) | ||||
1281 | { | ||||
1282 | $infoline = "ERROR: Removing file $filename from file list.\n"; | ||||
1283 | push( @installer::globals::logfileinfo, $infoline); | ||||
1284 | |||||
1285 | push(@missingfiles, "ERROR: File not found: $filename\n"); | ||||
1286 | $error_occurred = 1; | ||||
1287 | |||||
1288 | next; # removing this file from list, if sourcepath is empty | ||||
1289 | } | ||||
1290 | else | ||||
1291 | { | ||||
1292 | $infoline = "INFO: Removing file $filename from file list. It is not language dependent.\n"; | ||||
1293 | push( @installer::globals::logfileinfo, $infoline); | ||||
1294 | $infoline = "INFO: It is not language dependent and can be ignored in help packs.\n"; | ||||
1295 | push( @installer::globals::logfileinfo, $infoline); | ||||
1296 | |||||
1297 | next; # removing this file from list, if sourcepath is empty | ||||
1298 | } | ||||
1299 | } | ||||
1300 | } | ||||
1301 | |||||
1302 | 7504 | 3.86ms | push(@newfilesarray, $onefile); | ||
1303 | } | ||||
1304 | |||||
1305 | 1 | 2µs | $infoline = "\n"; | ||
1306 | 1 | 2µs | push( @installer::globals::logfileinfo, $infoline); | ||
1307 | |||||
1308 | 1 | 1µs | if ( $error_occurred ) | ||
1309 | { | ||||
1310 | for ( my $i = 0; $i <= $#missingfiles; $i++ ) { print "$missingfiles[$i]"; } | ||||
1311 | installer::exiter::exit_program("ERROR: Missing files", "remove_Files_Without_Sourcedirectory"); | ||||
1312 | } | ||||
1313 | |||||
1314 | 1 | 27µs | return \@newfilesarray; | ||
1315 | } | ||||
1316 | |||||
1317 | ############################################################################ | ||||
1318 | # License and Readme files in the default language have to be installed | ||||
1319 | # in the directory with flag OFFICEDIRECTORY. If this is not defined | ||||
1320 | # they have to be installed in the installation root. | ||||
1321 | ############################################################################ | ||||
1322 | |||||
1323 | sub get_office_directory_gid_and_hostname | ||||
1324 | # spent 47µs (34+13) within installer::scriptitems::get_office_directory_gid_and_hostname which was called:
# once (34µs+13µs) by installer::scriptitems::add_License_Files_into_Installdir at line 1367 | ||||
1325 | 1 | 1µs | my ($dirsarrayref) = @_; | ||
1326 | |||||
1327 | 1 | 1µs | my $foundofficedir = 0; | ||
1328 | 1 | 2µs | my $gid = ""; | ||
1329 | 1 | 1µs | my $hostname = ""; | ||
1330 | |||||
1331 | 1 | 2µs | for ( my $i = 0; $i <= $#{$dirsarrayref}; $i++ ) | ||
1332 | { | ||||
1333 | 1 | 1µs | my $onedir = ${$dirsarrayref}[$i]; | ||
1334 | 1 | 2µs | if ( $onedir->{'Styles'} ) | ||
1335 | { | ||||
1336 | 1 | 2µs | my $styles = $onedir->{'Styles'}; | ||
1337 | |||||
1338 | 1 | 21µs | 1 | 13µs | if ( $styles =~ /\bOFFICEDIRECTORY\b/ ) # spent 13µs making 1 call to installer::scriptitems::CORE:match |
1339 | { | ||||
1340 | 1 | 1µs | $foundofficedir = 1; | ||
1341 | 1 | 4µs | $gid = $onedir->{'gid'}; | ||
1342 | 1 | 2µs | $hostname = $onedir->{'HostName'}; | ||
1343 | 1 | 2µs | last; | ||
1344 | } | ||||
1345 | } | ||||
1346 | } | ||||
1347 | |||||
1348 | 1 | 9µs | return ($foundofficedir, $gid, $hostname); | ||
1349 | } | ||||
1350 | |||||
1351 | ############################################################################ | ||||
1352 | # License and Readme files in the default language have to be installed | ||||
1353 | # in the installation root (next to the program dir). This is in scp | ||||
1354 | # project done by a post install basic script | ||||
1355 | ############################################################################ | ||||
1356 | |||||
1357 | sub add_License_Files_into_Installdir | ||||
1358 | # spent 114ms (98.8+15.7) within installer::scriptitems::add_License_Files_into_Installdir which was called:
# once (98.8ms+15.7ms) by installer::run at line 673 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer.pm | ||||
1359 | 1 | 3µs | my ($filesarrayref, $dirsarrayref, $languagesarrayref) = @_; | ||
1360 | |||||
1361 | 1 | 500ns | my $infoline; | ||
1362 | |||||
1363 | 1 | 1µs | my @newfilesarray = (); | ||
1364 | |||||
1365 | 1 | 6µs | 1 | 8µs | my $defaultlanguage = installer::languages::get_default_language($languagesarrayref); # spent 8µs making 1 call to installer::languages::get_default_language |
1366 | |||||
1367 | 1 | 6µs | 1 | 47µs | my ($foundofficedir, $officedirectorygid, $officedirectoryhostname) = get_office_directory_gid_and_hostname($dirsarrayref); # spent 47µs making 1 call to installer::scriptitems::get_office_directory_gid_and_hostname |
1368 | |||||
1369 | # copy all files from directory share/readme, that contain the default language in their name | ||||
1370 | # without default language into the installation root. This makes the settings of the correct | ||||
1371 | # file names superfluous. On the other hand this requires a dependency to the directory | ||||
1372 | # share/readme | ||||
1373 | |||||
1374 | 1 | 8.65ms | for ( my $i = 0; $i <= $#{$filesarrayref}; $i++ ) | ||
1375 | { | ||||
1376 | 7504 | 4.60ms | my $onefile = ${$filesarrayref}[$i]; | ||
1377 | 7504 | 6.18ms | my $destination = $onefile->{'destination'}; | ||
1378 | 7504 | 3.02ms | my $styles = ""; | ||
1379 | 7504 | 8.25ms | if ( $onefile->{'Styles'} ) { $styles = $onefile->{'Styles'}; } | ||
1380 | |||||
1381 | 7504 | 77.8ms | 22512 | 15.6ms | if ( ( $destination =~ /share\Q$installer::globals::separator\Ereadme\Q$installer::globals::separator\E(\w+?)_?$defaultlanguage\.?(\w*)\s*/ ) # spent 8.69ms making 7504 calls to installer::scriptitems::CORE:regcomp, avg 1µs/call
# spent 6.93ms making 15008 calls to installer::scriptitems::CORE:match, avg 462ns/call |
1382 | || (( $styles =~ /\bROOTLICENSEFILE\b/ ) && ( $destination =~ /\Q$installer::globals::separator\E?(\w+?)_?$defaultlanguage\.?(\w*?)\s*$/ )) ) | ||||
1383 | { | ||||
1384 | my $filename = $1; | ||||
1385 | my $extension = $2; | ||||
1386 | |||||
1387 | my $newfilename; | ||||
1388 | |||||
1389 | if ( $extension eq "" ) { $newfilename = $filename; } | ||||
1390 | else { $newfilename = $filename . "\." . $extension; } | ||||
1391 | |||||
1392 | my %newfile = (); | ||||
1393 | my $newfile = \%newfile; | ||||
1394 | |||||
1395 | installer::converter::copy_item_object($onefile, $newfile); | ||||
1396 | |||||
1397 | $newfile->{'gid'} = $onefile->{'gid'} . "_Copy"; | ||||
1398 | $newfile->{'Name'} = $newfilename; | ||||
1399 | $newfile->{'ismultilingual'} = "0"; | ||||
1400 | $newfile->{'specificlanguage'} = ""; | ||||
1401 | $newfile->{'haslanguagemodule'} = "0"; | ||||
1402 | |||||
1403 | if ( defined $newfile->{'InstallName'} ) | ||||
1404 | { | ||||
1405 | if ( $newfile->{'InstallName'} =~ /^\s*(.*?)_$defaultlanguage\.?(\w*?)\s*$/ ) | ||||
1406 | { | ||||
1407 | my $localfilename = $1; | ||||
1408 | my $localextension = $2; | ||||
1409 | |||||
1410 | if ( $localextension eq "" ) { $newfile->{'InstallName'} = $localfilename; } | ||||
1411 | else { $newfile->{'InstallName'} = $localfilename . "\." . $localextension; } | ||||
1412 | } | ||||
1413 | } | ||||
1414 | |||||
1415 | $newfile->{'removelangfromfile'} = "1"; # Important for files with an InstallName, because language also has to be removed there. | ||||
1416 | |||||
1417 | if ( $foundofficedir ) | ||||
1418 | { | ||||
1419 | $newfile->{'Dir'} = $officedirectorygid; | ||||
1420 | $newfile->{'destination'} = $officedirectoryhostname . $installer::globals::separator . $newfilename; | ||||
1421 | } | ||||
1422 | else | ||||
1423 | { | ||||
1424 | $newfile->{'Dir'} = "PREDEFINED_PROGDIR"; | ||||
1425 | $newfile->{'destination'} = $newfilename; | ||||
1426 | } | ||||
1427 | |||||
1428 | # Also setting "modules=gid_Module_Root_Brand" (module with style: ROOT_BRAND_PACKAGE) | ||||
1429 | if ( $installer::globals::rootbrandpackageset ) | ||||
1430 | { | ||||
1431 | $newfile->{'modules'} = $installer::globals::rootbrandpackage; | ||||
1432 | } | ||||
1433 | |||||
1434 | push(@newfilesarray, $newfile); | ||||
1435 | |||||
1436 | $infoline = "New files: Adding file $newfilename for the installation root to the file list. Language: $defaultlanguage\n"; | ||||
1437 | push( @installer::globals::logfileinfo, $infoline); | ||||
1438 | |||||
1439 | if ( defined $newfile->{'InstallName'} ) | ||||
1440 | { | ||||
1441 | $infoline = "New files: Using installation name: $newfile->{'InstallName'}\n"; | ||||
1442 | push( @installer::globals::logfileinfo, $infoline); | ||||
1443 | } | ||||
1444 | } | ||||
1445 | |||||
1446 | 7504 | 5.91ms | push(@newfilesarray, $onefile); | ||
1447 | } | ||||
1448 | |||||
1449 | 1 | 22µs | return \@newfilesarray; | ||
1450 | } | ||||
1451 | |||||
1452 | ############################################################################ | ||||
1453 | # Some files are included for more than one language and have the same | ||||
1454 | # name and the same destination directory for all languages. This would | ||||
1455 | # lead to conflicts, if the filenames are not changed. | ||||
1456 | # In scp project this files must have the flag MAKE_LANG_SPECIFIC | ||||
1457 | # For this files, the language is included into the filename. | ||||
1458 | ############################################################################ | ||||
1459 | |||||
1460 | sub make_filename_language_specific | ||||
1461 | # spent 56.5ms (53.4+3.13) within installer::scriptitems::make_filename_language_specific which was called:
# once (53.4ms+3.13ms) by installer::run at line 678 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer.pm | ||||
1462 | 1 | 3µs | my ($filesarrayref) = @_; | ||
1463 | |||||
1464 | 1 | 2µs | my $infoline = ""; | ||
1465 | |||||
1466 | 1 | 8.36ms | for ( my $i = 0; $i <= $#{$filesarrayref}; $i++ ) | ||
1467 | { | ||||
1468 | 7504 | 5.00ms | my $onefile = ${$filesarrayref}[$i]; | ||
1469 | |||||
1470 | 7504 | 9.16ms | if ( $onefile->{'ismultilingual'} ) | ||
1471 | { | ||||
1472 | 6779 | 2.91ms | my $styles = ""; | ||
1473 | 6779 | 6.70ms | if ( $onefile->{'Styles'} ) { $styles = $onefile->{'Styles'}; } | ||
1474 | 6779 | 23.2ms | 6779 | 2.74ms | if ( $styles =~ /\bMAKE_LANG_SPECIFIC\b/ ) # spent 2.74ms making 6779 calls to installer::scriptitems::CORE:match, avg 404ns/call |
1475 | { | ||||
1476 | 21 | 21µs | my $language = $onefile->{'specificlanguage'}; | ||
1477 | 21 | 15µs | my $olddestination = $onefile->{'destination'}; | ||
1478 | 21 | 16µs | my $oldname = $onefile->{'Name'}; | ||
1479 | |||||
1480 | # Including the language into the file name. | ||||
1481 | # But be sure, to include the language before the file extension. | ||||
1482 | |||||
1483 | 21 | 10µs | my $fileextension = ""; | ||
1484 | |||||
1485 | 21 | 167µs | 21 | 66µs | if ( $onefile->{'Name'} =~ /(\.\w+?)\s*$/ ) { $fileextension = $1; } # spent 66µs making 21 calls to installer::scriptitems::CORE:match, avg 3µs/call |
1486 | 21 | 22µs | if ( $fileextension ne "" ) | ||
1487 | { | ||||
1488 | 21 | 455µs | 84 | 175µs | $onefile->{'Name'} =~ s/\Q$fileextension\E\s*$/_$language$fileextension/; # spent 73µs making 21 calls to installer::scriptitems::CORE:subst, avg 3µs/call
# spent 53µs making 42 calls to installer::scriptitems::CORE:substcont, avg 1µs/call
# spent 48µs making 21 calls to installer::scriptitems::CORE:regcomp, avg 2µs/call |
1489 | 21 | 413µs | 84 | 151µs | $onefile->{'destination'} =~ s/\Q$fileextension\E\s*$/_$language$fileextension/; # spent 67µs making 21 calls to installer::scriptitems::CORE:subst, avg 3µs/call
# spent 58µs making 42 calls to installer::scriptitems::CORE:substcont, avg 1µs/call
# spent 27µs making 21 calls to installer::scriptitems::CORE:regcomp, avg 1µs/call |
1490 | } | ||||
1491 | |||||
1492 | 21 | 12µs | $infoline = "Flag MAKE_LANG_SPECIFIC:\n"; | ||
1493 | 21 | 28µs | push( @installer::globals::logfileinfo, $infoline); | ||
1494 | 21 | 28µs | $infoline = "Changing name from $oldname to $onefile->{'Name'} !\n"; | ||
1495 | 21 | 20µs | push( @installer::globals::logfileinfo, $infoline); | ||
1496 | 21 | 24µs | $infoline = "Changing destination from $olddestination to $onefile->{'destination'} !\n"; | ||
1497 | 21 | 25µs | push( @installer::globals::logfileinfo, $infoline); | ||
1498 | } | ||||
1499 | } | ||||
1500 | } | ||||
1501 | } | ||||
1502 | |||||
1503 | ############################################################################ | ||||
1504 | # Because of the item "File" the source name must be "Name". Therefore | ||||
1505 | # "Copy" is changed to "Name" and "Name" is changed to "DestinationName". | ||||
1506 | ############################################################################ | ||||
1507 | |||||
1508 | sub change_keys_of_scpactions | ||||
1509 | # spent 13µs within installer::scriptitems::change_keys_of_scpactions which was called:
# once (13µs+0s) by installer::run at line 407 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer.pm | ||||
1510 | 1 | 3µs | my ($itemsarrayref) = @_; | ||
1511 | |||||
1512 | 1 | 14µs | for ( my $i = 0; $i <= $#{$itemsarrayref}; $i++ ) | ||
1513 | { | ||||
1514 | my $oneitem = ${$itemsarrayref}[$i]; | ||||
1515 | |||||
1516 | my $key; | ||||
1517 | |||||
1518 | # First Name to DestinationName, then deleting Name | ||||
1519 | foreach $key (keys %{$oneitem}) | ||||
1520 | { | ||||
1521 | if ( $key =~ /\bName\b/ ) | ||||
1522 | { | ||||
1523 | my $value = $oneitem->{$key}; | ||||
1524 | my $oldkey = $key; | ||||
1525 | $key =~ s/Name/DestinationName/; | ||||
1526 | $oneitem->{$key} = $value; | ||||
1527 | delete($oneitem->{$oldkey}); | ||||
1528 | } | ||||
1529 | } | ||||
1530 | |||||
1531 | # Second Copy to Name, then deleting Copy | ||||
1532 | foreach $key (keys %{$oneitem}) | ||||
1533 | { | ||||
1534 | if ( $key =~ /\bCopy\b/ ) | ||||
1535 | { | ||||
1536 | my $value = $oneitem->{$key}; | ||||
1537 | my $oldkey = $key; | ||||
1538 | $key =~ s/Copy/Name/; | ||||
1539 | $oneitem->{$key} = $value; | ||||
1540 | delete($oneitem->{$oldkey}); | ||||
1541 | } | ||||
1542 | } | ||||
1543 | } | ||||
1544 | } | ||||
1545 | |||||
1546 | ############################################################################ | ||||
1547 | # Removing all language pack files from installation set (files with | ||||
1548 | # the style LANGUAGEPACK), except this is a language pack. | ||||
1549 | ############################################################################ | ||||
1550 | |||||
1551 | sub remove_Languagepacklibraries_from_Installset | ||||
1552 | # spent 6.06ms (5.67+393µs) within installer::scriptitems::remove_Languagepacklibraries_from_Installset which was called:
# once (5.67ms+393µs) by installer::run at line 383 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer.pm | ||||
1553 | 1 | 3µs | my ($itemsarrayref) = @_; | ||
1554 | |||||
1555 | 1 | 500ns | my $infoline; | ||
1556 | |||||
1557 | 1 | 1µs | my @newitemsarray = (); | ||
1558 | |||||
1559 | 1 | 897µs | for ( my $i = 0; $i <= $#{$itemsarrayref}; $i++ ) | ||
1560 | { | ||||
1561 | 806 | 512µs | my $oneitem = ${$itemsarrayref}[$i]; | ||
1562 | 806 | 350µs | my $styles = ""; | ||
1563 | 806 | 957µs | if ( $oneitem->{'Styles'} ) { $styles = $oneitem->{'Styles'}; } | ||
1564 | |||||
1565 | 806 | 2.84ms | 806 | 393µs | if ( $styles =~ /\bLANGUAGEPACK\b/ ) # spent 393µs making 806 calls to installer::scriptitems::CORE:match, avg 488ns/call |
1566 | { | ||||
1567 | 1 | 5µs | $infoline = "Removing language pack file $oneitem->{'gid'} from the installation set.\n"; | ||
1568 | 1 | 2µs | push( @installer::globals::globallogfileinfo, $infoline); | ||
1569 | |||||
1570 | 1 | 1µs | next; | ||
1571 | } | ||||
1572 | |||||
1573 | 805 | 483µs | push(@newitemsarray, $oneitem); | ||
1574 | } | ||||
1575 | |||||
1576 | 1 | 600ns | $infoline = "\n"; | ||
1577 | 1 | 2µs | push( @installer::globals::globallogfileinfo, $infoline); | ||
1578 | |||||
1579 | 1 | 9µs | return \@newitemsarray; | ||
1580 | } | ||||
1581 | |||||
1582 | ############################################################################ | ||||
1583 | # Removing all help pack files from installation set (files with | ||||
1584 | # the style HELPPACK), except this is a help pack. | ||||
1585 | ############################################################################ | ||||
1586 | |||||
1587 | sub remove_Helppacklibraries_from_Installset | ||||
1588 | # spent 5.68ms (5.22+456µs) within installer::scriptitems::remove_Helppacklibraries_from_Installset which was called:
# once (5.22ms+456µs) by installer::run at line 388 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer.pm | ||||
1589 | 1 | 1µs | my ($itemsarrayref) = @_; | ||
1590 | |||||
1591 | 1 | 500ns | my $infoline; | ||
1592 | |||||
1593 | 1 | 1µs | my @newitemsarray = (); | ||
1594 | |||||
1595 | 1 | 915µs | for ( my $i = 0; $i <= $#{$itemsarrayref}; $i++ ) | ||
1596 | { | ||||
1597 | 805 | 422µs | my $oneitem = ${$itemsarrayref}[$i]; | ||
1598 | 805 | 341µs | my $styles = ""; | ||
1599 | 805 | 594µs | if ( $oneitem->{'Styles'} ) { $styles = $oneitem->{'Styles'}; } | ||
1600 | |||||
1601 | 805 | 2.89ms | 805 | 456µs | if ( $styles =~ /\bHELPPACK\b/ ) # spent 456µs making 805 calls to installer::scriptitems::CORE:match, avg 566ns/call |
1602 | { | ||||
1603 | 9 | 14µs | $infoline = "Removing help pack file $oneitem->{'gid'} from the installation set.\n"; | ||
1604 | 9 | 10µs | push( @installer::globals::globallogfileinfo, $infoline); | ||
1605 | |||||
1606 | 9 | 6µs | next; | ||
1607 | } | ||||
1608 | |||||
1609 | 796 | 476µs | push(@newitemsarray, $oneitem); | ||
1610 | } | ||||
1611 | |||||
1612 | 1 | 500ns | $infoline = "\n"; | ||
1613 | 1 | 1µs | push( @installer::globals::globallogfileinfo, $infoline); | ||
1614 | |||||
1615 | 1 | 7µs | return \@newitemsarray; | ||
1616 | } | ||||
1617 | |||||
1618 | ############################################################################ | ||||
1619 | # Removing all files with flag PATCH_ONLY from installation set. | ||||
1620 | # This function is not called during patch creation. | ||||
1621 | ############################################################################ | ||||
1622 | |||||
1623 | sub remove_patchonlyfiles_from_Installset | ||||
1624 | # spent 5.53ms (5.15+374µs) within installer::scriptitems::remove_patchonlyfiles_from_Installset which was called:
# once (5.15ms+374µs) by installer::run at line 393 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer.pm | ||||
1625 | 1 | 1µs | my ($itemsarrayref) = @_; | ||
1626 | |||||
1627 | 1 | 600ns | my $infoline; | ||
1628 | |||||
1629 | 1 | 500ns | my @newitemsarray = (); | ||
1630 | |||||
1631 | 1 | 888µs | for ( my $i = 0; $i <= $#{$itemsarrayref}; $i++ ) | ||
1632 | { | ||||
1633 | 796 | 412µs | my $oneitem = ${$itemsarrayref}[$i]; | ||
1634 | 796 | 344µs | my $styles = ""; | ||
1635 | 796 | 585µs | if ( $oneitem->{'Styles'} ) { $styles = $oneitem->{'Styles'}; } | ||
1636 | |||||
1637 | 796 | 2.82ms | 796 | 374µs | if ( $styles =~ /\bPATCH_ONLY\b/ ) # spent 374µs making 796 calls to installer::scriptitems::CORE:match, avg 470ns/call |
1638 | { | ||||
1639 | 3 | 6µs | $infoline = "Removing file with flag PATCH_ONLY $oneitem->{'gid'} from the installation set.\n"; | ||
1640 | 3 | 3µs | push( @installer::globals::globallogfileinfo, $infoline); | ||
1641 | |||||
1642 | 3 | 3µs | next; | ||
1643 | } | ||||
1644 | |||||
1645 | 793 | 460µs | push(@newitemsarray, $oneitem); | ||
1646 | } | ||||
1647 | |||||
1648 | 1 | 500ns | $infoline = "\n"; | ||
1649 | 1 | 1µs | push( @installer::globals::globallogfileinfo, $infoline); | ||
1650 | |||||
1651 | 1 | 8µs | return \@newitemsarray; | ||
1652 | } | ||||
1653 | |||||
1654 | ############################################################################ | ||||
1655 | # Some files cotain a $ in their name. epm conflicts with such files. | ||||
1656 | # Solution: Renaming this files, converting "$" to "$$" | ||||
1657 | ############################################################################ | ||||
1658 | |||||
1659 | sub quoting_illegal_filenames | ||||
1660 | { | ||||
1661 | my ($filesarrayref) = @_; | ||||
1662 | |||||
1663 | # This function has to be removed as soon as possible! | ||||
1664 | |||||
1665 | installer::logger::include_header_into_logfile("Renaming illegal filenames:"); | ||||
1666 | |||||
1667 | for ( my $i = 0; $i <= $#{$filesarrayref}; $i++ ) | ||||
1668 | { | ||||
1669 | my $onefile = ${$filesarrayref}[$i]; | ||||
1670 | my $filename = $onefile->{'Name'}; | ||||
1671 | |||||
1672 | if ( $filename =~ /\$/ ) | ||||
1673 | { | ||||
1674 | my $sourcepath = $onefile->{'sourcepath'}; | ||||
1675 | my $destpath = $onefile->{'destination'}; | ||||
1676 | |||||
1677 | # sourcepath and destination have to be quoted for epm list file | ||||
1678 | |||||
1679 | $destpath =~ s/\$/\$\$/g; | ||||
1680 | $sourcepath =~ s/\$/\$\$/g; | ||||
1681 | |||||
1682 | my $infoline = "ATTENTION: Files: Quoting sourcepath $onefile->{'sourcepath'} to $sourcepath\n"; | ||||
1683 | push( @installer::globals::logfileinfo, $infoline); | ||||
1684 | $infoline = "ATTENTION: Files: Quoting destination path $onefile->{'destination'} to $destpath\n"; | ||||
1685 | push( @installer::globals::logfileinfo, $infoline); | ||||
1686 | |||||
1687 | $onefile->{'sourcepath'} = $sourcepath; | ||||
1688 | $onefile->{'destination'} = $destpath; | ||||
1689 | } | ||||
1690 | } | ||||
1691 | } | ||||
1692 | |||||
1693 | ############################################################################ | ||||
1694 | # Removing multiple occurrences of same module. | ||||
1695 | ############################################################################ | ||||
1696 | |||||
1697 | sub optimize_list | ||||
1698 | # spent 353ms (174+179) within installer::scriptitems::optimize_list which was called 3682 times, avg 96µs/call:
# 1848 times (49.6ms+15.2ms) by installer::scriptitems::collect_directories_with_create_flag_from_directoryarray at line 1900, avg 35µs/call
# 1834 times (125ms+164ms) by installer::scriptitems::collect_directories_from_filesarray at line 1778, avg 157µs/call | ||||
1699 | 3682 | 4.76ms | my ( $longlist ) = @_; | ||
1700 | 3682 | 1.32ms | my %tmpHash; | ||
1701 | |||||
1702 | 3682 | 16.2ms | 3682 | 4.24ms | $longlist =~ s/^\s+//; # spent 4.24ms making 3682 calls to installer::scriptitems::CORE:subst, avg 1µs/call |
1703 | 3682 | 17.2ms | 3682 | 7.05ms | $longlist =~ s/\s+$//; # spent 7.05ms making 3682 calls to installer::scriptitems::CORE:subst, avg 2µs/call |
1704 | 3682 | 168ms | 3682 | 157ms | $longlist =~ s/\s*,\s*/,/g; # spent 157ms making 3682 calls to installer::scriptitems::CORE:subst, avg 43µs/call |
1705 | |||||
1706 | 3682 | 88.3ms | @tmpHash{split /,/, $longlist} = (); | ||
1707 | 3682 | 63.1ms | 3682 | 10.6ms | return join(",", sort keys %tmpHash); # spent 10.6ms making 3682 calls to installer::scriptitems::CORE:sort, avg 3µs/call |
1708 | } | ||||
1709 | |||||
1710 | ####################################################################### | ||||
1711 | # Collecting all directories needed for the epm list | ||||
1712 | # 1. Looking for all destination paths in the files array | ||||
1713 | # 2. Looking for directories with CREATE flag in the directory array | ||||
1714 | ####################################################################### | ||||
1715 | |||||
1716 | ################################## | ||||
1717 | # Collecting directories: Part 1 | ||||
1718 | ################################## | ||||
1719 | |||||
1720 | sub collect_directories_from_filesarray | ||||
1721 | # spent 2.51s (1.31+1.20) within installer::scriptitems::collect_directories_from_filesarray which was called:
# once (1.31s+1.20s) by installer::run at line 746 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer.pm | ||||
1722 | 1 | 2µs | my ($filesarrayref) = @_; | ||
1723 | |||||
1724 | 1 | 1µs | my @alldirectories = (); | ||
1725 | 1 | 2µs | my %alldirectoryhash = (); | ||
1726 | |||||
1727 | 1 | 500ns | my $predefinedprogdir_added = 0; | ||
1728 | |||||
1729 | # Preparing this already as hash, although the only needed value at the moment is the HostName | ||||
1730 | # But also adding: "specificlanguage" and "Dir" (for instance gid_Dir_Program) | ||||
1731 | |||||
1732 | 1 | 22.0ms | for ( my $i = 0; $i <= $#{$filesarrayref}; $i++ ) | ||
1733 | { | ||||
1734 | 15895 | 13.4ms | my $onefile = ${$filesarrayref}[$i]; | ||
1735 | 15895 | 25.1ms | my $destinationpath = $onefile->{'destination'}; | ||
1736 | 15895 | 41.7ms | 15895 | 356ms | installer::pathanalyzer::get_path_from_fullqualifiedname(\$destinationpath); # spent 356ms making 15895 calls to installer::pathanalyzer::get_path_from_fullqualifiedname, avg 22µs/call |
1737 | 15895 | 162ms | 31790 | 65.4ms | $destinationpath =~ s/\Q$installer::globals::separator\E\s*$//; # removing ending slashes or backslashes # spent 53.2ms making 15895 calls to installer::scriptitems::CORE:subst, avg 3µs/call
# spent 12.2ms making 15895 calls to installer::scriptitems::CORE:regcomp, avg 768ns/call |
1738 | |||||
1739 | do | ||||
1740 | 15895 | 1.32s | 251222 | 491ms | { # spent 292ms making 70753 calls to installer::scriptitems::CORE:subst, avg 4µs/call
# spent 143ms making 109716 calls to installer::scriptitems::CORE:substcont, avg 1µs/call
# spent 56.3ms making 70753 calls to installer::scriptitems::CORE:regcomp, avg 795ns/call |
1741 | 70753 | 108ms | if (!exists($alldirectoryhash{$destinationpath})) | ||
1742 | { | ||||
1743 | 1834 | 1.28ms | my %directoryhash = (); | ||
1744 | 1834 | 3.30ms | $directoryhash{'HostName'} = $destinationpath; | ||
1745 | 1834 | 2.88ms | $directoryhash{'specificlanguage'} = $onefile->{'specificlanguage'}; | ||
1746 | 1834 | 2.65ms | $directoryhash{'Dir'} = $onefile->{'Dir'}; | ||
1747 | 1834 | 2.26ms | $directoryhash{'modules'} = $onefile->{'modules'}; # NEW, saving modules | ||
1748 | |||||
1749 | 1834 | 1.28ms | $predefinedprogdir_added ||= $onefile->{'Dir'} eq "PREDEFINED_PROGDIR"; | ||
1750 | |||||
1751 | 1834 | 4.18ms | $alldirectoryhash{$destinationpath} = \%directoryhash; | ||
1752 | } | ||||
1753 | else | ||||
1754 | { | ||||
1755 | # Adding the modules to the module list! | ||||
1756 | 68919 | 116ms | $alldirectoryhash{$destinationpath}->{'modules'} .= "," . $onefile->{'modules'}; | ||
1757 | } | ||||
1758 | } while ($destinationpath =~ s/(^.*\S)\Q$installer::globals::separator\E(\S.*?)\s*$/$1/); # as long as the path contains slashes | ||||
1759 | } | ||||
1760 | |||||
1761 | # if there is no file in the root directory PREDEFINED_PROGDIR, it has to be included into the directory array now | ||||
1762 | # HostName= specificlanguage= Dir=PREDEFINED_PROGDIR | ||||
1763 | |||||
1764 | 1 | 500ns | if (! $predefinedprogdir_added ) | ||
1765 | { | ||||
1766 | 1 | 1µs | my %directoryhash = (); | ||
1767 | 1 | 2µs | $directoryhash{'HostName'} = ""; | ||
1768 | 1 | 1µs | $directoryhash{'specificlanguage'} = ""; | ||
1769 | 1 | 1µs | $directoryhash{'modules'} = ""; # ToDo? | ||
1770 | 1 | 1µs | $directoryhash{'Dir'} = "PREDEFINED_PROGDIR"; | ||
1771 | |||||
1772 | 1 | 3µs | push(@alldirectories, \%directoryhash); | ||
1773 | } | ||||
1774 | |||||
1775 | # Creating directory array | ||||
1776 | 1 | 4.22ms | 1 | 3.26ms | foreach my $destdir ( sort keys %alldirectoryhash ) # spent 3.26ms making 1 call to installer::scriptitems::CORE:sort |
1777 | { | ||||
1778 | 1834 | 9.13ms | 1834 | 288ms | $alldirectoryhash{$destdir}->{'modules'} = optimize_list($alldirectoryhash{$destdir}->{'modules'}); # spent 288ms making 1834 calls to installer::scriptitems::optimize_list, avg 157µs/call |
1779 | 1834 | 2.35ms | push(@alldirectories, $alldirectoryhash{$destdir}); | ||
1780 | } | ||||
1781 | |||||
1782 | 1 | 13µs | return (\@alldirectories, \%alldirectoryhash); | ||
1783 | } | ||||
1784 | |||||
1785 | ################################## | ||||
1786 | # Collecting directories: Part 2 | ||||
1787 | ################################## | ||||
1788 | |||||
1789 | sub collect_directories_with_create_flag_from_directoryarray | ||||
1790 | # spent 102ms (32.3+69.9) within installer::scriptitems::collect_directories_with_create_flag_from_directoryarray which was called:
# once (32.3ms+69.9ms) by installer::run at line 748 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer.pm | ||||
1791 | 1 | 2µs | my ($directoryarrayref, $alldirectoryhash) = @_; | ||
1792 | |||||
1793 | 1 | 500ns | my $alreadyincluded = 0; | ||
1794 | 1 | 1µs | my @alldirectories = (); | ||
1795 | |||||
1796 | 1 | 2.31ms | for ( my $i = 0; $i <= $#{$directoryarrayref}; $i++ ) | ||
1797 | { | ||||
1798 | 1972 | 1.32ms | my $onedir = ${$directoryarrayref}[$i]; | ||
1799 | 1972 | 869µs | my $styles = ""; | ||
1800 | 1972 | 706µs | $newdirincluded = 0; | ||
1801 | |||||
1802 | 1972 | 1.48ms | if ( $onedir->{'Styles'} ) { $styles = $onedir->{'Styles'}; } | ||
1803 | |||||
1804 | 1972 | 7.02ms | 1972 | 879µs | if ( $styles =~ /\bCREATE\b/ ) # spent 879µs making 1972 calls to installer::scriptitems::CORE:match, avg 446ns/call |
1805 | { | ||||
1806 | 27 | 14µs | my $directoryname = ""; | ||
1807 | |||||
1808 | 27 | 30µs | if ( $onedir->{'HostName'} ) { $directoryname = $onedir->{'HostName'}; } | ||
1809 | else { installer::exiter::exit_program("ERROR: No directory name (HostName) set for specified language in gid $onedir->{'gid'}", "collect_directories_with_create_flag_from_directoryarray"); } | ||||
1810 | |||||
1811 | 27 | 10µs | $alreadyincluded = 0; | ||
1812 | 27 | 25µs | if ( exists($alldirectoryhash->{$directoryname}) ) { $alreadyincluded = 1; } | ||
1813 | |||||
1814 | 27 | 25µs | if (!($alreadyincluded)) | ||
1815 | { | ||||
1816 | 14 | 12µs | my %directoryhash = (); | ||
1817 | 14 | 23µs | $directoryhash{'HostName'} = $directoryname; | ||
1818 | 14 | 21µs | $directoryhash{'specificlanguage'} = $onedir->{'specificlanguage'}; | ||
1819 | 14 | 17µs | $directoryhash{'Dir'} = $onedir->{'gid'}; | ||
1820 | 14 | 15µs | $directoryhash{'Styles'} = $onedir->{'Styles'}; | ||
1821 | |||||
1822 | # saving also the modules | ||||
1823 | 14 | 9µs | if ( ! $onedir->{'modules'} ) { installer::exiter::exit_program("ERROR: No assigned modules found for directory $onedir->{'gid'}", "collect_directories_with_create_flag_from_directoryarray"); } | ||
1824 | 14 | 17µs | $directoryhash{'modules'} = $onedir->{'modules'}; | ||
1825 | |||||
1826 | 14 | 25µs | $alldirectoryhash->{$directoryname} = \%directoryhash; | ||
1827 | 14 | 5µs | $newdirincluded = 1; | ||
1828 | |||||
1829 | # Problem: The $destinationpath can be share/registry/schema/org/openoffice | ||||
1830 | # but not all directories contain files and will be added to this list. | ||||
1831 | # Therefore the path has to be analyzed. | ||||
1832 | |||||
1833 | 14 | 201µs | 28 | 90µs | while ( $directoryname =~ /(^.*\S)\Q$installer::globals::separator\E(\S.*?)\s*$/ ) # as long as the path contains slashes # spent 62µs making 14 calls to installer::scriptitems::CORE:match, avg 4µs/call
# spent 29µs making 14 calls to installer::scriptitems::CORE:regcomp, avg 2µs/call |
1834 | { | ||||
1835 | 32 | 34µs | $directoryname = $1; | ||
1836 | |||||
1837 | 32 | 13µs | $alreadyincluded = 0; | ||
1838 | 32 | 28µs | if ( exists($alldirectoryhash->{$directoryname}) ) { $alreadyincluded = 1; } | ||
1839 | |||||
1840 | 32 | 443µs | 64 | 118µs | if (!($alreadyincluded)) # spent 88µs making 32 calls to installer::scriptitems::CORE:match, avg 3µs/call
# spent 30µs making 32 calls to installer::scriptitems::CORE:regcomp, avg 944ns/call |
1841 | { | ||||
1842 | my %directoryhash = (); | ||||
1843 | |||||
1844 | $directoryhash{'HostName'} = $directoryname; | ||||
1845 | $directoryhash{'specificlanguage'} = $onedir->{'specificlanguage'}; | ||||
1846 | $directoryhash{'Dir'} = $onedir->{'gid'}; | ||||
1847 | if ( ! $installer::globals::iswindowsbuild ) { $directoryhash{'Styles'} = "(CREATE)"; } # Exeception for Windows? | ||||
1848 | |||||
1849 | # saving also the modules | ||||
1850 | $directoryhash{'modules'} = $onedir->{'modules'}; | ||||
1851 | |||||
1852 | $alldirectoryhash->{$directoryname} = \%directoryhash; | ||||
1853 | $newdirincluded = 1; | ||||
1854 | } | ||||
1855 | else | ||||
1856 | { | ||||
1857 | # Adding the modules to the module list! | ||||
1858 | 32 | 224µs | $alldirectoryhash->{$directoryname}->{'modules'} = $alldirectoryhash->{$directoryname}->{'modules'} . "," . $onedir->{'modules'}; | ||
1859 | } | ||||
1860 | } | ||||
1861 | } | ||||
1862 | else | ||||
1863 | { | ||||
1864 | # Adding the modules to the module list! | ||||
1865 | 13 | 68µs | $alldirectoryhash->{$directoryname}->{'modules'} = $alldirectoryhash->{$directoryname}->{'modules'} . "," . $onedir->{'modules'}; | ||
1866 | |||||
1867 | 13 | 198µs | 26 | 99µs | while ( $directoryname =~ /(^.*\S)\Q$installer::globals::separator\E(\S.*?)\s*$/ ) # as long as the path contains slashes # spent 51µs making 13 calls to installer::scriptitems::CORE:regcomp, avg 4µs/call
# spent 48µs making 13 calls to installer::scriptitems::CORE:match, avg 4µs/call |
1868 | { | ||||
1869 | 29 | 31µs | $directoryname = $1; | ||
1870 | # Adding the modules to the module list! | ||||
1871 | 29 | 494µs | 58 | 102µs | $alldirectoryhash->{$directoryname}->{'modules'} = $alldirectoryhash->{$directoryname}->{'modules'} . "," . $onedir->{'modules'}; # spent 77µs making 29 calls to installer::scriptitems::CORE:match, avg 3µs/call
# spent 25µs making 29 calls to installer::scriptitems::CORE:regcomp, avg 876ns/call |
1872 | } | ||||
1873 | } | ||||
1874 | } | ||||
1875 | |||||
1876 | # Saving the styles for already added directories in function collect_directories_from_filesarray | ||||
1877 | |||||
1878 | 1972 | 1.28ms | if (( ! $newdirincluded ) && ( $styles ne "" )) | ||
1879 | { | ||||
1880 | 125 | 485µs | 125 | 91µs | $styles =~ s/\bWORKSTATION\b//; # spent 91µs making 125 calls to installer::scriptitems::CORE:subst, avg 728ns/call |
1881 | 125 | 484µs | 125 | 94µs | $styles =~ s/\bCREATE\b//; # spent 94µs making 125 calls to installer::scriptitems::CORE:subst, avg 749ns/call |
1882 | |||||
1883 | 125 | 1.52ms | 355 | 371µs | if (( ! ( $styles =~ /^\s*\(\s*\)\s*$/ )) && ( ! ( $styles =~ /^\s*\(\s*\,\s*\)\s*$/ )) && ( ! ( $styles =~ /^\s*$/ ))) # checking, if there are styles left # spent 371µs making 355 calls to installer::scriptitems::CORE:match, avg 1µs/call |
1884 | { | ||||
1885 | 111 | 56µs | my $directoryname = ""; | ||
1886 | 111 | 110µs | if ( $onedir->{'HostName'} ) { $directoryname = $onedir->{'HostName'}; } | ||
1887 | else { installer::exiter::exit_program("ERROR: No directory name (HostName) set for specified language in gid $onedir->{'gid'}", "collect_directories_with_create_flag_from_directoryarray"); } | ||||
1888 | |||||
1889 | 111 | 108µs | if ( exists($alldirectoryhash->{$directoryname}) ) | ||
1890 | { | ||||
1891 | $alldirectoryhash->{$directoryname}->{'Styles'} = $styles; | ||||
1892 | } | ||||
1893 | } | ||||
1894 | } | ||||
1895 | } | ||||
1896 | |||||
1897 | # Creating directory array | ||||
1898 | 1 | 3.96ms | 1 | 3.28ms | foreach my $destdir ( sort keys %{$alldirectoryhash} ) # spent 3.28ms making 1 call to installer::scriptitems::CORE:sort |
1899 | { | ||||
1900 | 1848 | 8.34ms | 1848 | 64.8ms | $alldirectoryhash->{$destdir}->{'modules'} = optimize_list($alldirectoryhash->{$destdir}->{'modules'}); # spent 64.8ms making 1848 calls to installer::scriptitems::optimize_list, avg 35µs/call |
1901 | 1848 | 2.36ms | push(@alldirectories, $alldirectoryhash->{$destdir}); | ||
1902 | } | ||||
1903 | |||||
1904 | 1 | 11µs | return (\@alldirectories, \%alldirectoryhash); | ||
1905 | } | ||||
1906 | |||||
1907 | ################################################# | ||||
1908 | # Determining the destination file of a link | ||||
1909 | ################################################# | ||||
1910 | |||||
1911 | sub get_destination_file_path_for_links | ||||
1912 | # spent 13µs within installer::scriptitems::get_destination_file_path_for_links which was called:
# once (13µs+0s) by installer::run at line 776 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer.pm | ||||
1913 | 1 | 2µs | my ($linksarrayref, $filesarrayref) = @_; | ||
1914 | |||||
1915 | 1 | 500ns | my $infoline; | ||
1916 | |||||
1917 | 1 | 3µs | for ( my $i = 0; $i <= $#{$linksarrayref}; $i++ ) | ||
1918 | { | ||||
1919 | my $fileid = ""; | ||||
1920 | my $onelink = ${$linksarrayref}[$i]; | ||||
1921 | if ( $onelink->{'FileID'} ) { $fileid = $onelink->{'FileID'}; } | ||||
1922 | |||||
1923 | if (!( $fileid eq "" )) | ||||
1924 | { | ||||
1925 | my $foundfile = 0; | ||||
1926 | |||||
1927 | for ( my $j = 0; $j <= $#{$filesarrayref}; $j++ ) | ||||
1928 | { | ||||
1929 | my $onefile = ${$filesarrayref}[$j]; | ||||
1930 | my $filegid = $onefile->{'gid'}; | ||||
1931 | |||||
1932 | if ( $filegid eq $fileid ) | ||||
1933 | { | ||||
1934 | $foundfile = 1; | ||||
1935 | $onelink->{'destinationfile'} = $onefile->{'destination'}; | ||||
1936 | last; | ||||
1937 | } | ||||
1938 | } | ||||
1939 | |||||
1940 | if (!($foundfile)) | ||||
1941 | { | ||||
1942 | $infoline = "Warning: FileID $fileid for Link $onelink->{'gid'} not found!\n"; | ||||
1943 | push( @installer::globals::logfileinfo, $infoline); | ||||
1944 | } | ||||
1945 | } | ||||
1946 | } | ||||
1947 | |||||
1948 | 1 | 2µs | $infoline = "\n"; | ||
1949 | 1 | 8µs | push( @installer::globals::logfileinfo, $infoline); | ||
1950 | } | ||||
1951 | |||||
1952 | ################################################# | ||||
1953 | # Determining the destination link of a link | ||||
1954 | ################################################# | ||||
1955 | |||||
1956 | sub get_destination_link_path_for_links | ||||
1957 | # spent 10µs within installer::scriptitems::get_destination_link_path_for_links which was called:
# once (10µs+0s) by installer::run at line 782 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer.pm | ||||
1958 | 1 | 1µs | my ($linksarrayref) = @_; | ||
1959 | |||||
1960 | 1 | 500ns | my $infoline; | ||
1961 | |||||
1962 | 1 | 2µs | for ( my $i = 0; $i <= $#{$linksarrayref}; $i++ ) | ||
1963 | { | ||||
1964 | my $shortcutid = ""; | ||||
1965 | my $onelink = ${$linksarrayref}[$i]; | ||||
1966 | if ( $onelink->{'ShortcutID'} ) { $shortcutid = $onelink->{'ShortcutID'}; } | ||||
1967 | |||||
1968 | if (!( $shortcutid eq "" )) | ||||
1969 | { | ||||
1970 | my $foundlink = 0; | ||||
1971 | |||||
1972 | for ( my $j = 0; $j <= $#{$linksarrayref}; $j++ ) | ||||
1973 | { | ||||
1974 | my $destlink = ${$linksarrayref}[$j]; | ||||
1975 | $shortcutgid = $destlink->{'gid'}; | ||||
1976 | |||||
1977 | if ( $shortcutgid eq $shortcutid ) | ||||
1978 | { | ||||
1979 | $foundlink = 1; | ||||
1980 | $onelink->{'destinationfile'} = $destlink->{'destination'}; # making key 'destinationfile' | ||||
1981 | last; | ||||
1982 | } | ||||
1983 | } | ||||
1984 | |||||
1985 | if (!($foundlink)) | ||||
1986 | { | ||||
1987 | $infoline = "Warning: ShortcutID $shortcutid for Link $onelink->{'gid'} not found!\n"; | ||||
1988 | push( @installer::globals::logfileinfo, $infoline); | ||||
1989 | } | ||||
1990 | } | ||||
1991 | } | ||||
1992 | |||||
1993 | 1 | 2µs | $infoline = "\n"; | ||
1994 | 1 | 9µs | push( @installer::globals::logfileinfo, $infoline); | ||
1995 | } | ||||
1996 | |||||
1997 | ################################################################################### | ||||
1998 | # Items with flag WORKSTATION are not needed (here: links and configurationitems) | ||||
1999 | ################################################################################### | ||||
2000 | |||||
2001 | sub remove_workstation_only_items | ||||
2002 | # spent 9µs within installer::scriptitems::remove_workstation_only_items which was called:
# once (9µs+0s) by installer::run at line 784 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer.pm | ||||
2003 | 1 | 2µs | my ($itemarrayref) = @_; | ||
2004 | |||||
2005 | 1 | 1µs | my @newitemarray = (); | ||
2006 | |||||
2007 | 1 | 3µs | for ( my $i = 0; $i <= $#{$itemarrayref}; $i++ ) | ||
2008 | { | ||||
2009 | my $oneitem = ${$itemarrayref}[$i]; | ||||
2010 | my $styles = $oneitem->{'Styles'}; | ||||
2011 | |||||
2012 | if (( $styles =~ /\bWORKSTATION\b/ ) && | ||||
2013 | (!( $styles =~ /\bNETWORK\b/ )) && | ||||
2014 | (!( $styles =~ /\bSTANDALONE\b/ ))) | ||||
2015 | { | ||||
2016 | next; # removing this link, it is only needed for a workstation installation | ||||
2017 | } | ||||
2018 | |||||
2019 | push(@newitemarray, $oneitem); | ||||
2020 | } | ||||
2021 | |||||
2022 | 1 | 9µs | return \@newitemarray; | ||
2023 | } | ||||
2024 | |||||
2025 | ################################################ | ||||
2026 | # Resolving relative path in links | ||||
2027 | ################################################ | ||||
2028 | |||||
2029 | sub resolve_links_with_flag_relative | ||||
2030 | # spent 8µs within installer::scriptitems::resolve_links_with_flag_relative which was called:
# once (8µs+0s) by installer::run at line 786 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer.pm | ||||
2031 | 1 | 2µs | my ($linksarrayref) = @_; | ||
2032 | |||||
2033 | # Before this step is: | ||||
2034 | # destination=program/libsalhelperC52.so.3, this will be the name of the link | ||||
2035 | # destinationfile=program/libsalhelperC52.so.3, this will be the linked file or name | ||||
2036 | # If the flag RELATIVE is set, the paths have to be analyzed. If the flag is not set | ||||
2037 | # (this will not occur in the future?) destinationfile has to be an absolute path name | ||||
2038 | |||||
2039 | 1 | 10µs | for ( my $i = 0; $i <= $#{$linksarrayref}; $i++ ) | ||
2040 | { | ||||
2041 | my $onelink = ${$linksarrayref}[$i]; | ||||
2042 | my $styles = $onelink->{'Styles'}; | ||||
2043 | |||||
2044 | if ( $styles =~ /\bRELATIVE\b/ ) | ||||
2045 | { | ||||
2046 | # ToDo: This is only a simple not sufficient mechanism | ||||
2047 | |||||
2048 | my $destination = $onelink->{'destination'}; | ||||
2049 | my $destinationfile = $onelink->{'destinationfile'}; | ||||
2050 | |||||
2051 | my $destinationpath = $destination; | ||||
2052 | |||||
2053 | installer::pathanalyzer::get_path_from_fullqualifiedname(\$destinationpath); | ||||
2054 | |||||
2055 | my $destinationfilepath = $destinationfile; | ||||
2056 | |||||
2057 | # it is possible, that the destinationfile is no longer part of the files collector | ||||
2058 | if ($destinationfilepath) { installer::pathanalyzer::get_path_from_fullqualifiedname(\$destinationfilepath); } | ||||
2059 | else { $destinationfilepath = ""; } | ||||
2060 | |||||
2061 | if ( $destinationpath eq $destinationfilepath ) | ||||
2062 | { | ||||
2063 | # link and file are in the same directory | ||||
2064 | # Therefore the path of the file can be removed | ||||
2065 | |||||
2066 | my $newdestinationfile = $destinationfile; | ||||
2067 | installer::pathanalyzer::make_absolute_filename_to_relative_filename(\$newdestinationfile); | ||||
2068 | |||||
2069 | $onelink->{'destinationfile'} = $newdestinationfile; | ||||
2070 | } | ||||
2071 | } | ||||
2072 | } | ||||
2073 | } | ||||
2074 | |||||
2075 | ######################################################################## | ||||
2076 | # This function is a helper of function "assigning_modules_to_items" | ||||
2077 | ######################################################################## | ||||
2078 | |||||
2079 | sub insert_for_item ($$$) | ||||
2080 | # spent 56.1ms within installer::scriptitems::insert_for_item which was called 9555 times, avg 6µs/call:
# 9555 times (56.1ms+0s) by installer::scriptitems::build_modulegids_table at line 2114, avg 6µs/call | ||||
2081 | 9555 | 8.91ms | my ($hash, $item, $id) = @_; | ||
2082 | |||||
2083 | 9555 | 7.40ms | if (!defined $hash->{$item}) | ||
2084 | { | ||||
2085 | 1050 | 514µs | my @gids = (); | ||
2086 | 1050 | 1.91ms | $hash->{$item} = \@gids; | ||
2087 | } | ||||
2088 | 9555 | 6.40ms | my $gid_list = $hash->{$item}; | ||
2089 | 9555 | 9.83ms | push @{$gid_list}, $id; | ||
2090 | 9555 | 39.3ms | $hash->{$item} = $gid_list; | ||
2091 | } | ||||
2092 | |||||
2093 | sub build_modulegids_table | ||||
2094 | # spent 151ms (82.7+67.8) within installer::scriptitems::build_modulegids_table which was called 3 times, avg 50.2ms/call:
# 3 times (82.7ms+67.8ms) by installer::scriptitems::assigning_modules_to_items at line 2169, avg 50.2ms/call | ||||
2095 | 3 | 4µs | my ($modulesref, $itemname) = @_; | ||
2096 | |||||
2097 | 3 | 4µs | my %module_lookup_table = (); | ||
2098 | |||||
2099 | # build map of item names to list of respective module gids | ||||
2100 | # containing these items | ||||
2101 | 3 | 1.38ms | for my $onemodule (@{$modulesref}) | ||
2102 | { | ||||
2103 | 4701 | 3.79ms | next if ( ! defined $onemodule->{$itemname} ); | ||
2104 | # these are the items contained in this module | ||||
2105 | # eg. Files = (gid_a_b_c,gid_d_e_f) | ||||
2106 | 1528 | 1.60ms | my $module_gids = $onemodule->{$itemname}; | ||
2107 | |||||
2108 | # prune outer brackets | ||||
2109 | 1528 | 11.7ms | 1528 | 6.50ms | $module_gids =~ s|^\s*\(||g; # spent 6.50ms making 1528 calls to installer::scriptitems::CORE:subst, avg 4µs/call |
2110 | 1528 | 10.0ms | 1528 | 5.18ms | $module_gids =~ s|\)\s*$||g; # spent 5.18ms making 1528 calls to installer::scriptitems::CORE:subst, avg 3µs/call |
2111 | 1528 | 11.3ms | for my $id (split (/,/, $module_gids)) | ||
2112 | { | ||||
2113 | 9555 | 4.66ms | chomp $id; | ||
2114 | 9555 | 31.9ms | 9555 | 56.1ms | insert_for_item(\%module_lookup_table, lc ($id), $onemodule->{'gid'}); # spent 56.1ms making 9555 calls to installer::scriptitems::insert_for_item, avg 6µs/call |
2115 | } | ||||
2116 | } | ||||
2117 | |||||
2118 | 3 | 26µs | return \%module_lookup_table; | ||
2119 | } | ||||
2120 | |||||
2121 | ######################################################################## | ||||
2122 | # Items like files do not know their modules | ||||
2123 | # This function is a helper of function "assigning_modules_to_items" | ||||
2124 | ######################################################################## | ||||
2125 | |||||
2126 | sub get_string_of_modulegids_for_itemgid | ||||
2127 | # spent 45.3ms (35.4+9.88) within installer::scriptitems::get_string_of_modulegids_for_itemgid which was called 820 times, avg 55µs/call:
# 820 times (35.4ms+9.88ms) by installer::scriptitems::assigning_modules_to_items at line 2186, avg 55µs/call | ||||
2128 | 820 | 830µs | my ($module_lookup_table, $modulesref, $itemgid, $itemname) = @_; | ||
2129 | |||||
2130 | 820 | 364µs | my $allmodules = ""; | ||
2131 | 820 | 327µs | my $haslanguagemodule = 0; | ||
2132 | 820 | 506µs | my %foundmodules = (); | ||
2133 | |||||
2134 | 820 | 861µs | my $gid_list = $module_lookup_table->{lc($itemgid)}; | ||
2135 | |||||
2136 | 820 | 1.27ms | for my $gid (@{$gid_list}) | ||
2137 | { | ||||
2138 | 8016 | 6.61ms | $foundmodules{$gid} = 1; | ||
2139 | 8016 | 7.19ms | $allmodules = $allmodules . "," . $gid; | ||
2140 | # Is this module a language module? This info should be stored at the file. | ||||
2141 | 8016 | 9.65ms | if ( exists($installer::globals::alllangmodules{$gid}) ) { $haslanguagemodule = 1; } | ||
2142 | } | ||||
2143 | |||||
2144 | 820 | 4.64ms | 820 | 1.66ms | $allmodules =~ s/^\s*\,//; # removing leading comma # spent 1.66ms making 820 calls to installer::scriptitems::CORE:subst, avg 2µs/call |
2145 | |||||
2146 | # Check: All modules or no module must have flag LANGUAGEMODULE | ||||
2147 | 820 | 326µs | if ( $haslanguagemodule ) | ||
2148 | { | ||||
2149 | 66 | 275µs | 66 | 8.22ms | my $isreallylanguagemodule = installer::worker::key_in_a_is_also_key_in_b(\%foundmodules, \%installer::globals::alllangmodules); # spent 8.22ms making 66 calls to installer::worker::key_in_a_is_also_key_in_b, avg 124µs/call |
2150 | 66 | 38µs | if ( ! $isreallylanguagemodule ) { installer::exiter::exit_program("ERROR: \"$itemgid\" is assigned to modules with flag \"LANGUAGEMODULE\" and also to modules without this flag! Modules: $allmodules", "get_string_of_modulegids_for_itemgid"); } | ||
2151 | } | ||||
2152 | |||||
2153 | 820 | 5.39ms | return ($allmodules, $haslanguagemodule); | ||
2154 | } | ||||
2155 | |||||
2156 | ######################################################## | ||||
2157 | # Items like files do not know their modules | ||||
2158 | # This function add the {'modules'} to these items | ||||
2159 | ######################################################## | ||||
2160 | |||||
2161 | sub assigning_modules_to_items | ||||
2162 | # spent 212ms (16.0+196) within installer::scriptitems::assigning_modules_to_items which was called 3 times, avg 70.6ms/call:
# once (13.8ms+179ms) by installer::run at line 478 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer.pm
# once (2.20ms+14.9ms) by installer::run at line 482 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer.pm
# once (17µs+1.94ms) by installer::run at line 480 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer.pm | ||||
2163 | 3 | 8µs | my ($modulesref, $itemsref, $itemname) = @_; | ||
2164 | |||||
2165 | 3 | 2µs | my $infoline = ""; | ||
2166 | 3 | 2µs | my $languageassignmenterror = 0; | ||
2167 | 3 | 3µs | my @languageassignmenterrors = (); | ||
2168 | |||||
2169 | 3 | 13µs | 3 | 151ms | my $module_lookup_table = build_modulegids_table($modulesref, $itemname); # spent 151ms making 3 calls to installer::scriptitems::build_modulegids_table, avg 50.2ms/call |
2170 | |||||
2171 | 3 | 119µs | for my $oneitem (@{$itemsref}) | ||
2172 | { | ||||
2173 | 1037 | 893µs | my $itemgid = $oneitem->{'gid'}; | ||
2174 | |||||
2175 | 1037 | 443µs | my $styles = ""; | ||
2176 | 1037 | 915µs | if ( $oneitem->{'Styles'} ) { $styles = $oneitem->{'Styles'}; } | ||
2177 | 1254 | 1.37ms | 244 | 168µs | if (( $itemname eq "Dirs" ) && ( ! ( $styles =~ /\bCREATE\b/ ))) { next; } # spent 168µs making 244 calls to installer::scriptitems::CORE:match, avg 688ns/call |
2178 | |||||
2179 | 820 | 294µs | if ( $itemgid eq "" ) | ||
2180 | { | ||||
2181 | installer::exiter::exit_program("ERROR in item collection: No gid for item $oneitem->{'Name'}", "assigning_modules_to_items"); | ||||
2182 | } | ||||
2183 | |||||
2184 | # every item can belong to many modules | ||||
2185 | |||||
2186 | 820 | 2.57ms | 820 | 45.3ms | my ($modulegids, $haslanguagemodule) = get_string_of_modulegids_for_itemgid($module_lookup_table, $modulesref, $itemgid, $itemname); # spent 45.3ms making 820 calls to installer::scriptitems::get_string_of_modulegids_for_itemgid, avg 55µs/call |
2187 | |||||
2188 | 820 | 360µs | if ($modulegids eq "") | ||
2189 | { | ||||
2190 | installer::exiter::exit_program("ERROR in file collection: No module found for $itemname $itemgid", "assigning_modules_to_items"); | ||||
2191 | } | ||||
2192 | |||||
2193 | 820 | 1.07ms | $oneitem->{'modules'} = $modulegids; | ||
2194 | 820 | 975µs | $oneitem->{'haslanguagemodule'} = $haslanguagemodule; | ||
2195 | |||||
2196 | # Important check: "ismultilingual" and "haslanguagemodule" must have the same value ! | ||||
2197 | 820 | 464µs | if (( $oneitem->{'ismultilingual'} ) && ( ! $oneitem->{'haslanguagemodule'} )) | ||
2198 | { | ||||
2199 | $infoline = "Error: \"$oneitem->{'gid'}\" is multi lingual, but not in language pack (Assigned module: $modulegids)!\n"; | ||||
2200 | push( @installer::globals::globallogfileinfo, $infoline); | ||||
2201 | push( @languageassignmenterrors, $infoline ); | ||||
2202 | $languageassignmenterror = 1; | ||||
2203 | } | ||||
2204 | 820 | 993µs | if (( $oneitem->{'haslanguagemodule'} ) && ( ! $oneitem->{'ismultilingual'} )) | ||
2205 | { | ||||
2206 | $infoline = "Error: \"$oneitem->{'gid'}\" is in language pack, but not multi lingual (Assigned module: $modulegids)!\n"; | ||||
2207 | push( @installer::globals::globallogfileinfo, $infoline); | ||||
2208 | push( @languageassignmenterrors, $infoline ); | ||||
2209 | $languageassignmenterror = 1; | ||||
2210 | } | ||||
2211 | } | ||||
2212 | |||||
2213 | 3 | 4.28ms | if ($languageassignmenterror) | ||
2214 | { | ||||
2215 | for ( my $i = 0; $i <= $#languageassignmenterrors; $i++ ) { print "$languageassignmenterrors[$i]"; } | ||||
2216 | installer::exiter::exit_program("ERROR: Incorrect assignments for language packs.", "assigning_modules_to_items"); | ||||
2217 | } | ||||
2218 | |||||
2219 | } | ||||
2220 | |||||
2221 | ################################################################################################# | ||||
2222 | # Root path (for instance /opt/openofficeorg20) needs to be added to directories, files and links | ||||
2223 | ################################################################################################# | ||||
2224 | |||||
2225 | sub add_rootpath_to_directories | ||||
2226 | { | ||||
2227 | my ($dirsref, $rootpath) = @_; | ||||
2228 | |||||
2229 | for ( my $i = 0; $i <= $#{$dirsref}; $i++ ) | ||||
2230 | { | ||||
2231 | my $onedir = ${$dirsref}[$i]; | ||||
2232 | my $dir = ""; | ||||
2233 | |||||
2234 | if ( $onedir->{'Dir'} ) { $dir = $onedir->{'Dir'}; } | ||||
2235 | |||||
2236 | if (!($dir =~ /\bPREDEFINED_/ )) | ||||
2237 | { | ||||
2238 | my $hostname = $onedir->{'HostName'}; | ||||
2239 | $hostname = $rootpath . $installer::globals::separator . $hostname; | ||||
2240 | $onedir->{'HostName'} = $hostname; | ||||
2241 | } | ||||
2242 | |||||
2243 | # added | ||||
2244 | |||||
2245 | if ( $dir =~ /\bPREDEFINED_PROGDIR\b/ ) | ||||
2246 | { | ||||
2247 | my $hostname = $onedir->{'HostName'}; | ||||
2248 | if ( $hostname eq "" ) { $onedir->{'HostName'} = $rootpath; } | ||||
2249 | else { $onedir->{'HostName'} = $rootpath . $installer::globals::separator . $hostname; } | ||||
2250 | } | ||||
2251 | } | ||||
2252 | } | ||||
2253 | |||||
2254 | sub add_rootpath_to_files | ||||
2255 | { | ||||
2256 | my ($filesref, $rootpath) = @_; | ||||
2257 | |||||
2258 | for ( my $i = 0; $i <= $#{$filesref}; $i++ ) | ||||
2259 | { | ||||
2260 | my $onefile = ${$filesref}[$i]; | ||||
2261 | my $destination = $onefile->{'destination'}; | ||||
2262 | $destination = $rootpath . $installer::globals::separator . $destination; | ||||
2263 | $onefile->{'destination'} = $destination; | ||||
2264 | } | ||||
2265 | } | ||||
2266 | |||||
2267 | sub add_rootpath_to_links | ||||
2268 | { | ||||
2269 | my ($linksref, $rootpath) = @_; | ||||
2270 | |||||
2271 | for ( my $i = 0; $i <= $#{$linksref}; $i++ ) | ||||
2272 | { | ||||
2273 | my $onelink = ${$linksref}[$i]; | ||||
2274 | my $styles = $onelink->{'Styles'}; | ||||
2275 | |||||
2276 | my $destination = $onelink->{'destination'}; | ||||
2277 | $destination = $rootpath . $installer::globals::separator . $destination; | ||||
2278 | $onelink->{'destination'} = $destination; | ||||
2279 | |||||
2280 | if (!($styles =~ /\bRELATIVE\b/ )) # for absolute links | ||||
2281 | { | ||||
2282 | my $destinationfile = $onelink->{'destinationfile'}; | ||||
2283 | $destinationfile = $rootpath . $installer::globals::separator . $destinationfile; | ||||
2284 | $onelink->{'destinationfile'} = $destinationfile; | ||||
2285 | } | ||||
2286 | } | ||||
2287 | } | ||||
2288 | |||||
2289 | ################################################################################# | ||||
2290 | # Collecting all parent gids | ||||
2291 | ################################################################################# | ||||
2292 | |||||
2293 | sub collect_all_parent_feature | ||||
2294 | # spent 43.4ms within installer::scriptitems::collect_all_parent_feature which was called:
# once (43.4ms+0s) by installer::scriptitems::set_children_flag at line 2345 | ||||
2295 | 1 | 1µs | my ($modulesref) = @_; | ||
2296 | |||||
2297 | 1 | 1µs | my @allparents = (); | ||
2298 | |||||
2299 | 1 | 500ns | my $found_root_module = 0; | ||
2300 | |||||
2301 | 1 | 1.63ms | for ( my $i = 0; $i <= $#{$modulesref}; $i++ ) | ||
2302 | { | ||||
2303 | 1567 | 841µs | my $onefeature = ${$modulesref}[$i]; | ||
2304 | |||||
2305 | 1567 | 694µs | my $parentgid = ""; | ||
2306 | 1567 | 1.54ms | if ( $onefeature->{'ParentID'} ) | ||
2307 | { | ||||
2308 | $parentgid = $onefeature->{'ParentID'}; | ||||
2309 | } | ||||
2310 | |||||
2311 | 1567 | 37.5ms | if ( $parentgid ne "" ) | ||
2312 | { | ||||
2313 | if (! grep {$_ eq $parentgid} @allparents) | ||||
2314 | { | ||||
2315 | push(@allparents, $parentgid); | ||||
2316 | } | ||||
2317 | } | ||||
2318 | |||||
2319 | # Setting the global root module | ||||
2320 | |||||
2321 | 1567 | 554µs | if ( $parentgid eq "" ) | ||
2322 | { | ||||
2323 | 1 | 500ns | 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"); } | ||
2324 | 1 | 3µs | $installer::globals::rootmodulegid = $onefeature->{'gid'}; | ||
2325 | 1 | 500ns | $found_root_module = 1; | ||
2326 | 1 | 4µs | $infoline = "Setting Root Module: $installer::globals::rootmodulegid\n"; | ||
2327 | 1 | 2µs | push( @installer::globals::globallogfileinfo, $infoline); | ||
2328 | } | ||||
2329 | |||||
2330 | 1567 | 679µs | if ( ! $found_root_module ) { installer::exiter::exit_program("ERROR: Could not define root module. No module without ParentID or with empty ParentID exists.", "collect_all_parent_feature"); } | ||
2331 | |||||
2332 | } | ||||
2333 | |||||
2334 | 1 | 12µs | return \@allparents; | ||
2335 | } | ||||
2336 | |||||
2337 | ################################################################################# | ||||
2338 | # Checking for every feature, whether it has children | ||||
2339 | ################################################################################# | ||||
2340 | |||||
2341 | sub set_children_flag | ||||
2342 | # spent 100ms (56.7+43.4) within installer::scriptitems::set_children_flag which was called:
# once (56.7ms+43.4ms) by installer::run at line 472 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer.pm | ||||
2343 | 1 | 2µs | my ($modulesref) = @_; | ||
2344 | |||||
2345 | 1 | 6µs | 1 | 43.4ms | my $allparents = collect_all_parent_feature($modulesref); # spent 43.4ms making 1 call to installer::scriptitems::collect_all_parent_feature |
2346 | |||||
2347 | 1 | 1.75ms | for ( my $i = 0; $i <= $#{$modulesref}; $i++ ) | ||
2348 | { | ||||
2349 | 1567 | 874µs | my $onefeature = ${$modulesref}[$i]; | ||
2350 | 1567 | 1.21ms | my $gid = $onefeature->{'gid'}; | ||
2351 | |||||
2352 | # is this gid a parent? | ||||
2353 | |||||
2354 | 1567 | 52.0ms | if ( grep {$_ eq $gid} @{$allparents} ) | ||
2355 | { | ||||
2356 | $onefeature->{'has_children'} = 1; | ||||
2357 | } | ||||
2358 | else | ||||
2359 | { | ||||
2360 | 1324 | 871µs | $onefeature->{'has_children'} = 0; | ||
2361 | } | ||||
2362 | } | ||||
2363 | } | ||||
2364 | |||||
2365 | ################################################################################# | ||||
2366 | # All modules, that use a template module, do now get the assignments of | ||||
2367 | # the template module. | ||||
2368 | ################################################################################# | ||||
2369 | |||||
2370 | sub resolve_assigned_modules | ||||
2371 | # spent 34.5ms (32.9+1.57) within installer::scriptitems::resolve_assigned_modules which was called:
# once (32.9ms+1.57ms) by installer::run at line 468 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer.pm | ||||
2372 | 1 | 2µs | my ($modulesref) = @_; | ||
2373 | |||||
2374 | # collecting all template modules | ||||
2375 | |||||
2376 | 1 | 3µs | my %directaccess = (); | ||
2377 | |||||
2378 | 1 | 1.78ms | for ( my $i = 0; $i <= $#{$modulesref}; $i++ ) | ||
2379 | { | ||||
2380 | 1578 | 1.07ms | my $onefeature = ${$modulesref}[$i]; | ||
2381 | 1578 | 665µs | my $styles = ""; | ||
2382 | 1578 | 1.98ms | if ( $onefeature->{'Styles'} ) { $styles = $onefeature->{'Styles'}; } | ||
2383 | 1578 | 5.47ms | 1578 | 844µs | if ( $styles =~ /\bTEMPLATEMODULE\b/ ) { $directaccess{$onefeature->{'gid'}} = $onefeature; } # spent 844µs making 1578 calls to installer::scriptitems::CORE:match, avg 535ns/call |
2384 | |||||
2385 | # also looking for module with flag ROOT_BRAND_PACKAGE, to save is for further usage | ||||
2386 | 1578 | 5.48ms | 1578 | 730µs | if ( $styles =~ /\bROOT_BRAND_PACKAGE\b/ ) # spent 730µs making 1578 calls to installer::scriptitems::CORE:match, avg 462ns/call |
2387 | { | ||||
2388 | 1 | 4µs | $installer::globals::rootbrandpackage = $onefeature->{'gid'}; | ||
2389 | 1 | 1µs | $installer::globals::rootbrandpackageset = 1; | ||
2390 | } | ||||
2391 | } | ||||
2392 | |||||
2393 | # looking, where template modules are assigned | ||||
2394 | |||||
2395 | 1 | 2.40ms | for ( my $i = 0; $i <= $#{$modulesref}; $i++ ) | ||
2396 | { | ||||
2397 | 1578 | 858µs | my $onefeature = ${$modulesref}[$i]; | ||
2398 | 1578 | 1.62ms | if ( $onefeature->{'Assigns'} ) | ||
2399 | { | ||||
2400 | 1210 | 816µs | my $templategid = $onefeature->{'Assigns'}; | ||
2401 | |||||
2402 | 1210 | 862µs | if ( ! exists($directaccess{$templategid}) ) | ||
2403 | { | ||||
2404 | installer::exiter::exit_program("ERROR: Did not find definition of assigned template module \"$templategid\"", "resolve_assigned_modules"); | ||||
2405 | } | ||||
2406 | |||||
2407 | # Currently no merging of Files, Dirs, ... | ||||
2408 | # This has to be included here, if it is required | ||||
2409 | 1210 | 2.35ms | my @items_at_modules = ("Files", "Dirs", "Unixlinks"); | ||
2410 | 1210 | 1.95ms | for my $item (@items_at_modules) | ||
2411 | { | ||||
2412 | 3630 | 7.21ms | if ( exists($directaccess{$templategid}->{$item}) ) { $onefeature->{$item} = $directaccess{$templategid}->{$item}; } | ||
2413 | } | ||||
2414 | } | ||||
2415 | } | ||||
2416 | } | ||||
2417 | |||||
2418 | ################################################################################# | ||||
2419 | # Removing the template modules from the list, after all | ||||
2420 | # assignments are transferred to the "real" modules. | ||||
2421 | ################################################################################# | ||||
2422 | |||||
2423 | sub remove_template_modules | ||||
2424 | # spent 11.3ms (10.4+880µs) within installer::scriptitems::remove_template_modules which was called:
# once (10.4ms+880µs) by installer::run at line 470 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer.pm | ||||
2425 | 1 | 2µs | my ($modulesref) = @_; | ||
2426 | |||||
2427 | 1 | 500ns | my @modules = (); | ||
2428 | |||||
2429 | 1 | 1.76ms | for ( my $i = 0; $i <= $#{$modulesref}; $i++ ) | ||
2430 | { | ||||
2431 | 1578 | 883µs | my $onefeature = ${$modulesref}[$i]; | ||
2432 | 1578 | 660µs | my $styles = ""; | ||
2433 | 1578 | 1.51ms | if ( $onefeature->{'Styles'} ) { $styles = $onefeature->{'Styles'}; } | ||
2434 | 1589 | 5.52ms | 1578 | 880µs | if ( $styles =~ /\bTEMPLATEMODULE\b/ ) { next; } # spent 880µs making 1578 calls to installer::scriptitems::CORE:match, avg 557ns/call |
2435 | |||||
2436 | 1567 | 973µs | push(@modules, $onefeature); | ||
2437 | } | ||||
2438 | |||||
2439 | 1 | 10µs | return \@modules; | ||
2440 | } | ||||
2441 | |||||
2442 | ################################################################################# | ||||
2443 | # Collecting all modules with flag LANGUAGEMODULE in a global | ||||
2444 | # collector. | ||||
2445 | ################################################################################# | ||||
2446 | |||||
2447 | sub collect_all_languagemodules | ||||
2448 | # spent 280ms (247+32.4) within installer::scriptitems::collect_all_languagemodules which was called:
# once (247ms+32.4ms) by installer::run at line 474 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer.pm | ||||
2449 | 1 | 2µs | my ($modulesref) = @_; | ||
2450 | |||||
2451 | 1 | 5.87ms | for ( my $i = 0; $i <= $#{$modulesref}; $i++ ) | ||
2452 | { | ||||
2453 | 1567 | 1.12ms | my $onefeature = ${$modulesref}[$i]; | ||
2454 | 1567 | 700µs | my $styles = ""; | ||
2455 | 1567 | 1.95ms | if ( $onefeature->{'Styles'} ) { $styles = $onefeature->{'Styles'}; } | ||
2456 | 1567 | 9.30ms | 1567 | 3.33ms | if ( $styles =~ /\bLANGUAGEMODULE\b/ ) # spent 3.33ms making 1567 calls to installer::scriptitems::CORE:match, avg 2µs/call |
2457 | { | ||||
2458 | 1430 | 1.09ms | if ( ! exists($onefeature->{'Language'}) ) { installer::exiter::exit_program("ERROR: \"$onefeature->{'gid'}\" has flag LANGUAGEMODULE, but does not know its language!", "collect_all_languagemodules"); } | ||
2459 | 1430 | 3.87ms | $installer::globals::alllangmodules{$onefeature->{'gid'}} = $onefeature->{'Language'}; | ||
2460 | # Collecting also the english names, that are used for nsis unpack directory for language packs | ||||
2461 | 1430 | 820µs | my $lang = $onefeature->{'Language'}; | ||
2462 | 1430 | 613µs | my $name = ""; | ||
2463 | 1430 | 15.3ms | foreach my $localkey ( keys %{$onefeature} ) | ||
2464 | { | ||||
2465 | 64900 | 239ms | 64900 | 29.0ms | if ( $localkey =~ /^\s*Name\s*\(\s*en-US\s*\)\s*$/ ) # spent 29.0ms making 64900 calls to installer::scriptitems::CORE:match, avg 448ns/call |
2466 | { | ||||
2467 | $installer::globals::all_english_languagestrings{$lang} = $onefeature->{$localkey}; | ||||
2468 | } | ||||
2469 | } | ||||
2470 | } | ||||
2471 | } | ||||
2472 | } | ||||
2473 | |||||
2474 | ################################################################################# | ||||
2475 | # Selecting from all collected english language strings those, that are really | ||||
2476 | # required in this installation set. | ||||
2477 | ################################################################################# | ||||
2478 | |||||
2479 | sub select_required_language_strings | ||||
2480 | # spent 365ms (311+54.6) within installer::scriptitems::select_required_language_strings which was called:
# once (311ms+54.6ms) by installer::run at line 893 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer.pm | ||||
2481 | 1 | 3µs | my ($modulesref) = @_; | ||
2482 | |||||
2483 | 1 | 49.0ms | for ( my $i = 0; $i <= $#{$modulesref}; $i++ ) | ||
2484 | { | ||||
2485 | 34601 | 23.9ms | my $onefeature = ${$modulesref}[$i]; | ||
2486 | 34601 | 15.0ms | my $styles = ""; | ||
2487 | 34601 | 41.0ms | if ( $onefeature->{'Styles'} ) { $styles = $onefeature->{'Styles'}; } | ||
2488 | 34601 | 180ms | 34601 | 54.6ms | if ( $styles =~ /\bLANGUAGEMODULE\b/ ) # spent 54.6ms making 34601 calls to installer::scriptitems::CORE:match, avg 2µs/call |
2489 | { | ||||
2490 | 24961 | 16.2ms | if ( ! exists($onefeature->{'Language'}) ) { installer::exiter::exit_program("ERROR: \"$onefeature->{'gid'}\" has flag LANGUAGEMODULE, but does not know its language!", "select_required_language_strings"); } | ||
2491 | 24961 | 19.7ms | my $lang = $onefeature->{'Language'}; | ||
2492 | |||||
2493 | 24961 | 20.7ms | if (( exists($installer::globals::all_english_languagestrings{$lang}) ) && ( ! exists($installer::globals::all_required_english_languagestrings{$lang}) )) | ||
2494 | { | ||||
2495 | $installer::globals::all_required_english_languagestrings{$lang} = $installer::globals::all_english_languagestrings{$lang}; | ||||
2496 | } | ||||
2497 | } | ||||
2498 | } | ||||
2499 | } | ||||
2500 | |||||
2501 | 1 | 11µs | 1; | ||
# spent 1.40s within installer::scriptitems::CORE:backtick which was called:
# once (1.40s+0s) by installer::scriptitems::replace_setup_variables at line 705 | |||||
# spent 141ms within installer::scriptitems::CORE:ftfile which was called 842 times, avg 168µs/call:
# 842 times (141ms+0s) by installer::scriptitems::get_sourcepath_from_filename_and_includepath_classic at line 948, avg 168µs/call | |||||
# spent 31.8s within installer::scriptitems::CORE:match which was called 21828612 times, avg 1µs/call:
# 10690393 times (25.1s+0s) by installer::scriptitems::resolving_all_languages_in_productlists at line 268, avg 2µs/call
# 10281752 times (5.72s+0s) by installer::scriptitems::resolving_all_languages_in_productlists at line 270, avg 557ns/call
# 558682 times (550ms+0s) by installer::scriptitems::changing_name_of_language_dependent_keys at line 665, avg 984ns/call
# 93522 times (218ms+0s) by installer::scriptitems::get_languagespecific_module at line 222, avg 2µs/call
# 64900 times (29.0ms+0s) by installer::scriptitems::collect_all_languagemodules at line 2465, avg 448ns/call
# 34939 times (61.3ms+0s) by installer::scriptitems::remove_not_required_language_modules at line 316, avg 2µs/call
# 34601 times (54.6ms+0s) by installer::scriptitems::select_required_language_strings at line 2488, avg 2µs/call
# 15008 times (6.93ms+0s) by installer::scriptitems::add_License_Files_into_Installdir at line 1381, avg 462ns/call
# 7921 times (3.26ms+0s) by installer::scriptitems::remove_office_start_language_files at line 170, avg 412ns/call
# 7512 times (3.48ms+0s) by installer::scriptitems::get_Destination_Directory_For_Item_From_Directorylist at line 903, avg 463ns/call
# 7512 times (2.93ms+0s) by installer::scriptitems::get_Destination_Directory_For_Item_From_Directorylist at line 908, avg 390ns/call
# 7504 times (3.47ms+0s) by installer::scriptitems::get_Source_Directory_For_Files_From_Includepathlist at line 1120, avg 462ns/call
# 6779 times (2.74ms+0s) by installer::scriptitems::make_filename_language_specific at line 1474, avg 404ns/call
# 2067 times (3.60ms+0s) by installer::scriptitems::resolve_all_directory_names at line 89, avg 2µs/call
# 1972 times (879µs+0s) by installer::scriptitems::collect_directories_with_create_flag_from_directoryarray at line 1804, avg 446ns/call
# 1972 times (783µs+0s) by installer::scriptitems::set_global_directory_hostnames at line 467, avg 397ns/call
# 1578 times (880µs+0s) by installer::scriptitems::remove_template_modules at line 2434, avg 557ns/call
# 1578 times (844µs+0s) by installer::scriptitems::resolve_assigned_modules at line 2383, avg 535ns/call
# 1578 times (730µs+0s) by installer::scriptitems::resolve_assigned_modules at line 2386, avg 462ns/call
# 1567 times (3.33ms+0s) by installer::scriptitems::collect_all_languagemodules at line 2456, avg 2µs/call
# 1286 times (634µs+0s) by installer::scriptitems::remove_uninstall_regitems_from_script at line 201, avg 493ns/call
# 806 times (393µs+0s) by installer::scriptitems::remove_Languagepacklibraries_from_Installset at line 1565, avg 488ns/call
# 805 times (456µs+0s) by installer::scriptitems::remove_Helppacklibraries_from_Installset at line 1601, avg 566ns/call
# 796 times (374µs+0s) by installer::scriptitems::remove_patchonlyfiles_from_Installset at line 1637, avg 470ns/call
# 453 times (1.05ms+0s) by installer::scriptitems::resolve_all_directory_names at line 122, avg 2µs/call
# 355 times (371µs+0s) by installer::scriptitems::collect_directories_with_create_flag_from_directoryarray at line 1883, avg 1µs/call
# 244 times (168µs+0s) by installer::scriptitems::assigning_modules_to_items at line 2177, avg 688ns/call
# 226 times (552µs+0s) by installer::scriptitems::resolve_all_directory_names at line 139, avg 2µs/call
# 109 times (365µs+0s) by installer::scriptitems::remove_not_required_spellcheckerlanguage_modules at line 375, avg 3µs/call
# 83 times (231µs+0s) by installer::scriptitems::get_Source_Directory_For_Files_From_Includepathlist at line 1158, avg 3µs/call
# 32 times (88µs+0s) by installer::scriptitems::collect_directories_with_create_flag_from_directoryarray at line 1840, avg 3µs/call
# 29 times (77µs+0s) by installer::scriptitems::collect_directories_with_create_flag_from_directoryarray at line 1871, avg 3µs/call
# 21 times (66µs+0s) by installer::scriptitems::make_filename_language_specific at line 1485, avg 3µs/call
# 14 times (62µs+0s) by installer::scriptitems::collect_directories_with_create_flag_from_directoryarray at line 1833, avg 4µs/call
# 13 times (48µs+0s) by installer::scriptitems::collect_directories_with_create_flag_from_directoryarray at line 1867, avg 4µs/call
# once (20µs+0s) by installer::scriptitems::replace_setup_variables at line 713
# once (13µs+0s) by installer::scriptitems::get_office_directory_gid_and_hostname at line 1338
# once (6µs+0s) by installer::scriptitems::replace_setup_variables at line 703 | |||||
# spent 84µs within installer::scriptitems::CORE:print which was called 83 times, avg 1µs/call:
# 83 times (84µs+0s) by installer::scriptitems::get_Source_Directory_For_Files_From_Includepathlist at line 1151, avg 1µs/call | |||||
# spent 8.76s within installer::scriptitems::CORE:regcomp which was called 10477226 times, avg 836ns/call:
# 10281752 times (7.59s+0s) by installer::scriptitems::resolving_all_languages_in_productlists at line 270, avg 739ns/call
# 93522 times (1.08s+0s) by installer::scriptitems::get_languagespecific_module at line 222, avg 12µs/call
# 70753 times (56.3ms+0s) by installer::scriptitems::collect_directories_from_filesarray at line 1740, avg 795ns/call
# 15895 times (12.2ms+0s) by installer::scriptitems::collect_directories_from_filesarray at line 1737, avg 768ns/call
# 7504 times (8.69ms+0s) by installer::scriptitems::add_License_Files_into_Installdir at line 1381, avg 1µs/call
# 7504 times (6.05ms+0s) by installer::scriptitems::get_Source_Directory_For_Files_From_Includepathlist at line 1115, avg 806ns/call
# 83 times (878µs+0s) by installer::scriptitems::get_Source_Directory_For_Files_From_Includepathlist at line 1142, avg 11µs/call
# 83 times (70µs+0s) by installer::scriptitems::get_Source_Directory_For_Files_From_Includepathlist at line 1143, avg 843ns/call
# 32 times (30µs+0s) by installer::scriptitems::collect_directories_with_create_flag_from_directoryarray at line 1840, avg 944ns/call
# 29 times (25µs+0s) by installer::scriptitems::collect_directories_with_create_flag_from_directoryarray at line 1871, avg 876ns/call
# 21 times (48µs+0s) by installer::scriptitems::make_filename_language_specific at line 1488, avg 2µs/call
# 21 times (27µs+0s) by installer::scriptitems::make_filename_language_specific at line 1489, avg 1µs/call
# 14 times (29µs+0s) by installer::scriptitems::collect_directories_with_create_flag_from_directoryarray at line 1833, avg 2µs/call
# 13 times (51µs+0s) by installer::scriptitems::collect_directories_with_create_flag_from_directoryarray at line 1867, avg 4µs/call | |||||
# spent 17.2ms within installer::scriptitems::CORE:sort which was called 3684 times, avg 5µs/call:
# 3682 times (10.6ms+0s) by installer::scriptitems::optimize_list at line 1707, avg 3µs/call
# once (3.28ms+0s) by installer::scriptitems::collect_directories_with_create_flag_from_directoryarray at line 1898
# once (3.26ms+0s) by installer::scriptitems::collect_directories_from_filesarray at line 1776 | |||||
# spent 554ms within installer::scriptitems::CORE:subst which was called 119480 times, avg 5µs/call:
# 70753 times (292ms+0s) by installer::scriptitems::collect_directories_from_filesarray at line 1740, avg 4µs/call
# 15895 times (53.2ms+0s) by installer::scriptitems::collect_directories_from_filesarray at line 1737, avg 3µs/call
# 7504 times (5.38ms+0s) by installer::scriptitems::get_Source_Directory_For_Files_From_Includepathlist at line 1115, avg 717ns/call
# 7194 times (19.9ms+0s) by installer::scriptitems::get_languagespecific_module at line 228, avg 3µs/call
# 3682 times (157ms+0s) by installer::scriptitems::optimize_list at line 1704, avg 43µs/call
# 3682 times (7.05ms+0s) by installer::scriptitems::optimize_list at line 1703, avg 2µs/call
# 3682 times (4.24ms+0s) by installer::scriptitems::optimize_list at line 1702, avg 1µs/call
# 1528 times (6.50ms+0s) by installer::scriptitems::build_modulegids_table at line 2109, avg 4µs/call
# 1528 times (5.18ms+0s) by installer::scriptitems::build_modulegids_table at line 2110, avg 3µs/call
# 830 times (450µs+0s) by installer::scriptitems::get_sourcepath_from_filename_and_includepath at line 1018, avg 542ns/call
# 830 times (396µs+0s) by installer::scriptitems::get_sourcepath_from_filename_and_includepath at line 1019, avg 477ns/call
# 820 times (1.66ms+0s) by installer::scriptitems::get_string_of_modulegids_for_itemgid at line 2144, avg 2µs/call
# 125 times (94µs+0s) by installer::scriptitems::collect_directories_with_create_flag_from_directoryarray at line 1881, avg 749ns/call
# 125 times (91µs+0s) by installer::scriptitems::collect_directories_with_create_flag_from_directoryarray at line 1880, avg 728ns/call
# 83 times (267µs+0s) by installer::scriptitems::get_Source_Directory_For_Files_From_Includepathlist at line 1142, avg 3µs/call
# 83 times (59µs+0s) by installer::scriptitems::get_Source_Directory_For_Files_From_Includepathlist at line 1143, avg 711ns/call
# 78 times (50µs+0s) by installer::scriptitems::replace_setup_variables at line 723, avg 645ns/call
# 78 times (49µs+0s) by installer::scriptitems::replace_setup_variables at line 727, avg 623ns/call
# 78 times (48µs+0s) by installer::scriptitems::replace_setup_variables at line 734, avg 618ns/call
# 78 times (48µs+0s) by installer::scriptitems::replace_setup_variables at line 726, avg 610ns/call
# 78 times (45µs+0s) by installer::scriptitems::replace_setup_variables at line 725, avg 573ns/call
# 78 times (43µs+0s) by installer::scriptitems::replace_setup_variables at line 736, avg 547ns/call
# 78 times (42µs+0s) by installer::scriptitems::replace_setup_variables at line 728, avg 535ns/call
# 78 times (41µs+0s) by installer::scriptitems::replace_setup_variables at line 731, avg 531ns/call
# 78 times (41µs+0s) by installer::scriptitems::replace_setup_variables at line 732, avg 529ns/call
# 78 times (40µs+0s) by installer::scriptitems::replace_setup_variables at line 733, avg 519ns/call
# 78 times (39µs+0s) by installer::scriptitems::replace_setup_variables at line 724, avg 500ns/call
# 78 times (39µs+0s) by installer::scriptitems::replace_setup_variables at line 729, avg 495ns/call
# 78 times (38µs+0s) by installer::scriptitems::replace_setup_variables at line 738, avg 492ns/call
# 78 times (38µs+0s) by installer::scriptitems::replace_setup_variables at line 730, avg 486ns/call
# 21 times (73µs+0s) by installer::scriptitems::make_filename_language_specific at line 1488, avg 3µs/call
# 21 times (67µs+0s) by installer::scriptitems::make_filename_language_specific at line 1489, avg 3µs/call
# once (115µs+0s) by installer::scriptitems::replace_setup_variables at line 687
# once (3µs+0s) by installer::scriptitems::replace_setup_variables at line 716 | |||||
# spent 143ms within installer::scriptitems::CORE:substcont which was called 109966 times, avg 1µs/call:
# 109716 times (143ms+0s) by installer::scriptitems::collect_directories_from_filesarray at line 1740, avg 1µs/call
# 166 times (216µs+0s) by installer::scriptitems::get_Source_Directory_For_Files_From_Includepathlist at line 1142, avg 1µs/call
# 42 times (58µs+0s) by installer::scriptitems::make_filename_language_specific at line 1489, avg 1µs/call
# 42 times (53µs+0s) by installer::scriptitems::make_filename_language_specific at line 1488, avg 1µs/call |