← Index
NYTProf Performance Profile   « block view • line view • sub view »
For C:/lo/libo-master/solenv/bin/make_installer.pl
  Run on Mon Sep 24 00:52:54 2012
Reported on Mon Sep 24 07:34:52 2012

Filename/cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer/packagelist.pm
StatementsExecuted 88107791 statements in 110s
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
12831163.9s63.9sinstaller::packagelist::::check_module_existenceinstaller::packagelist::check_module_existence
11123.5s23.5sinstaller::packagelist::::remove_multiple_modules_packagesinstaller::packagelist::remove_multiple_modules_packages
2842218.30s8.30sinstaller::packagelist::::get_children_with_hashinstaller::packagelist::get_children_with_hash (recurses: max depth 4, inclusive time 11.5s)
1283116.16s9.86sinstaller::packagelist::::get_packinfoinstaller::packagelist::get_packinfo
284826112.89s2.89sinstaller::packagelist::::CORE:regcompinstaller::packagelist::CORE:regcomp (opcode)
2566212.27s5.33sinstaller::packagelist::::resolve_packagevariablesinstaller::packagelist::resolve_packagevariables
1288306911.83s1.83sinstaller::packagelist::::CORE:matchinstaller::packagelist::CORE:match (opcode)
32699361234ms234msinstaller::packagelist::::CORE:substinstaller::packagelist::CORE:subst (opcode)
111215ms72.6sinstaller::packagelist::::analyze_listinstaller::packagelist::analyze_list
111182ms202msinstaller::packagelist::::log_packages_contentinstaller::packagelist::log_packages_content
111133ms10.0sinstaller::packagelist::::collectpackagesinstaller::packagelist::collectpackages
111118ms118msinstaller::packagelist::::get_module_hashinstaller::packagelist::get_module_hash
11133.6ms2.70sinstaller::packagelist::::prepare_cabinet_filesinstaller::packagelist::prepare_cabinet_files
11131.5ms2.71sinstaller::packagelist::::create_module_destination_hashinstaller::packagelist::create_module_destination_hash
11113.2ms13.4msinstaller::packagelist::::check_packagelistinstaller::packagelist::check_packagelist
12853110.6ms10.6msinstaller::packagelist::::CORE:sortinstaller::packagelist::CORE:sort (opcode)
1115.77ms9.15msinstaller::packagelist::::log_cabinet_assignmentsinstaller::packagelist::log_cabinet_assignments
111352µs355µsinstaller::packagelist::::BEGIN@30installer::packagelist::BEGIN@30
11117µs18µsinstaller::packagelist::::BEGIN@33installer::packagelist::BEGIN@33
11116µs18µsinstaller::packagelist::::BEGIN@34installer::packagelist::BEGIN@34
11115µs17µsinstaller::packagelist::::BEGIN@31installer::packagelist::BEGIN@31
11114µs16µsinstaller::packagelist::::BEGIN@32installer::packagelist::BEGIN@32
0000s0sinstaller::packagelist::::add_defaultpaths_into_filescollectorinstaller::packagelist::add_defaultpaths_into_filescollector
0000s0sinstaller::packagelist::::find_dirs_for_packageinstaller::packagelist::find_dirs_for_package
0000s0sinstaller::packagelist::::find_files_for_packageinstaller::packagelist::find_files_for_package
0000s0sinstaller::packagelist::::find_links_for_packageinstaller::packagelist::find_links_for_package
0000s0sinstaller::packagelist::::get_childreninstaller::packagelist::get_children
0000s0sinstaller::packagelist::::resolve_packagevariables2installer::packagelist::resolve_packagevariables2
Call graph for these subroutines as a Graphviz dot language file.
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
28package installer::packagelist;
29
30259µs2359µ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
use installer::converter;
# spent 355µs making 1 call to installer::packagelist::BEGIN@30 # spent 4µs making 1 call to UNIVERSAL::import
31253µs219µ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
use installer::exiter;
# spent 17µs making 1 call to installer::packagelist::BEGIN@31 # spent 2µs making 1 call to UNIVERSAL::import
32252µs219µ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
use installer::globals;
# spent 16µs making 1 call to installer::packagelist::BEGIN@32 # spent 2µs making 1 call to UNIVERSAL::import
33255µs220µ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
use installer::remover;
# spent 18µs making 1 call to installer::packagelist::BEGIN@33 # spent 2µs making 1 call to UNIVERSAL::import
3426.61ms220µ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
use installer::scriptitems;
# 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
40sub 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
{
4212832.24ms my ($onegid, $moduleslist) = @_;
43
4412831.11ms my $foundgid = 0;
45
46128327.0s for ( my $i = 0; $i <= $#{$moduleslist}; $i++ )
47 {
482374589226.4s my $gid = ${$moduleslist}[$i]->{'gid'};
49
502374589210.5s if ( $gid eq $onegid )
51 {
5212831.32ms $foundgid = 1;
5312832.69ms last;
54 }
55 }
56
57128331.4ms return $foundgid;
58}
59
60###################################################
61# Analyzing the gids, defined in the packagelist
62###################################################
63
64sub 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
{
6612µs my ($packagelist, $moduleslist) = @_;
67
6811µs @allpackages = ();
69
7014µs1118ms my $moduleshash = get_module_hash($moduleslist);
# spent 118ms making 1 call to installer::packagelist::get_module_hash
71
7214.03ms for ( my $i = 0; $i <= $#{$packagelist}; $i++ )
73 {
7412832.28ms my $onepackage = ${$packagelist}[$i];
75
7612832.53ms my $onegid = $onepackage->{'module'};
77
7812838.43ms128334.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
8012835.68ms128363.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
821283764µs if ( ! $moduleexists ) { next; }
83
8412833.42ms my @allmodules = ();
85
8612836.90ms push(@allmodules, $onegid);
87
881283143ms12838.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
9012839.76ms $onepackage->{'allmodules'} = \@allmodules;
91
9212833.20ms push(@allpackages, $onepackage);
93 }
94
951826µ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
103sub 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
{
10511µs my ($moduleslist) = @_;
106
10711µs my %modulehash = ();
108
109134.6ms for ( my $i = 0; $i <= $#{$moduleslist}; $i++ )
110 {
1113460136.0ms my $gid = ${$moduleslist}[$i]->{'gid'};
112 # Containing only modules with parent. Root modules can be ignored.
1133460147.0ms if ( ${$moduleslist}[$i]->{'ParentID'} ) { $modulehash{$gid} = ${$moduleslist}[$i]->{'ParentID'}; }
114 }
115
116131µs return \%modulehash;
117}
118
119########################################################
120# Recursively defined procedure to order
121# modules and directories
122########################################################
123
124sub 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
{
12628425.82ms my ($modulehash, $parentgid, $newitemorder) = @_;
127
12828421.31s foreach my $gid ( keys %{$modulehash} )
129 {
13044107843.09s my $parent = $modulehash->{$gid};
131
13244107843.89s if ( $parent eq $parentgid )
133 {
13415591.39ms push(@{$newitemorder}, $gid);
13515591.31ms my $parent = $gid;
13615595.49ms15590s 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
146sub 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
171sub 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
{
17312µs my ($allpackagemodules) = @_;
174
175 # iterating over all packages
176
17711.89ms for ( my $i = 0; $i <= $#{$allpackagemodules}; $i++ )
178 {
1791283887µs my $onepackage = ${$allpackagemodules}[$i];
1801283838µ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
1891283812µs my $packagecount = $#{$allmodules};
190
19112831.07ms my @optimizedpackage = ();
192
193 # iterating over all modules of this package
194
19512835.68ms for ( my $j = 0; $j <= $#{$allmodules}; $j++ )
196 {
19728423.12ms my $onemodule = ${$allmodules}[$j]; # this is the module, that shall be removed or not
198
19928421.22ms my $put_module_into_new_package = 1;
200
201 # iterating over all other packages
202
20328423.73s for ( my $k = 0; $k <= $#{$allpackagemodules}; $k++ )
204 {
20536491281.45s if ( $k == $i ) { next; } # not comparing equal module
206
20744647341.63s if (! $put_module_into_new_package) { next; } # do not compare, if already found
208
20928221541.60s my $comparepackage = ${$allpackagemodules}[$k];
21028221541.67s my $allcomparemodules = $comparepackage->{'allmodules'};
211
21228221541.52s my $comparepackagecount = $#{$allcomparemodules};
213
214 # modules will only be removed from packages, that have more modules
215 # than the compare package
216
21728272641.08s if ( $packagecount < $comparepackagecount ) { next; } # nothing to do, take next package
218
219 # iterating over all modules of this package
220
22128170447.76s for ( my $m = 0; $m <= $#{$allcomparemodules}; $m++ )
222 {
22328191201.69s my $onecomparemodule = ${$allcomparemodules}[$m];
224
22528191201.35s if ( $onemodule eq $onecomparemodule ) # this $onemodule has to be removed
226 {
227 $put_module_into_new_package = 0;
228 }
229 }
230 }
231
23228426.91ms if ( $put_module_into_new_package )
233 {
234 push(@optimizedpackage, $onemodule)
235 }
236 }
237
23812834.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
247sub 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
302sub 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
384sub 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
435sub 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
{
43725662.40ms my ($packagenameref, $variableshashref, $make_lowercase) = @_;
438
4392566893µs my $key;
440
441 # Special handling for dictionaries
442256610.4ms25661.75ms if ( $$packagenameref =~ /-dict-/ )
# spent 1.75ms making 2566 calls to installer::packagelist::CORE:match, avg 683ns/call
443 {
4444634µs if (exists($variableshashref->{'DICTIONARYUNIXPRODUCTNAME'}) ) { $$packagenameref =~ s/\%UNIXPRODUCTNAME/$variableshashref->{'DICTIONARYUNIXPRODUCTNAME'}/g; }
4454630µs if (exists($variableshashref->{'DICTIONARYBRANDPACKAGEVERSION'}) ) { $$packagenameref =~ s/\%BRANDPACKAGEVERSION/$variableshashref->{'DICTIONARYBRANDPACKAGEVERSION'}/g; }
446 }
447
448256662.7ms foreach $key (keys %{$variableshashref})
449 {
450284826220ms my $value = $variableshashref->{$key};
451284826132ms if ( $make_lowercase ) { $value = lc($value); }
4522848264.91s5696523.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
460sub 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
491sub 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
{
49311µs my ($packages) = @_;
494
49512µs if ( ! ( $#{$packages} > -1 )) { installer::exiter::exit_program("ERROR: No packages defined!", "check_packagelist"); }
496
49711.40ms for ( my $i = 0; $i <= $#{$packages}; $i++ )
498 {
4991283864µs my $onepackage = ${$packages}[$i];
500
5011283441µs my $element;
502
503 # checking all items that must be defined
504
50512831.58ms foreach $element (@installer::globals::packagelistitems)
506 {
50776988.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
5151283738µs if ( $onepackage->{'script'} )
516 {
51776µs my $scriptfile = $onepackage->{'script'};
51877µs my $gid = $onepackage->{'module'};
519723µs7144µ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
52173µs if ( $$fileref eq "" ) { installer::exiter::exit_program("ERROR: Could not find script file $scriptfile for module $gid!", "check_packagelist"); }
522
523711µs my $infoline = "$gid: Using script file: \"$$fileref\"!\n";
524710µs push( @installer::globals::logfileinfo, $infoline);
525
526714µs $onepackage->{'script'} = $$fileref;
527 }
528 }
529}
530
531#####################################################################
532# Reading pack info for one module from packinfo file.
533#####################################################################
534
535sub 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
{
53712831.62ms my ($gid, $filename, $packages, $onelanguage, $islanguagemodule) = @_;
538
53912833.69ms12831.84s my $packagelist = installer::files::read_file($filename);
# spent 1.84s making 1283 calls to installer::files::read_file, avg 1.44ms/call
540
5411283951µs my @allpackages = ();
542
5431283473ms for ( my $i = 0; $i <= $#{$packagelist}; $i++ )
544 {
545364762234ms my $line = ${$packagelist}[$i];
546
5473925251.29s364762264ms if ( $line =~ /^\s*\#/ ) { next; } # this is a comment line
# spent 264ms making 364762 calls to installer::packagelist::CORE:match, avg 723ns/call
548
5493369991.34s336999363ms 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 {
5512134115.7ms my %onepackage = ();
552
5532134114.9ms my $counter = $i + 1;
554
55521341106ms2134128.2ms while (!( ${$packagelist}[$counter] =~ /^\s*End\s*$/i ))
# spent 28.2ms making 21341 calls to installer::packagelist::CORE:match, avg 1µs/call
556 {
5572657061.72s265706755ms if ( ${$packagelist}[$counter] =~ /^\s*(\S+)\s*\=\s*\"(.*)\"/ )
# spent 755ms making 265706 calls to installer::packagelist::CORE:match, avg 3µs/call
558 {
559265636263ms my $key = $1;
560265636178ms my $value = $2;
561265636408ms $onepackage{$key} = $value;
562 }
563
5642657061.41s265706394ms $counter++;
# spent 394ms making 265706 calls to installer::packagelist::CORE:match, avg 1µs/call
565 }
566
5672134117.2ms $onepackage{'islanguagemodule'} = $islanguagemodule;
5682134114.6ms if ( $islanguagemodule )
569 {
570156967.55ms $saveonelanguage = $onelanguage;
5711569662.0ms1569615.7ms $saveonelanguage =~ s/_/-/g;
# spent 15.7ms making 15696 calls to installer::packagelist::CORE:subst, avg 1µs/call
5721569619.8ms $onepackage{'language'} = $saveonelanguage;
573 }
574
5752134122.7ms push(@allpackages, \%onepackage);
576 }
577 }
578
579 # looking for the packinfo with the correct gid
580
5811283682µs my $foundgid = 0;
5821283491µs my $onepackage;
58312831.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)
587882710.7ms if ( $onelanguage ne "" ) { $onepackage->{'module'} = $onepackage->{'module'} . "_$onelanguage"; }
588
58988278.47ms if ( $onepackage->{'module'} eq $gid )
590 {
591 # Resolving the language identifier
5921283508µs my $onekey;
59312838.62ms foreach $onekey ( keys %{$onepackage} )
594 {
595 # Some keys require "-" instead of "_" for example in "en-US". All package names do not use underlines.
596188589.03ms my $locallang = $onelanguage;
5971885814.0ms if (( $onekey eq "solarispackagename" ) ||
598 ( $onekey eq "solarisrequires" ) ||
599 ( $onekey eq "packagename" ) ||
600513119.1ms51314.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
60118858109ms1885839.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
6051283713µs my $lang = $onelanguage;
60612834.98ms12831.10ms $lang =~ s/_/-/g;
# spent 1.10ms making 1283 calls to installer::packagelist::CORE:subst, avg 860ns/call
60712831.70ms $onepackage->{'specificlanguage'} = $lang;
608
6091283932µs push(@{$packages}, $onepackage);
6101283578µs $foundgid = 1;
61112831.39ms last;
612 }
613 }
614
6151283223ms 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
625sub 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
{
62713µs my ( $allmodules, $languagesarrayref ) = @_;
628
62915µs1187µs installer::logger::include_header_into_logfile("Collecting packages:");
# spent 187µs making 1 call to installer::logger::include_header_into_logfile
630
63112µs my @packages = ();
63212µs my %gid_analyzed = ();
633
63411µs my $onemodule;
63513.75ms foreach $onemodule ( @{$allmodules} )
636 {
6373460140.4ms if ( $onemodule->{'PackageInfo'} ) # this is a package module!
638 {
63985197.54ms my $modulegid = $onemodule->{'gid'};
640
64185193.79ms my $styles = "";
64285197.25ms if ( $onemodule->{'Styles'} ) { $styles = $onemodule->{'Styles'}; }
643
644 # checking modules with style LANGUAGEMODULE
64585193.29ms my $islanguagemodule = 0;
64685193.64ms my $onelanguage = "";
647851931.0ms85196.44ms if ( $styles =~ /\bLANGUAGEMODULE\b/ )
# spent 6.44ms making 8519 calls to installer::packagelist::CORE:match, avg 755ns/call
648 {
6491199502µs $islanguagemodule = 1;
65011991.08ms $onelanguage = $onemodule->{'Language'}; # already checked, that it is set.
65111995.05ms11991.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
6551575511.4ms if ( exists($gid_analyzed{$modulegid}) ) { next; }
65612831.98ms $gid_analyzed{$modulegid} = 1;
657
65812831.02ms my $packinfofile = $onemodule->{'PackageInfo'};
659
660 # The file with package information has to be found in path list
66112834.87ms128329.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
6631283715µs if ( $$fileref eq "" ) { installer::exiter::exit_program("ERROR: Could not find file $packinfofile for module $modulegid!", "collectpackages"); }
664
66512831.44ms my $infoline = "$modulegid: Using packinfo: \"$$fileref\"!\n";
66612831.64ms push( @installer::globals::logfileinfo, $infoline);
667
66812834.98ms12839.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
6721531µs return \@packages;
673}
674
675#####################################################################
676# Printing packages content for debugging purposes
677#####################################################################
678
679sub 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
{
68112µs my ($packages) = @_;
682
68312µs if ( ! ( $#{$packages} > -1 )) { installer::exiter::exit_program("ERROR: No packages defined!", "print_content"); }
684
68519µs1207µs installer::logger::include_header_into_logfile("Logging packages content:");
# spent 207µs making 1 call to installer::logger::include_header_into_logfile
686
68711µs my $infoline = "";
688
68911.76ms for ( my $i = 0; $i <= $#{$packages}; $i++ )
690 {
6911283969µs my $onepackage = ${$packages}[$i];
692
693 # checking all items that must be defined
694
69512831.60ms $infoline = "Package $onepackage->{'module'}\n";
69612831.37ms push(@installer::globals::logfileinfo, $infoline);
697
6981283460µs my $key;
699128318.7ms12837.33ms foreach $key (sort keys %{$onepackage})
# spent 7.33ms making 1283 calls to installer::packagelist::CORE:sort, avg 6µs/call
700 {
7012142473.6ms2142412.8ms if ( $key =~ /^\s*\;/ ) { next; }
# spent 12.8ms making 21424 calls to installer::packagelist::CORE:match, avg 596ns/call
702
7032142444.3ms if ( $key eq "allmodules" )
704 {
7051283911µs $infoline = "\t$key:\n";
70612831.80ms push(@installer::globals::logfileinfo, $infoline);
7071283471µs my $onemodule;
70812832.05ms foreach $onemodule ( @{$onepackage->{$key}} )
709 {
71015531.22ms $infoline = "\t\t$onemodule\n";
71115533.41ms push(@installer::globals::logfileinfo, $infoline);
712 }
713 }
714 else
715 {
7162014123.2ms $infoline = "\t$key: $onepackage->{$key}\n";
7172014124.3ms push(@installer::globals::logfileinfo, $infoline);
718 }
719 }
720
7211283610µs $infoline = "\n";
72212831.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
734sub 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
{
73613µs my ($packages, $allvariables) = @_;
737
73812.36ms for ( my $i = 0; $i <= $#{$packages}; $i++ )
739 {
74012831.06ms my $onepackage = ${$packages}[$i];
741
74212831.78ms my $defaultdestination = $onepackage->{'destpath'};
743128311.7ms12832.67s resolve_packagevariables(\$defaultdestination, $allvariables, 1);
# spent 2.67s making 1283 calls to installer::packagelist::resolve_packagevariables, avg 2.08ms/call
74412835.76ms12831.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
74612833.13ms foreach my $onemodule ( @{$onepackage->{'allmodules'}} )
747 {
74815535.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
759sub 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
788sub 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
{
79012µs my ($packages, $allvariables) = @_;
791
79213µs if ( ! ( $#{$packages} > -1 )) { installer::exiter::exit_program("ERROR: No packages defined!", "print_content"); }
793
79415µs1144µs installer::logger::include_header_into_logfile("Preparing cabinet files:");
# spent 144µs making 1 call to installer::logger::include_header_into_logfile
795
79612µs my $infoline = "";
797
79812.31ms for ( my $i = 0; $i <= $#{$packages}; $i++ )
799 {
80012831.06ms my $onepackage = ${$packages}[$i];
801
80212832.62ms my $cabinetfile = "$onepackage->{'packagename'}\.cab";
803
804128311.4ms12832.66s resolve_packagevariables(\$cabinetfile, $allvariables, 0);
# spent 2.66s making 1283 calls to installer::packagelist::resolve_packagevariables, avg 2.08ms/call
805
80612832.88ms $installer::globals::allcabinets{$cabinetfile} = 1;
807
808 # checking all items that must be defined
809
81012832.06ms $infoline = "Package $onepackage->{'module'}\n";
81112831.34ms push(@installer::globals::logfileinfo, $infoline);
812
813 # Assigning the cab file to the module and also to all corresponding sub modules
814
8151283484µs my $onemodule;
81612832.47ms foreach $onemodule ( @{$onepackage->{'allmodules'}} )
817 {
81815535.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
837sub 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
{
83914µs1151µs installer::logger::include_header_into_logfile("Logging cabinet files:");
# spent 151µs making 1 call to installer::logger::include_header_into_logfile
840
84112µs my $infoline = "List of cabinet files:\n";
84211µs push(@installer::globals::logfileinfo, $infoline);
843
8441500ns my $key;
84512843.65ms11.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
84711µs $infoline = "\nList of assignments from modules to cabinet files:\n";
84811µs push(@installer::globals::logfileinfo, $infoline);
849
85015545.34ms11.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
85318µs1;
 
# 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
sub installer::packagelist::CORE:match; # opcode
# 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
sub installer::packagelist::CORE:regcomp; # opcode
# 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
sub installer::packagelist::CORE:sort; # opcode
# 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
sub installer::packagelist::CORE:subst; # opcode