Filename | /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer/packagelist.pm |
Statements | Executed 88107791 statements in 110s |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
1283 | 1 | 1 | 63.9s | 63.9s | check_module_existence | installer::packagelist::
1 | 1 | 1 | 23.5s | 23.5s | remove_multiple_modules_packages | installer::packagelist::
2842 | 2 | 1 | 8.30s | 8.30s | get_children_with_hash (recurses: max depth 4, inclusive time 11.5s) | installer::packagelist::
1283 | 1 | 1 | 6.16s | 9.86s | get_packinfo | installer::packagelist::
284826 | 1 | 1 | 2.89s | 2.89s | CORE:regcomp (opcode) | installer::packagelist::
2566 | 2 | 1 | 2.27s | 5.33s | resolve_packagevariables | installer::packagelist::
1288306 | 9 | 1 | 1.83s | 1.83s | CORE:match (opcode) | installer::packagelist::
326993 | 6 | 1 | 234ms | 234ms | CORE:subst (opcode) | installer::packagelist::
1 | 1 | 1 | 215ms | 72.6s | analyze_list | installer::packagelist::
1 | 1 | 1 | 182ms | 202ms | log_packages_content | installer::packagelist::
1 | 1 | 1 | 133ms | 10.0s | collectpackages | installer::packagelist::
1 | 1 | 1 | 118ms | 118ms | get_module_hash | installer::packagelist::
1 | 1 | 1 | 33.6ms | 2.70s | prepare_cabinet_files | installer::packagelist::
1 | 1 | 1 | 31.5ms | 2.71s | create_module_destination_hash | installer::packagelist::
1 | 1 | 1 | 13.2ms | 13.4ms | check_packagelist | installer::packagelist::
1285 | 3 | 1 | 10.6ms | 10.6ms | CORE:sort (opcode) | installer::packagelist::
1 | 1 | 1 | 5.77ms | 9.15ms | log_cabinet_assignments | installer::packagelist::
1 | 1 | 1 | 352µs | 355µs | BEGIN@30 | installer::packagelist::
1 | 1 | 1 | 17µs | 18µs | BEGIN@33 | installer::packagelist::
1 | 1 | 1 | 16µs | 18µs | BEGIN@34 | installer::packagelist::
1 | 1 | 1 | 15µs | 17µs | BEGIN@31 | installer::packagelist::
1 | 1 | 1 | 14µs | 16µs | BEGIN@32 | installer::packagelist::
0 | 0 | 0 | 0s | 0s | add_defaultpaths_into_filescollector | installer::packagelist::
0 | 0 | 0 | 0s | 0s | find_dirs_for_package | installer::packagelist::
0 | 0 | 0 | 0s | 0s | find_files_for_package | installer::packagelist::
0 | 0 | 0 | 0s | 0s | find_links_for_package | installer::packagelist::
0 | 0 | 0 | 0s | 0s | get_children | installer::packagelist::
0 | 0 | 0 | 0s | 0s | resolve_packagevariables2 | installer::packagelist::
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::packagelist; | ||||
29 | |||||
30 | 2 | 59µs | 2 | 359µs | # spent 355µs (352+4) within installer::packagelist::BEGIN@30 which was called:
# once (352µs+4µs) by installer::epmfile::BEGIN@36 at line 30 # spent 355µs making 1 call to installer::packagelist::BEGIN@30
# spent 4µs making 1 call to UNIVERSAL::import |
31 | 2 | 53µs | 2 | 19µs | # spent 17µs (15+2) within installer::packagelist::BEGIN@31 which was called:
# once (15µs+2µs) by installer::epmfile::BEGIN@36 at line 31 # spent 17µs making 1 call to installer::packagelist::BEGIN@31
# spent 2µs making 1 call to UNIVERSAL::import |
32 | 2 | 52µs | 2 | 19µs | # spent 16µs (14+3) within installer::packagelist::BEGIN@32 which was called:
# once (14µs+3µs) by installer::epmfile::BEGIN@36 at line 32 # spent 16µs making 1 call to installer::packagelist::BEGIN@32
# spent 2µs making 1 call to UNIVERSAL::import |
33 | 2 | 55µs | 2 | 20µs | # spent 18µs (17+1) within installer::packagelist::BEGIN@33 which was called:
# once (17µs+1µs) by installer::epmfile::BEGIN@36 at line 33 # spent 18µs making 1 call to installer::packagelist::BEGIN@33
# spent 2µs making 1 call to UNIVERSAL::import |
34 | 2 | 6.61ms | 2 | 20µs | # spent 18µs (16+2) within installer::packagelist::BEGIN@34 which was called:
# once (16µs+2µs) by installer::epmfile::BEGIN@36 at line 34 # spent 18µs making 1 call to installer::packagelist::BEGIN@34
# spent 2µs making 1 call to UNIVERSAL::import |
35 | |||||
36 | ######################################## | ||||
37 | # Check existence of module | ||||
38 | ######################################## | ||||
39 | |||||
40 | sub check_module_existence | ||||
41 | # spent 63.9s within installer::packagelist::check_module_existence which was called 1283 times, avg 49.8ms/call:
# 1283 times (63.9s+0s) by installer::packagelist::analyze_list at line 80, avg 49.8ms/call | ||||
42 | 1283 | 2.24ms | my ($onegid, $moduleslist) = @_; | ||
43 | |||||
44 | 1283 | 1.11ms | my $foundgid = 0; | ||
45 | |||||
46 | 1283 | 27.0s | for ( my $i = 0; $i <= $#{$moduleslist}; $i++ ) | ||
47 | { | ||||
48 | 23745892 | 26.4s | my $gid = ${$moduleslist}[$i]->{'gid'}; | ||
49 | |||||
50 | 23745892 | 10.5s | if ( $gid eq $onegid ) | ||
51 | { | ||||
52 | 1283 | 1.32ms | $foundgid = 1; | ||
53 | 1283 | 2.69ms | last; | ||
54 | } | ||||
55 | } | ||||
56 | |||||
57 | 1283 | 31.4ms | return $foundgid; | ||
58 | } | ||||
59 | |||||
60 | ################################################### | ||||
61 | # Analyzing the gids, defined in the packagelist | ||||
62 | ################################################### | ||||
63 | |||||
64 | sub analyze_list | ||||
65 | # spent 72.6s (215ms+72.3) within installer::packagelist::analyze_list which was called:
# once (215ms+72.3s) by installer::run at line 996 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer.pm | ||||
66 | 1 | 2µs | my ($packagelist, $moduleslist) = @_; | ||
67 | |||||
68 | 1 | 1µs | @allpackages = (); | ||
69 | |||||
70 | 1 | 4µs | 1 | 118ms | my $moduleshash = get_module_hash($moduleslist); # spent 118ms making 1 call to installer::packagelist::get_module_hash |
71 | |||||
72 | 1 | 4.03ms | for ( my $i = 0; $i <= $#{$packagelist}; $i++ ) | ||
73 | { | ||||
74 | 1283 | 2.28ms | my $onepackage = ${$packagelist}[$i]; | ||
75 | |||||
76 | 1283 | 2.53ms | my $onegid = $onepackage->{'module'}; | ||
77 | |||||
78 | 1283 | 8.43ms | 1283 | 34.1ms | installer::remover::remove_leading_and_ending_whitespaces(\$onegid); # spent 34.1ms making 1283 calls to installer::remover::remove_leading_and_ending_whitespaces, avg 27µs/call |
79 | |||||
80 | 1283 | 5.68ms | 1283 | 63.9s | my $moduleexists = check_module_existence($onegid, $moduleslist); # spent 63.9s making 1283 calls to installer::packagelist::check_module_existence, avg 49.8ms/call |
81 | |||||
82 | 1283 | 764µs | if ( ! $moduleexists ) { next; } | ||
83 | |||||
84 | 1283 | 3.42ms | my @allmodules = (); | ||
85 | |||||
86 | 1283 | 6.90ms | push(@allmodules, $onegid); | ||
87 | |||||
88 | 1283 | 143ms | 1283 | 8.30s | get_children_with_hash($moduleshash, $onegid, \@allmodules); # spent 8.30s making 1283 calls to installer::packagelist::get_children_with_hash, avg 6.47ms/call |
89 | |||||
90 | 1283 | 9.76ms | $onepackage->{'allmodules'} = \@allmodules; | ||
91 | |||||
92 | 1283 | 3.20ms | push(@allpackages, $onepackage); | ||
93 | } | ||||
94 | |||||
95 | 1 | 826µs | return \@allpackages; | ||
96 | } | ||||
97 | |||||
98 | ################################################### | ||||
99 | # Creating a hash, that contains the module gids | ||||
100 | # as keys and the parentids as values | ||||
101 | ################################################### | ||||
102 | |||||
103 | sub get_module_hash | ||||
104 | # spent 118ms within installer::packagelist::get_module_hash which was called:
# once (118ms+0s) by installer::packagelist::analyze_list at line 70 | ||||
105 | 1 | 1µs | my ($moduleslist) = @_; | ||
106 | |||||
107 | 1 | 1µs | my %modulehash = (); | ||
108 | |||||
109 | 1 | 34.6ms | for ( my $i = 0; $i <= $#{$moduleslist}; $i++ ) | ||
110 | { | ||||
111 | 34601 | 36.0ms | my $gid = ${$moduleslist}[$i]->{'gid'}; | ||
112 | # Containing only modules with parent. Root modules can be ignored. | ||||
113 | 34601 | 47.0ms | if ( ${$moduleslist}[$i]->{'ParentID'} ) { $modulehash{$gid} = ${$moduleslist}[$i]->{'ParentID'}; } | ||
114 | } | ||||
115 | |||||
116 | 1 | 31µs | return \%modulehash; | ||
117 | } | ||||
118 | |||||
119 | ######################################################## | ||||
120 | # Recursively defined procedure to order | ||||
121 | # modules and directories | ||||
122 | ######################################################## | ||||
123 | |||||
124 | sub get_children_with_hash | ||||
125 | # spent 8.30s (8.30+0ns) within installer::packagelist::get_children_with_hash which was called 2842 times, avg 2.92ms/call:
# 1559 times (4.11s+-4.11s) by installer::packagelist::get_children_with_hash at line 136, avg 0s/call
# 1283 times (4.19s+4.11s) by installer::packagelist::analyze_list at line 88, avg 6.47ms/call | ||||
126 | 2842 | 5.82ms | my ($modulehash, $parentgid, $newitemorder) = @_; | ||
127 | |||||
128 | 2842 | 1.31s | foreach my $gid ( keys %{$modulehash} ) | ||
129 | { | ||||
130 | 4410784 | 3.09s | my $parent = $modulehash->{$gid}; | ||
131 | |||||
132 | 4410784 | 3.89s | if ( $parent eq $parentgid ) | ||
133 | { | ||||
134 | 1559 | 1.39ms | push(@{$newitemorder}, $gid); | ||
135 | 1559 | 1.31ms | my $parent = $gid; | ||
136 | 1559 | 5.49ms | 1559 | 0s | get_children_with_hash($modulehash, $parent, $newitemorder); # recursive! # spent 11.5s making 1559 calls to installer::packagelist::get_children_with_hash, avg 7.37ms/call, recursion: max depth 4, sum of overlapping time 11.5s |
137 | } | ||||
138 | } | ||||
139 | } | ||||
140 | |||||
141 | ######################################################## | ||||
142 | # Recursively defined procedure to order | ||||
143 | # modules and directories | ||||
144 | ######################################################## | ||||
145 | |||||
146 | sub get_children | ||||
147 | { | ||||
148 | my ($allitems, $startparent, $newitemorder) = @_; | ||||
149 | |||||
150 | for ( my $i = 0; $i <= $#{$allitems}; $i++ ) | ||||
151 | { | ||||
152 | my $gid = ${$allitems}[$i]->{'gid'}; | ||||
153 | my $parent = ""; | ||||
154 | if ( ${$allitems}[$i]->{'ParentID'} ) { $parent = ${$allitems}[$i]->{'ParentID'}; } | ||||
155 | |||||
156 | if ( $parent eq $startparent ) | ||||
157 | { | ||||
158 | push(@{$newitemorder}, $gid); | ||||
159 | my $parent = $gid; | ||||
160 | get_children($allitems, $parent, $newitemorder); # recursive! | ||||
161 | } | ||||
162 | } | ||||
163 | } | ||||
164 | |||||
165 | ##################################################################### | ||||
166 | # All modules below a defined gid_Module_A are collected now for | ||||
167 | # each modules defined in the packagelist. Now the modules have | ||||
168 | # to be removed, that are part of more than one package. | ||||
169 | ##################################################################### | ||||
170 | |||||
171 | sub remove_multiple_modules_packages | ||||
172 | # spent 23.5s within installer::packagelist::remove_multiple_modules_packages which was called:
# once (23.5s+0s) by installer::run at line 997 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer.pm | ||||
173 | 1 | 2µs | my ($allpackagemodules) = @_; | ||
174 | |||||
175 | # iterating over all packages | ||||
176 | |||||
177 | 1 | 1.89ms | for ( my $i = 0; $i <= $#{$allpackagemodules}; $i++ ) | ||
178 | { | ||||
179 | 1283 | 887µs | my $onepackage = ${$allpackagemodules}[$i]; | ||
180 | 1283 | 838µs | my $allmodules = $onepackage->{'allmodules'}; | ||
181 | |||||
182 | # Comparing each package, with all following packages. If a | ||||
183 | # gid for the module is part of more than one package, it is | ||||
184 | # removed if the number of modules in the package is greater | ||||
185 | # in the current package than in the compare package. | ||||
186 | |||||
187 | # Taking all modules from package $i | ||||
188 | |||||
189 | 1283 | 812µs | my $packagecount = $#{$allmodules}; | ||
190 | |||||
191 | 1283 | 1.07ms | my @optimizedpackage = (); | ||
192 | |||||
193 | # iterating over all modules of this package | ||||
194 | |||||
195 | 1283 | 5.68ms | for ( my $j = 0; $j <= $#{$allmodules}; $j++ ) | ||
196 | { | ||||
197 | 2842 | 3.12ms | my $onemodule = ${$allmodules}[$j]; # this is the module, that shall be removed or not | ||
198 | |||||
199 | 2842 | 1.22ms | my $put_module_into_new_package = 1; | ||
200 | |||||
201 | # iterating over all other packages | ||||
202 | |||||
203 | 2842 | 3.73s | for ( my $k = 0; $k <= $#{$allpackagemodules}; $k++ ) | ||
204 | { | ||||
205 | 3649128 | 1.45s | if ( $k == $i ) { next; } # not comparing equal module | ||
206 | |||||
207 | 4464734 | 1.63s | if (! $put_module_into_new_package) { next; } # do not compare, if already found | ||
208 | |||||
209 | 2822154 | 1.60s | my $comparepackage = ${$allpackagemodules}[$k]; | ||
210 | 2822154 | 1.67s | my $allcomparemodules = $comparepackage->{'allmodules'}; | ||
211 | |||||
212 | 2822154 | 1.52s | my $comparepackagecount = $#{$allcomparemodules}; | ||
213 | |||||
214 | # modules will only be removed from packages, that have more modules | ||||
215 | # than the compare package | ||||
216 | |||||
217 | 2827264 | 1.08s | if ( $packagecount < $comparepackagecount ) { next; } # nothing to do, take next package | ||
218 | |||||
219 | # iterating over all modules of this package | ||||
220 | |||||
221 | 2817044 | 7.76s | for ( my $m = 0; $m <= $#{$allcomparemodules}; $m++ ) | ||
222 | { | ||||
223 | 2819120 | 1.69s | my $onecomparemodule = ${$allcomparemodules}[$m]; | ||
224 | |||||
225 | 2819120 | 1.35s | if ( $onemodule eq $onecomparemodule ) # this $onemodule has to be removed | ||
226 | { | ||||
227 | $put_module_into_new_package = 0; | ||||
228 | } | ||||
229 | } | ||||
230 | } | ||||
231 | |||||
232 | 2842 | 6.91ms | if ( $put_module_into_new_package ) | ||
233 | { | ||||
234 | push(@optimizedpackage, $onemodule) | ||||
235 | } | ||||
236 | } | ||||
237 | |||||
238 | 1283 | 4.62ms | $onepackage->{'allmodules'} = \@optimizedpackage; | ||
239 | } | ||||
240 | } | ||||
241 | |||||
242 | ##################################################################### | ||||
243 | # Analyzing all files if they belong to a special package. | ||||
244 | # A package is described by a list of modules. | ||||
245 | ##################################################################### | ||||
246 | |||||
247 | sub find_files_for_package | ||||
248 | { | ||||
249 | my ($filelist, $onepackage) = @_; | ||||
250 | |||||
251 | my @newfilelist = (); | ||||
252 | |||||
253 | for ( my $i = 0; $i <= $#{$filelist}; $i++ ) | ||||
254 | { | ||||
255 | my $onefile = ${$filelist}[$i]; | ||||
256 | my $modulesstring = $onefile->{'modules'}; # comma separated modules list | ||||
257 | my $moduleslist = installer::converter::convert_stringlist_into_array(\$modulesstring, ","); | ||||
258 | |||||
259 | my $includefile = 0; | ||||
260 | |||||
261 | # iterating over all modules of this file | ||||
262 | |||||
263 | for ( my $j = 0; $j <= $#{$moduleslist}; $j++ ) | ||||
264 | { | ||||
265 | if ( $includefile ) { next; } | ||||
266 | my $filemodule = ${$moduleslist}[$j]; | ||||
267 | installer::remover::remove_leading_and_ending_whitespaces(\$filemodule); | ||||
268 | |||||
269 | # iterating over all modules of the package | ||||
270 | |||||
271 | my $packagemodules = $onepackage->{'allmodules'}; | ||||
272 | |||||
273 | for ( my $k = 0; $k <= $#{$packagemodules}; $k++ ) | ||||
274 | { | ||||
275 | if ( $includefile ) { next; } | ||||
276 | my $packagemodule = ${$packagemodules}[$k]; | ||||
277 | |||||
278 | if ( $filemodule eq $packagemodule ) | ||||
279 | { | ||||
280 | $includefile = 1; | ||||
281 | last; | ||||
282 | } | ||||
283 | } | ||||
284 | } | ||||
285 | |||||
286 | if ( $includefile ) | ||||
287 | { | ||||
288 | push(@newfilelist, $onefile); | ||||
289 | } | ||||
290 | } | ||||
291 | |||||
292 | return \@newfilelist; | ||||
293 | } | ||||
294 | |||||
295 | ##################################################################### | ||||
296 | # Analyzing all links if they belong to a special package. | ||||
297 | # A package is described by a list of modules. | ||||
298 | # A link is inserted into the package, if the corresponding | ||||
299 | # file is also inserted. | ||||
300 | ##################################################################### | ||||
301 | |||||
302 | sub find_links_for_package | ||||
303 | { | ||||
304 | my ($linklist, $filelist) = @_; | ||||
305 | |||||
306 | # First looking for all links with a FileID. | ||||
307 | # Then looking for all links with a ShortcutID. | ||||
308 | |||||
309 | my @newlinklist = (); | ||||
310 | |||||
311 | for ( my $i = 0; $i <= $#{$linklist}; $i++ ) | ||||
312 | { | ||||
313 | my $includelink = 0; | ||||
314 | |||||
315 | my $onelink = ${$linklist}[$i]; | ||||
316 | |||||
317 | my $fileid = ""; | ||||
318 | if ( $onelink->{'FileID'} ) { $fileid = $onelink->{'FileID'}; } | ||||
319 | |||||
320 | if ( $fileid eq "" ) { next; } # A link with a ShortcutID | ||||
321 | |||||
322 | for ( my $j = 0; $j <= $#{$filelist}; $j++ ) # iterating over file list | ||||
323 | { | ||||
324 | my $onefile = ${$filelist}[$j]; | ||||
325 | my $gid = $onefile->{'gid'}; | ||||
326 | |||||
327 | if ( $gid eq $fileid ) | ||||
328 | { | ||||
329 | $includelink = 1; | ||||
330 | last; | ||||
331 | } | ||||
332 | } | ||||
333 | |||||
334 | if ( $includelink ) | ||||
335 | { | ||||
336 | push(@newlinklist, $onelink); | ||||
337 | } | ||||
338 | } | ||||
339 | |||||
340 | # iterating over the new list, because of all links with a ShortcutID | ||||
341 | |||||
342 | for ( my $i = 0; $i <= $#{$linklist}; $i++ ) | ||||
343 | { | ||||
344 | my $includelink = 0; | ||||
345 | |||||
346 | my $onelink = ${$linklist}[$i]; | ||||
347 | |||||
348 | my $shortcutid = ""; | ||||
349 | if ( $onelink->{'ShortcutID'} ) { $shortcutid = $onelink->{'ShortcutID'}; } | ||||
350 | |||||
351 | if ( $shortcutid eq "" ) { next; } # A link with a ShortcutID | ||||
352 | |||||
353 | for ( my $j = 0; $j <= $#newlinklist; $j++ ) # iterating over newly created link list | ||||
354 | { | ||||
355 | my $onefilelink = $newlinklist[$j]; | ||||
356 | my $gid = $onefilelink->{'gid'}; | ||||
357 | |||||
358 | if ( $gid eq $shortcutid ) | ||||
359 | { | ||||
360 | $includelink = 1; | ||||
361 | last; | ||||
362 | } | ||||
363 | } | ||||
364 | |||||
365 | if ( $includelink ) | ||||
366 | { | ||||
367 | push(@newlinklist, $onelink); | ||||
368 | } | ||||
369 | } | ||||
370 | |||||
371 | return \@newlinklist; | ||||
372 | } | ||||
373 | |||||
374 | ##################################################################### | ||||
375 | # Analyzing all directories if they belong to a special package. | ||||
376 | # A package is described by a list of modules. | ||||
377 | # Directories are included into the package, if they are needed | ||||
378 | # by a file or a link included into the package. | ||||
379 | # Attention: A directory with the flag CREATE, is only included | ||||
380 | # into the root module: | ||||
381 | # ($packagename eq $installer::globals::rootmodulegid) | ||||
382 | ##################################################################### | ||||
383 | |||||
384 | sub find_dirs_for_package | ||||
385 | { | ||||
386 | my ($dirlist, $onepackage) = @_; | ||||
387 | |||||
388 | my @newdirlist = (); | ||||
389 | |||||
390 | for ( my $i = 0; $i <= $#{$dirlist}; $i++ ) | ||||
391 | { | ||||
392 | my $onedir = ${$dirlist}[$i]; | ||||
393 | my $modulesstring = $onedir->{'modules'}; # comma separated modules list | ||||
394 | my $moduleslist = installer::converter::convert_stringlist_into_array(\$modulesstring, ","); | ||||
395 | |||||
396 | my $includedir = 0; | ||||
397 | |||||
398 | # iterating over all modules of this dir | ||||
399 | |||||
400 | for ( my $j = 0; $j <= $#{$moduleslist}; $j++ ) | ||||
401 | { | ||||
402 | if ( $includedir ) { last; } | ||||
403 | my $dirmodule = ${$moduleslist}[$j]; | ||||
404 | installer::remover::remove_leading_and_ending_whitespaces(\$dirmodule); | ||||
405 | |||||
406 | # iterating over all modules of the package | ||||
407 | |||||
408 | my $packagemodules = $onepackage->{'allmodules'}; | ||||
409 | |||||
410 | for ( my $k = 0; $k <= $#{$packagemodules}; $k++ ) | ||||
411 | { | ||||
412 | my $packagemodule = ${$packagemodules}[$k]; | ||||
413 | |||||
414 | if ( $dirmodule eq $packagemodule ) | ||||
415 | { | ||||
416 | $includedir = 1; | ||||
417 | last; | ||||
418 | } | ||||
419 | } | ||||
420 | } | ||||
421 | |||||
422 | if ( $includedir ) | ||||
423 | { | ||||
424 | push(@newdirlist, $onedir); | ||||
425 | } | ||||
426 | } | ||||
427 | |||||
428 | return \@newdirlist; | ||||
429 | } | ||||
430 | |||||
431 | ##################################################################### | ||||
432 | # Resolving all variables in the packagename. | ||||
433 | ##################################################################### | ||||
434 | |||||
435 | sub resolve_packagevariables | ||||
436 | # spent 5.33s (2.27+3.06) within installer::packagelist::resolve_packagevariables which was called 2566 times, avg 2.08ms/call:
# 1283 times (1.16s+1.51s) by installer::packagelist::create_module_destination_hash at line 743, avg 2.08ms/call
# 1283 times (1.12s+1.55s) by installer::packagelist::prepare_cabinet_files at line 804, avg 2.08ms/call | ||||
437 | 2566 | 2.40ms | my ($packagenameref, $variableshashref, $make_lowercase) = @_; | ||
438 | |||||
439 | 2566 | 893µs | my $key; | ||
440 | |||||
441 | # Special handling for dictionaries | ||||
442 | 2566 | 10.4ms | 2566 | 1.75ms | if ( $$packagenameref =~ /-dict-/ ) # spent 1.75ms making 2566 calls to installer::packagelist::CORE:match, avg 683ns/call |
443 | { | ||||
444 | 46 | 34µs | if (exists($variableshashref->{'DICTIONARYUNIXPRODUCTNAME'}) ) { $$packagenameref =~ s/\%UNIXPRODUCTNAME/$variableshashref->{'DICTIONARYUNIXPRODUCTNAME'}/g; } | ||
445 | 46 | 30µs | if (exists($variableshashref->{'DICTIONARYBRANDPACKAGEVERSION'}) ) { $$packagenameref =~ s/\%BRANDPACKAGEVERSION/$variableshashref->{'DICTIONARYBRANDPACKAGEVERSION'}/g; } | ||
446 | } | ||||
447 | |||||
448 | 2566 | 62.7ms | foreach $key (keys %{$variableshashref}) | ||
449 | { | ||||
450 | 284826 | 220ms | my $value = $variableshashref->{$key}; | ||
451 | 284826 | 132ms | if ( $make_lowercase ) { $value = lc($value); } | ||
452 | 284826 | 4.91s | 569652 | 3.06s | $$packagenameref =~ s/\%$key/$value/g; # spent 2.89s making 284826 calls to installer::packagelist::CORE:regcomp, avg 10µs/call
# spent 172ms making 284826 calls to installer::packagelist::CORE:subst, avg 605ns/call |
453 | } | ||||
454 | } | ||||
455 | |||||
456 | ##################################################################### | ||||
457 | # Resolving all variables in the packagename. | ||||
458 | ##################################################################### | ||||
459 | |||||
460 | sub resolve_packagevariables2 | ||||
461 | { | ||||
462 | my ($packagenameref, $variableshashref, $make_lowercase, $isdict ) = @_; | ||||
463 | |||||
464 | my $key; | ||||
465 | |||||
466 | # Special handling for dictionaries | ||||
467 | if ( $isdict ) | ||||
468 | { | ||||
469 | if (exists($variableshashref->{'DICTIONARYUNIXPRODUCTNAME'}) ) { $$packagenameref =~ s/\%UNIXPRODUCTNAME/$variableshashref->{'DICTIONARYUNIXPRODUCTNAME'}/g; } | ||||
470 | if (exists($variableshashref->{'DICTIONARYBRANDPACKAGEVERSION'}) ) { $$packagenameref =~ s/\%BRANDPACKAGEVERSION/$variableshashref->{'DICTIONARYBRANDPACKAGEVERSION'}/g; } | ||||
471 | } | ||||
472 | |||||
473 | foreach $key (keys %{$variableshashref}) | ||||
474 | { | ||||
475 | my $value = $variableshashref->{$key}; | ||||
476 | if ( $make_lowercase ) { $value = lc($value); } | ||||
477 | $$packagenameref =~ s/\%$key/$value/g; | ||||
478 | } | ||||
479 | } | ||||
480 | |||||
481 | ##################################################################### | ||||
482 | # New packages system. | ||||
483 | ##################################################################### | ||||
484 | |||||
485 | ################################################################## | ||||
486 | # Controlling the content of the packagelist | ||||
487 | # 1. Items in @installer::globals::packagelistitems must exist | ||||
488 | # 2. If a shellscript file is defined, it must exist | ||||
489 | ################################################################## | ||||
490 | |||||
491 | sub check_packagelist | ||||
492 | # spent 13.4ms (13.2+144µs) within installer::packagelist::check_packagelist which was called:
# once (13.2ms+144µs) by installer::run at line 994 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer.pm | ||||
493 | 1 | 1µs | my ($packages) = @_; | ||
494 | |||||
495 | 1 | 2µs | if ( ! ( $#{$packages} > -1 )) { installer::exiter::exit_program("ERROR: No packages defined!", "check_packagelist"); } | ||
496 | |||||
497 | 1 | 1.40ms | for ( my $i = 0; $i <= $#{$packages}; $i++ ) | ||
498 | { | ||||
499 | 1283 | 864µs | my $onepackage = ${$packages}[$i]; | ||
500 | |||||
501 | 1283 | 441µs | my $element; | ||
502 | |||||
503 | # checking all items that must be defined | ||||
504 | |||||
505 | 1283 | 1.58ms | foreach $element (@installer::globals::packagelistitems) | ||
506 | { | ||||
507 | 7698 | 8.09ms | if ( ! exists($onepackage->{$element}) ) | ||
508 | { | ||||
509 | installer::exiter::exit_program("ERROR in package list: No value for $element !", "check_packagelist"); | ||||
510 | } | ||||
511 | } | ||||
512 | |||||
513 | # checking the existence of the script file, if defined | ||||
514 | |||||
515 | 1283 | 738µs | if ( $onepackage->{'script'} ) | ||
516 | { | ||||
517 | 7 | 6µs | my $scriptfile = $onepackage->{'script'}; | ||
518 | 7 | 7µs | my $gid = $onepackage->{'module'}; | ||
519 | 7 | 23µs | 7 | 144µs | my $fileref = installer::scriptitems::get_sourcepath_from_filename_and_includepath(\$scriptfile, "" , 0); # spent 144µs making 7 calls to installer::scriptitems::get_sourcepath_from_filename_and_includepath, avg 21µs/call |
520 | |||||
521 | 7 | 3µs | if ( $$fileref eq "" ) { installer::exiter::exit_program("ERROR: Could not find script file $scriptfile for module $gid!", "check_packagelist"); } | ||
522 | |||||
523 | 7 | 11µs | my $infoline = "$gid: Using script file: \"$$fileref\"!\n"; | ||
524 | 7 | 10µs | push( @installer::globals::logfileinfo, $infoline); | ||
525 | |||||
526 | 7 | 14µs | $onepackage->{'script'} = $$fileref; | ||
527 | } | ||||
528 | } | ||||
529 | } | ||||
530 | |||||
531 | ##################################################################### | ||||
532 | # Reading pack info for one module from packinfo file. | ||||
533 | ##################################################################### | ||||
534 | |||||
535 | sub get_packinfo | ||||
536 | # spent 9.86s (6.16+3.71) within installer::packagelist::get_packinfo which was called 1283 times, avg 7.69ms/call:
# 1283 times (6.16s+3.71s) by installer::packagelist::collectpackages at line 668, avg 7.69ms/call | ||||
537 | 1283 | 1.62ms | my ($gid, $filename, $packages, $onelanguage, $islanguagemodule) = @_; | ||
538 | |||||
539 | 1283 | 3.69ms | 1283 | 1.84s | my $packagelist = installer::files::read_file($filename); # spent 1.84s making 1283 calls to installer::files::read_file, avg 1.44ms/call |
540 | |||||
541 | 1283 | 951µs | my @allpackages = (); | ||
542 | |||||
543 | 1283 | 473ms | for ( my $i = 0; $i <= $#{$packagelist}; $i++ ) | ||
544 | { | ||||
545 | 364762 | 234ms | my $line = ${$packagelist}[$i]; | ||
546 | |||||
547 | 392525 | 1.29s | 364762 | 264ms | if ( $line =~ /^\s*\#/ ) { next; } # this is a comment line # spent 264ms making 364762 calls to installer::packagelist::CORE:match, avg 723ns/call |
548 | |||||
549 | 336999 | 1.34s | 336999 | 363ms | if ( $line =~ /^\s*Start\s*$/i ) # a new package definition # spent 363ms making 336999 calls to installer::packagelist::CORE:match, avg 1µs/call |
550 | { | ||||
551 | 21341 | 15.7ms | my %onepackage = (); | ||
552 | |||||
553 | 21341 | 14.9ms | my $counter = $i + 1; | ||
554 | |||||
555 | 21341 | 106ms | 21341 | 28.2ms | while (!( ${$packagelist}[$counter] =~ /^\s*End\s*$/i )) # spent 28.2ms making 21341 calls to installer::packagelist::CORE:match, avg 1µs/call |
556 | { | ||||
557 | 265706 | 1.72s | 265706 | 755ms | if ( ${$packagelist}[$counter] =~ /^\s*(\S+)\s*\=\s*\"(.*)\"/ ) # spent 755ms making 265706 calls to installer::packagelist::CORE:match, avg 3µs/call |
558 | { | ||||
559 | 265636 | 263ms | my $key = $1; | ||
560 | 265636 | 178ms | my $value = $2; | ||
561 | 265636 | 408ms | $onepackage{$key} = $value; | ||
562 | } | ||||
563 | |||||
564 | 265706 | 1.41s | 265706 | 394ms | $counter++; # spent 394ms making 265706 calls to installer::packagelist::CORE:match, avg 1µs/call |
565 | } | ||||
566 | |||||
567 | 21341 | 17.2ms | $onepackage{'islanguagemodule'} = $islanguagemodule; | ||
568 | 21341 | 14.6ms | if ( $islanguagemodule ) | ||
569 | { | ||||
570 | 15696 | 7.55ms | $saveonelanguage = $onelanguage; | ||
571 | 15696 | 62.0ms | 15696 | 15.7ms | $saveonelanguage =~ s/_/-/g; # spent 15.7ms making 15696 calls to installer::packagelist::CORE:subst, avg 1µs/call |
572 | 15696 | 19.8ms | $onepackage{'language'} = $saveonelanguage; | ||
573 | } | ||||
574 | |||||
575 | 21341 | 22.7ms | push(@allpackages, \%onepackage); | ||
576 | } | ||||
577 | } | ||||
578 | |||||
579 | # looking for the packinfo with the correct gid | ||||
580 | |||||
581 | 1283 | 682µs | my $foundgid = 0; | ||
582 | 1283 | 491µs | my $onepackage; | ||
583 | 1283 | 1.17ms | foreach $onepackage (@allpackages) | ||
584 | { | ||||
585 | # Adding the language to the module gid for LanguagePacks ! | ||||
586 | # Making the module gid language specific: gid_Module_Root -> gir_Module_Root_pt_BR (as defined in scp2) | ||||
587 | 8827 | 10.7ms | if ( $onelanguage ne "" ) { $onepackage->{'module'} = $onepackage->{'module'} . "_$onelanguage"; } | ||
588 | |||||
589 | 8827 | 8.47ms | if ( $onepackage->{'module'} eq $gid ) | ||
590 | { | ||||
591 | # Resolving the language identifier | ||||
592 | 1283 | 508µs | my $onekey; | ||
593 | 1283 | 8.62ms | foreach $onekey ( keys %{$onepackage} ) | ||
594 | { | ||||
595 | # Some keys require "-" instead of "_" for example in "en-US". All package names do not use underlines. | ||||
596 | 18858 | 9.03ms | my $locallang = $onelanguage; | ||
597 | 18858 | 14.0ms | if (( $onekey eq "solarispackagename" ) || | ||
598 | ( $onekey eq "solarisrequires" ) || | ||||
599 | ( $onekey eq "packagename" ) || | ||||
600 | 5131 | 19.1ms | 5131 | 4.18ms | ( $onekey eq "requires" )) { $locallang =~ s/_/-/g; } # avoiding illegal package abbreviation # spent 4.18ms making 5131 calls to installer::packagelist::CORE:subst, avg 815ns/call |
601 | 18858 | 109ms | 18858 | 39.6ms | $onepackage->{$onekey} =~ s/\%LANGUAGESTRING/$locallang/g; # spent 39.6ms making 18858 calls to installer::packagelist::CORE:subst, avg 2µs/call |
602 | } | ||||
603 | |||||
604 | # Saving the language for the package | ||||
605 | 1283 | 713µs | my $lang = $onelanguage; | ||
606 | 1283 | 4.98ms | 1283 | 1.10ms | $lang =~ s/_/-/g; # spent 1.10ms making 1283 calls to installer::packagelist::CORE:subst, avg 860ns/call |
607 | 1283 | 1.70ms | $onepackage->{'specificlanguage'} = $lang; | ||
608 | |||||
609 | 1283 | 932µs | push(@{$packages}, $onepackage); | ||
610 | 1283 | 578µs | $foundgid = 1; | ||
611 | 1283 | 1.39ms | last; | ||
612 | } | ||||
613 | } | ||||
614 | |||||
615 | 1283 | 223ms | if ( ! $foundgid ) | ||
616 | { | ||||
617 | installer::exiter::exit_program("ERROR: Could not find package info for module $gid in file \"$filename\"!", "get_packinfo"); | ||||
618 | } | ||||
619 | } | ||||
620 | |||||
621 | ##################################################################### | ||||
622 | # Collecting all packages from scp project. | ||||
623 | ##################################################################### | ||||
624 | |||||
625 | sub collectpackages | ||||
626 | # spent 10.0s (133ms+9.90) within installer::packagelist::collectpackages which was called:
# once (133ms+9.90s) by installer::run at line 993 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer.pm | ||||
627 | 1 | 3µs | my ( $allmodules, $languagesarrayref ) = @_; | ||
628 | |||||
629 | 1 | 5µs | 1 | 187µs | installer::logger::include_header_into_logfile("Collecting packages:"); # spent 187µs making 1 call to installer::logger::include_header_into_logfile |
630 | |||||
631 | 1 | 2µs | my @packages = (); | ||
632 | 1 | 2µs | my %gid_analyzed = (); | ||
633 | |||||
634 | 1 | 1µs | my $onemodule; | ||
635 | 1 | 3.75ms | foreach $onemodule ( @{$allmodules} ) | ||
636 | { | ||||
637 | 34601 | 40.4ms | if ( $onemodule->{'PackageInfo'} ) # this is a package module! | ||
638 | { | ||||
639 | 8519 | 7.54ms | my $modulegid = $onemodule->{'gid'}; | ||
640 | |||||
641 | 8519 | 3.79ms | my $styles = ""; | ||
642 | 8519 | 7.25ms | if ( $onemodule->{'Styles'} ) { $styles = $onemodule->{'Styles'}; } | ||
643 | |||||
644 | # checking modules with style LANGUAGEMODULE | ||||
645 | 8519 | 3.29ms | my $islanguagemodule = 0; | ||
646 | 8519 | 3.64ms | my $onelanguage = ""; | ||
647 | 8519 | 31.0ms | 8519 | 6.44ms | if ( $styles =~ /\bLANGUAGEMODULE\b/ ) # spent 6.44ms making 8519 calls to installer::packagelist::CORE:match, avg 755ns/call |
648 | { | ||||
649 | 1199 | 502µs | $islanguagemodule = 1; | ||
650 | 1199 | 1.08ms | $onelanguage = $onemodule->{'Language'}; # already checked, that it is set. | ||
651 | 1199 | 5.05ms | 1199 | 1.19ms | $onelanguage =~ s/-/_/g; # pt-BR -> pt_BR in scp # spent 1.19ms making 1199 calls to installer::packagelist::CORE:subst, avg 989ns/call |
652 | } | ||||
653 | |||||
654 | # Modules in different languages are listed more than once in multilingual installation sets | ||||
655 | 15755 | 11.4ms | if ( exists($gid_analyzed{$modulegid}) ) { next; } | ||
656 | 1283 | 1.98ms | $gid_analyzed{$modulegid} = 1; | ||
657 | |||||
658 | 1283 | 1.02ms | my $packinfofile = $onemodule->{'PackageInfo'}; | ||
659 | |||||
660 | # The file with package information has to be found in path list | ||||
661 | 1283 | 4.87ms | 1283 | 29.9ms | my $fileref = installer::scriptitems::get_sourcepath_from_filename_and_includepath(\$packinfofile, "" , 0); # spent 29.9ms making 1283 calls to installer::scriptitems::get_sourcepath_from_filename_and_includepath, avg 23µs/call |
662 | |||||
663 | 1283 | 715µs | if ( $$fileref eq "" ) { installer::exiter::exit_program("ERROR: Could not find file $packinfofile for module $modulegid!", "collectpackages"); } | ||
664 | |||||
665 | 1283 | 1.44ms | my $infoline = "$modulegid: Using packinfo: \"$$fileref\"!\n"; | ||
666 | 1283 | 1.64ms | push( @installer::globals::logfileinfo, $infoline); | ||
667 | |||||
668 | 1283 | 4.98ms | 1283 | 9.86s | get_packinfo($modulegid, $$fileref, \@packages, $onelanguage, $islanguagemodule); # spent 9.86s making 1283 calls to installer::packagelist::get_packinfo, avg 7.69ms/call |
669 | } | ||||
670 | } | ||||
671 | |||||
672 | 1 | 531µs | return \@packages; | ||
673 | } | ||||
674 | |||||
675 | ##################################################################### | ||||
676 | # Printing packages content for debugging purposes | ||||
677 | ##################################################################### | ||||
678 | |||||
679 | sub log_packages_content | ||||
680 | # spent 202ms (182+20.3) within installer::packagelist::log_packages_content which was called:
# once (182ms+20.3ms) by installer::run at line 1000 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer.pm | ||||
681 | 1 | 2µs | my ($packages) = @_; | ||
682 | |||||
683 | 1 | 2µs | if ( ! ( $#{$packages} > -1 )) { installer::exiter::exit_program("ERROR: No packages defined!", "print_content"); } | ||
684 | |||||
685 | 1 | 9µs | 1 | 207µs | installer::logger::include_header_into_logfile("Logging packages content:"); # spent 207µs making 1 call to installer::logger::include_header_into_logfile |
686 | |||||
687 | 1 | 1µs | my $infoline = ""; | ||
688 | |||||
689 | 1 | 1.76ms | for ( my $i = 0; $i <= $#{$packages}; $i++ ) | ||
690 | { | ||||
691 | 1283 | 969µs | my $onepackage = ${$packages}[$i]; | ||
692 | |||||
693 | # checking all items that must be defined | ||||
694 | |||||
695 | 1283 | 1.60ms | $infoline = "Package $onepackage->{'module'}\n"; | ||
696 | 1283 | 1.37ms | push(@installer::globals::logfileinfo, $infoline); | ||
697 | |||||
698 | 1283 | 460µs | my $key; | ||
699 | 1283 | 18.7ms | 1283 | 7.33ms | foreach $key (sort keys %{$onepackage}) # spent 7.33ms making 1283 calls to installer::packagelist::CORE:sort, avg 6µs/call |
700 | { | ||||
701 | 21424 | 73.6ms | 21424 | 12.8ms | if ( $key =~ /^\s*\;/ ) { next; } # spent 12.8ms making 21424 calls to installer::packagelist::CORE:match, avg 596ns/call |
702 | |||||
703 | 21424 | 44.3ms | if ( $key eq "allmodules" ) | ||
704 | { | ||||
705 | 1283 | 911µs | $infoline = "\t$key:\n"; | ||
706 | 1283 | 1.80ms | push(@installer::globals::logfileinfo, $infoline); | ||
707 | 1283 | 471µs | my $onemodule; | ||
708 | 1283 | 2.05ms | foreach $onemodule ( @{$onepackage->{$key}} ) | ||
709 | { | ||||
710 | 1553 | 1.22ms | $infoline = "\t\t$onemodule\n"; | ||
711 | 1553 | 3.41ms | push(@installer::globals::logfileinfo, $infoline); | ||
712 | } | ||||
713 | } | ||||
714 | else | ||||
715 | { | ||||
716 | 20141 | 23.2ms | $infoline = "\t$key: $onepackage->{$key}\n"; | ||
717 | 20141 | 24.3ms | push(@installer::globals::logfileinfo, $infoline); | ||
718 | } | ||||
719 | } | ||||
720 | |||||
721 | 1283 | 610µs | $infoline = "\n"; | ||
722 | 1283 | 1.45ms | push(@installer::globals::logfileinfo, $infoline); | ||
723 | |||||
724 | } | ||||
725 | } | ||||
726 | |||||
727 | ##################################################################### | ||||
728 | # Creating assignments from modules to destination paths. | ||||
729 | # This is required for logging in fileinfo file. Otherwise | ||||
730 | # the complete destination file would not be known in file list. | ||||
731 | # Saved in %installer::globals::moduledestination | ||||
732 | ##################################################################### | ||||
733 | |||||
734 | sub create_module_destination_hash | ||||
735 | # spent 2.71s (31.5ms+2.67) within installer::packagelist::create_module_destination_hash which was called:
# once (31.5ms+2.67s) by installer::run at line 1001 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer.pm | ||||
736 | 1 | 3µs | my ($packages, $allvariables) = @_; | ||
737 | |||||
738 | 1 | 2.36ms | for ( my $i = 0; $i <= $#{$packages}; $i++ ) | ||
739 | { | ||||
740 | 1283 | 1.06ms | my $onepackage = ${$packages}[$i]; | ||
741 | |||||
742 | 1283 | 1.78ms | my $defaultdestination = $onepackage->{'destpath'}; | ||
743 | 1283 | 11.7ms | 1283 | 2.67s | resolve_packagevariables(\$defaultdestination, $allvariables, 1); # spent 2.67s making 1283 calls to installer::packagelist::resolve_packagevariables, avg 2.08ms/call |
744 | 1283 | 5.76ms | 1283 | 1.72ms | if ( $^O =~ /darwin/i ) { $defaultdestination =~ s/\/opt\//\/Applications\//; } # spent 1.72ms making 1283 calls to installer::packagelist::CORE:match, avg 1µs/call |
745 | |||||
746 | 1283 | 3.13ms | foreach my $onemodule ( @{$onepackage->{'allmodules'}} ) | ||
747 | { | ||||
748 | 1553 | 5.50ms | $installer::globals::moduledestination{$onemodule} = $defaultdestination; | ||
749 | } | ||||
750 | } | ||||
751 | } | ||||
752 | |||||
753 | ##################################################################### | ||||
754 | # Adding the default paths into the files collector for Unixes. | ||||
755 | # This is necessary to know the complete destination path in | ||||
756 | # fileinfo log file. | ||||
757 | ##################################################################### | ||||
758 | |||||
759 | sub add_defaultpaths_into_filescollector | ||||
760 | { | ||||
761 | my ($allfiles) = @_; | ||||
762 | |||||
763 | for ( my $i = 0; $i <= $#{$allfiles}; $i++ ) | ||||
764 | { | ||||
765 | my $onefile = ${$allfiles}[$i]; | ||||
766 | |||||
767 | if ( ! $onefile->{'destination'} ) { installer::exiter::exit_program("ERROR: No destination found at file $onefile->{'gid'}!", "add_defaultpaths_into_filescollector"); } | ||||
768 | my $destination = $onefile->{'destination'}; | ||||
769 | |||||
770 | if ( ! $onefile->{'modules'} ) { installer::exiter::exit_program("ERROR: No modules found at file $onefile->{'gid'}!", "add_defaultpaths_into_filescollector"); } | ||||
771 | my $module = $onefile->{'modules'}; | ||||
772 | # If modules contains a list of modules, only taking the first one. | ||||
773 | if ( $module =~ /^\s*(.*?)\,/ ) { $module = $1; } | ||||
774 | |||||
775 | if ( ! exists($installer::globals::moduledestination{$module}) ) { installer::exiter::exit_program("ERROR: No default destination path found for module $module!", "add_defaultpaths_into_filescollector"); } | ||||
776 | my $defaultpath = $installer::globals::moduledestination{$module}; | ||||
777 | $defaultpath =~ s/\/\s*$//; # removing ending slashes | ||||
778 | my $fulldestpath = $defaultpath . $installer::globals::separator . $destination; | ||||
779 | |||||
780 | $onefile->{'fulldestpath'} = $fulldestpath; | ||||
781 | } | ||||
782 | } | ||||
783 | |||||
784 | ##################################################################### | ||||
785 | # Creating list of cabinet files from packages | ||||
786 | ##################################################################### | ||||
787 | |||||
788 | sub prepare_cabinet_files | ||||
789 | # spent 2.70s (33.6ms+2.66) within installer::packagelist::prepare_cabinet_files which was called:
# once (33.6ms+2.66s) by installer::run at line 1454 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer.pm | ||||
790 | 1 | 2µs | my ($packages, $allvariables) = @_; | ||
791 | |||||
792 | 1 | 3µs | if ( ! ( $#{$packages} > -1 )) { installer::exiter::exit_program("ERROR: No packages defined!", "print_content"); } | ||
793 | |||||
794 | 1 | 5µs | 1 | 144µs | installer::logger::include_header_into_logfile("Preparing cabinet files:"); # spent 144µs making 1 call to installer::logger::include_header_into_logfile |
795 | |||||
796 | 1 | 2µs | my $infoline = ""; | ||
797 | |||||
798 | 1 | 2.31ms | for ( my $i = 0; $i <= $#{$packages}; $i++ ) | ||
799 | { | ||||
800 | 1283 | 1.06ms | my $onepackage = ${$packages}[$i]; | ||
801 | |||||
802 | 1283 | 2.62ms | my $cabinetfile = "$onepackage->{'packagename'}\.cab"; | ||
803 | |||||
804 | 1283 | 11.4ms | 1283 | 2.66s | resolve_packagevariables(\$cabinetfile, $allvariables, 0); # spent 2.66s making 1283 calls to installer::packagelist::resolve_packagevariables, avg 2.08ms/call |
805 | |||||
806 | 1283 | 2.88ms | $installer::globals::allcabinets{$cabinetfile} = 1; | ||
807 | |||||
808 | # checking all items that must be defined | ||||
809 | |||||
810 | 1283 | 2.06ms | $infoline = "Package $onepackage->{'module'}\n"; | ||
811 | 1283 | 1.34ms | push(@installer::globals::logfileinfo, $infoline); | ||
812 | |||||
813 | # Assigning the cab file to the module and also to all corresponding sub modules | ||||
814 | |||||
815 | 1283 | 484µs | my $onemodule; | ||
816 | 1283 | 2.47ms | foreach $onemodule ( @{$onepackage->{'allmodules'}} ) | ||
817 | { | ||||
818 | 1553 | 5.05ms | if ( ! exists($installer::globals::allcabinetassigns{$onemodule}) ) | ||
819 | { | ||||
820 | $installer::globals::allcabinetassigns{$onemodule} = $cabinetfile; | ||||
821 | } | ||||
822 | else | ||||
823 | { | ||||
824 | my $infoline = "Warning: Already existing assignment: $onemodule : $installer::globals::allcabinetassigns{$onemodule}\n"; | ||||
825 | push(@installer::globals::logfileinfo, $infoline); | ||||
826 | $infoline = "Ignoring further assignment: $onemodule : $cabinetfile\n"; | ||||
827 | push(@installer::globals::logfileinfo, $infoline); | ||||
828 | } | ||||
829 | } | ||||
830 | } | ||||
831 | } | ||||
832 | |||||
833 | ##################################################################### | ||||
834 | # Logging assignments of cabinet files | ||||
835 | ##################################################################### | ||||
836 | |||||
837 | sub log_cabinet_assignments | ||||
838 | # spent 9.15ms (5.77+3.38) within installer::packagelist::log_cabinet_assignments which was called:
# once (5.77ms+3.38ms) by installer::run at line 1456 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer.pm | ||||
839 | 1 | 4µs | 1 | 151µs | installer::logger::include_header_into_logfile("Logging cabinet files:"); # spent 151µs making 1 call to installer::logger::include_header_into_logfile |
840 | |||||
841 | 1 | 2µs | my $infoline = "List of cabinet files:\n"; | ||
842 | 1 | 1µs | push(@installer::globals::logfileinfo, $infoline); | ||
843 | |||||
844 | 1 | 500ns | my $key; | ||
845 | 1284 | 3.65ms | 1 | 1.28ms | foreach $key ( sort keys %installer::globals::allcabinets ) { push(@installer::globals::logfileinfo, "\t$key\n"); } # spent 1.28ms making 1 call to installer::packagelist::CORE:sort |
846 | |||||
847 | 1 | 1µs | $infoline = "\nList of assignments from modules to cabinet files:\n"; | ||
848 | 1 | 1µs | push(@installer::globals::logfileinfo, $infoline); | ||
849 | |||||
850 | 1554 | 5.34ms | 1 | 1.95ms | foreach $key ( sort keys %installer::globals::allcabinetassigns ) { push(@installer::globals::logfileinfo, "\t$key : $installer::globals::allcabinetassigns{$key}\n"); } # spent 1.95ms making 1 call to installer::packagelist::CORE:sort |
851 | } | ||||
852 | |||||
853 | 1 | 8µs | 1; | ||
# spent 1.83s within installer::packagelist::CORE:match which was called 1288306 times, avg 1µs/call:
# 364762 times (264ms+0s) by installer::packagelist::get_packinfo at line 547, avg 723ns/call
# 336999 times (363ms+0s) by installer::packagelist::get_packinfo at line 549, avg 1µs/call
# 265706 times (755ms+0s) by installer::packagelist::get_packinfo at line 557, avg 3µs/call
# 265706 times (394ms+0s) by installer::packagelist::get_packinfo at line 564, avg 1µs/call
# 21424 times (12.8ms+0s) by installer::packagelist::log_packages_content at line 701, avg 596ns/call
# 21341 times (28.2ms+0s) by installer::packagelist::get_packinfo at line 555, avg 1µs/call
# 8519 times (6.44ms+0s) by installer::packagelist::collectpackages at line 647, avg 755ns/call
# 2566 times (1.75ms+0s) by installer::packagelist::resolve_packagevariables at line 442, avg 683ns/call
# 1283 times (1.72ms+0s) by installer::packagelist::create_module_destination_hash at line 744, avg 1µs/call | |||||
# spent 2.89s within installer::packagelist::CORE:regcomp which was called 284826 times, avg 10µs/call:
# 284826 times (2.89s+0s) by installer::packagelist::resolve_packagevariables at line 452, avg 10µs/call | |||||
# spent 10.6ms within installer::packagelist::CORE:sort which was called 1285 times, avg 8µs/call:
# 1283 times (7.33ms+0s) by installer::packagelist::log_packages_content at line 699, avg 6µs/call
# once (1.95ms+0s) by installer::packagelist::log_cabinet_assignments at line 850
# once (1.28ms+0s) by installer::packagelist::log_cabinet_assignments at line 845 | |||||
# spent 234ms within installer::packagelist::CORE:subst which was called 326993 times, avg 716ns/call:
# 284826 times (172ms+0s) by installer::packagelist::resolve_packagevariables at line 452, avg 605ns/call
# 18858 times (39.6ms+0s) by installer::packagelist::get_packinfo at line 601, avg 2µs/call
# 15696 times (15.7ms+0s) by installer::packagelist::get_packinfo at line 571, avg 1µs/call
# 5131 times (4.18ms+0s) by installer::packagelist::get_packinfo at line 600, avg 815ns/call
# 1283 times (1.10ms+0s) by installer::packagelist::get_packinfo at line 606, avg 860ns/call
# 1199 times (1.19ms+0s) by installer::packagelist::collectpackages at line 651, avg 989ns/call |