← 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/setupscript.pm
StatementsExecuted 4713297 statements in 17.2s
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
1313113.4s17.8sinstaller::setupscript::::get_all_items_from_scriptinstaller::setupscript::get_all_items_from_script
19561532211.45s1.45sinstaller::setupscript::::CORE:matchinstaller::setupscript::CORE:match (opcode)
1557859311.24s1.24sinstaller::setupscript::::CORE:regcompinstaller::setupscript::CORE:regcomp (opcode)
111707ms1.03sinstaller::setupscript::::replace_all_setupscriptvariables_in_scriptinstaller::setupscript::replace_all_setupscriptvariables_in_script
233446131581ms581msinstaller::setupscript::::CORE:substinstaller::setupscript::CORE:subst (opcode)
111393µs550µsinstaller::setupscript::::resolve_lowercase_productname_setupscriptvariableinstaller::setupscript::resolve_lowercase_productname_setupscriptvariable
111348µs456µsinstaller::setupscript::::BEGIN@30installer::setupscript::BEGIN@30
111298µs442µsinstaller::setupscript::::add_lowercase_productname_setupscriptvariableinstaller::setupscript::add_lowercase_productname_setupscriptvariable
111296µs402µsinstaller::setupscript::::add_installationobject_to_variablesinstaller::setupscript::add_installationobject_to_variables
111222µs304µsinstaller::setupscript::::get_all_scriptvariables_from_installation_objectinstaller::setupscript::get_all_scriptvariables_from_installation_object
111150µs1.92msinstaller::setupscript::::prepare_non_advertised_filesinstaller::setupscript::prepare_non_advertised_files
11177µs91µsinstaller::setupscript::::add_predefined_folderinstaller::setupscript::add_predefined_folder
11136µs36µsinstaller::setupscript::::CORE:sortinstaller::setupscript::CORE:sort (opcode)
11136µs153µsinstaller::setupscript::::set_setupscript_nameinstaller::setupscript::set_setupscript_name
11124µs24µsinstaller::setupscript::::add_forced_propertiesinstaller::setupscript::add_forced_properties
11120µs20µsinstaller::setupscript::::replace_preset_propertiesinstaller::setupscript::replace_preset_properties
11116µs19µsinstaller::setupscript::::BEGIN@36installer::setupscript::BEGIN@36
11115µs18µsinstaller::setupscript::::BEGIN@37installer::setupscript::BEGIN@37
11115µs17µsinstaller::setupscript::::BEGIN@32installer::setupscript::BEGIN@32
11114µs16µsinstaller::setupscript::::BEGIN@35installer::setupscript::BEGIN@35
11113µs16µsinstaller::setupscript::::BEGIN@33installer::setupscript::BEGIN@33
11113µs118µsinstaller::setupscript::::BEGIN@34installer::setupscript::BEGIN@34
2113µs3µsinstaller::setupscript::::CORE:substcontinstaller::setupscript::CORE:substcont (opcode)
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::setupscript;
29
30269µs2564µs
# spent 456µs (348+108) within installer::setupscript::BEGIN@30 which was called: # once (348µs+108µs) by installer::scppatchsoname::BEGIN@33 at line 30
use base 'Exporter';
# spent 456µs making 1 call to installer::setupscript::BEGIN@30 # spent 108µs making 1 call to base::import
31
32254µs220µs
# spent 17µs (15+3) within installer::setupscript::BEGIN@32 which was called: # once (15µs+3µs) by installer::scppatchsoname::BEGIN@33 at line 32
use installer::exiter;
# spent 17µs making 1 call to installer::setupscript::BEGIN@32 # spent 2µs making 1 call to UNIVERSAL::import
33264µs218µs
# spent 16µs (13+3) within installer::setupscript::BEGIN@33 which was called: # once (13µs+3µs) by installer::scppatchsoname::BEGIN@33 at line 33
use installer::globals;
# spent 16µs making 1 call to installer::setupscript::BEGIN@33 # spent 3µs making 1 call to UNIVERSAL::import
34258µs2223µs
# spent 118µs (13+105) within installer::setupscript::BEGIN@34 which was called: # once (13µs+105µs) by installer::scppatchsoname::BEGIN@33 at line 34
use installer::logger qw(globallog);
# spent 118µs making 1 call to installer::setupscript::BEGIN@34 # spent 105µs making 1 call to Exporter::import
35255µs218µs
# spent 16µs (14+2) within installer::setupscript::BEGIN@35 which was called: # once (14µs+2µs) by installer::scppatchsoname::BEGIN@33 at line 35
use installer::remover;
# spent 16µs making 1 call to installer::setupscript::BEGIN@35 # spent 2µs making 1 call to UNIVERSAL::import
36254µs222µs
# spent 19µs (16+3) within installer::setupscript::BEGIN@36 which was called: # once (16µs+3µs) by installer::scppatchsoname::BEGIN@33 at line 36
use installer::scriptitems;
# spent 19µs making 1 call to installer::setupscript::BEGIN@36 # spent 3µs making 1 call to UNIVERSAL::import
3724.34ms221µs
# spent 18µs (15+3) within installer::setupscript::BEGIN@37 which was called: # once (15µs+3µs) by installer::scppatchsoname::BEGIN@33 at line 37
use installer::ziplist;
# spent 18µs making 1 call to installer::setupscript::BEGIN@37 # spent 3µs making 1 call to UNIVERSAL::import
38
3918µsour @EXPORT_OK = qw(
40 add_forced_properties
41 add_installationobject_to_variables
42 add_lowercase_productname_setupscriptvariable
43 add_predefined_folder
44 get_all_items_from_script
45 get_all_scriptvariables_from_installation_object
46 prepare_non_advertised_files
47 replace_all_setupscriptvariables_in_script
48 replace_preset_properties
49 resolve_lowercase_productname_setupscriptvariable
50 set_setupscript_name
51);
52
53#######################################################
54# Set setup script name, if not defined as parameter
55#######################################################
56
57sub set_setupscript_name
58
# spent 153µs (36+117) within installer::setupscript::set_setupscript_name which was called: # once (36µs+117µs) by installer::run at line 315 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer.pm
{
5912µs my ( $allsettingsarrayref, $includepatharrayref ) = @_;
60
6115µs190µs my $scriptnameref = installer::ziplist::getinfofromziplist($allsettingsarrayref, "script");
# spent 90µs making 1 call to installer::ziplist::getinfofromziplist
62
6311µs my $scriptname = $$scriptnameref;
64
6511µs if ( $scriptname eq "" ) # not defined on command line and not in product list
66 {
67 installer::exiter::exit_program("ERROR: Setup script not defined on command line (-l) and not in product list!", "set_setupscript_name");
68 }
69
70113µs13µs if ( $installer::globals::compiler =~ /wnt/ )
# spent 3µs making 1 call to installer::setupscript::CORE:match
71 {
72 $scriptname .= ".inf";
73 }
74 else
75 {
76 $scriptname .= ".ins";
77 }
78
79 # and now the complete path for the setup script is needed
80 # The log file cannot be used, because this is the language independent section
81
8214µs124µs $scriptnameref = installer::scriptitems::get_sourcepath_from_filename_and_includepath(\$scriptname, $includepatharrayref, 1);
83
8412µs $installer::globals::setupscriptname = $$scriptnameref;
85
8617µs if ( $installer::globals::setupscriptname eq "" )
87 {
88 installer::exiter::exit_program("ERROR: Script $scriptname not found!", "set_setupscript_name");
89 }
90}
91
92#####################################################################
93# Reading script variables from installation object of script file
94#####################################################################
95
96sub get_all_scriptvariables_from_installation_object
97
# spent 304µs (222+82) within installer::setupscript::get_all_scriptvariables_from_installation_object which was called: # once (222µs+82µs) by installer::run at line 330 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer.pm
{
9813µs my ($scriptref) = @_;
99
10011µs my @installobjectvariables;
101
10214µs for ( my $i = 0; $i <= $#{$scriptref}; $i++ )
103 {
10412µs my $line = ${$scriptref}[$i];
105
106118µs19µs if ( $line =~ /^\s*Installation\s+\w+\s*$/ ) # should be the first line
# spent 9µs making 1 call to installer::setupscript::CORE:match
107 {
10812µs my $counter = $i+1;
10912µs my $installline = ${$scriptref}[$counter];
110
11117µs11µs while (!($installline =~ /^\s*End\s*$/ ))
# spent 1µs making 1 call to installer::setupscript::CORE:match
112 {
1131083µs1044µs if ( $installline =~ /^\s*(\w+)\s+\=\s*(.*?)\s*\;\s*$/ )
# spent 44µs making 10 calls to installer::setupscript::CORE:match, avg 4µs/call
114 {
1151011µs my $key = $1;
116107µs my $value = $2;
117
118 # removing leading and ending " in $value
119
1201059µs1020µs if ( $value =~ /^\s*\"(.*)\"\s*$/ )
# spent 20µs making 10 calls to installer::setupscript::CORE:match, avg 2µs/call
121 {
122 $value = $1;
123 }
124
1251010µs $key = "\%" . uc($key); # $key is %PRODUCTNAME
126
1271011µs my $input = $key . " " . $value . "\n"; # $key can only be the first word
128
1291015µs push(@installobjectvariables ,$input);
130 }
131
132105µs $counter++;
1331053µs108µs $installline = ${$scriptref}[$counter];
# spent 8µs making 10 calls to installer::setupscript::CORE:match, avg 780ns/call
134 }
135 }
136
13712µs last; # not interesting after installation object
138 }
139
14019µs return \@installobjectvariables;
141}
142
143######################################################################
144# Including LCPRODUCTNAME into the array
145######################################################################
146
147sub add_lowercase_productname_setupscriptvariable
148
# spent 442µs (298+144) within installer::setupscript::add_lowercase_productname_setupscriptvariable which was called: # once (298µs+144µs) by installer::run at line 332 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer.pm
{
14912µs my ( $variablesref ) = @_;
150
151137µs for ( my $j = 0; $j <= $#{$variablesref}; $j++ )
152 {
1532215µs my $variableline = ${$variablesref}[$j];
154
1552210µs my ($key, $value);
156
15722202µs22109µs if ( $variableline =~ /^\s*\%(\w+?)\s+(.*?)\s*$/ )
# spent 109µs making 22 calls to installer::setupscript::CORE:match, avg 5µs/call
158 {
1592221µs $key = $1;
1602213µs $value = $2;
161
1622217µs if ( $key eq "PRODUCTNAME" )
163 {
16414µs my $newline = "\%LCPRODUCTNAME " . lc($value) . "\n";
16511µs push(@{$variablesref} ,$newline);
16611µs my $original = $value;
167127µs117µs $value =~ s/\s*//g;
# spent 17µs making 1 call to installer::setupscript::CORE:subst
16813µs $newline = "\%ONEWORDPRODUCTNAME " . $value . "\n";
16912µs push(@{$variablesref} ,$newline);
17013µs $newline = "\%LCONEWORDPRODUCTNAME " . lc($value) . "\n";
17112µs push(@{$variablesref} ,$newline);
1721600ns $value = $original;
173112µs17µs $value =~ s/\s*$//g;
# spent 7µs making 1 call to installer::setupscript::CORE:subst
17419µs14µs $value =~ s/^\s*//g;
# spent 4µs making 1 call to installer::setupscript::CORE:subst
17516µs11µs $value =~ s/ /\%20/g;
# spent 1µs making 1 call to installer::setupscript::CORE:subst
17612µs $newline = "\%MASKEDPRODUCTNAME " . $value . "\n";
17711µs push(@{$variablesref} ,$newline);
1781500ns $value = $original;
17916µs12µs $value =~ s/\s/\_/g;
# spent 2µs making 1 call to installer::setupscript::CORE:subst
18012µs $newline = "\%UNIXPRODUCTNAME " . lc($value) . "\n";
18112µs push(@{$variablesref} ,$newline);
18212µs $newline = "\%SYSTEMINTUNIXPACKAGENAME " . lc($value) . "\n";
18311µs push(@{$variablesref} ,$newline);
18412µs $newline = "\%UNIXPACKAGENAME " . lc($value) . "\n";
18511µs push(@{$variablesref} ,$newline);
1861500ns $value = $original;
18715µs1500ns $value =~ s/\s/\_/g;
# spent 500ns making 1 call to installer::setupscript::CORE:subst
18816µs11µs $value =~ s/\.//g;
# spent 1µs making 1 call to installer::setupscript::CORE:subst
18913µs $newline = "\%WITHOUTDOTUNIXPRODUCTNAME " . lc($value) . "\n";
19011µs push(@{$variablesref} ,$newline);
19112µs $newline = "\%WITHOUTDOTUNIXPACKAGENAME " . lc($value) . "\n";
19211µs push(@{$variablesref} ,$newline);
19312µs $newline = "\%SOLARISBRANDPACKAGENAME " . lc($value) . "\n";
19411µs push(@{$variablesref} ,$newline);
19511µs $value = $original;
196 }
197 elsif ( $key eq "PRODUCTEXTENSION" )
198 {
19914µs my $newline = "\%LCPRODUCTEXTENSION " . lc($value) . "\n";
20012µs push(@{$variablesref} ,$newline);
201 }
202 elsif ( $key eq "PRODUCTVERSION" )
203 {
204110µs14µs $value =~ s/\.//g;
# spent 4µs making 1 call to installer::setupscript::CORE:subst
20512µs my $newline = "\%WITHOUTDOTPRODUCTVERSION " . $value . "\n";
20611µs push(@{$variablesref} ,$newline);
207 }
208 }
209 }
210}
211
212######################################################################
213# Resolving the new introduced lowercase script variables
214######################################################################
215
216sub resolve_lowercase_productname_setupscriptvariable
217
# spent 550µs (393+157) within installer::setupscript::resolve_lowercase_productname_setupscriptvariable which was called: # once (393µs+157µs) by installer::run at line 334 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer.pm
{
21811µs my ( $variablesref ) = @_;
219
22012µs my %variables = ();
221
222 # First step: Collecting variables
223
224131µs for ( my $j = 0; $j <= $#{$variablesref}; $j++ )
225 {
2262216µs my $variableline = ${$variablesref}[$j];
227
2282210µs my ($key, $value);
229
23022204µs22110µs if ( $variableline =~ /^\s*\%(\w+?)\s+(.*?)\s*$/ )
# spent 110µs making 22 calls to installer::setupscript::CORE:match, avg 5µs/call
231 {
2322230µs $key = $1;
2332215µs $value = $2;
2342243µs $variables{$key} = $value;
235 }
236 }
237
238 # Second step: Resolving variables
239
240148µs for ( my $j = 0; $j <= $#{$variablesref}; $j++ )
241 {
2422294µs2215µs if ( ${$variablesref}[$j] =~ /\$\{(.*?)\}/ )
# spent 15µs making 22 calls to installer::setupscript::CORE:match, avg 668ns/call
243 {
24412µs my $key = $1;
245158µs432µs ${$variablesref}[$j] =~ s/\$\{\Q$key\E\}/$variables{$key}/g;
# spent 26µs making 1 call to installer::setupscript::CORE:regcomp # spent 3µs making 2 calls to installer::setupscript::CORE:substcont, avg 2µs/call # spent 3µs making 1 call to installer::setupscript::CORE:subst
246 }
247 }
248
249}
250
251######################################################################
252# Replacing all setup script variables inside the setup script file
253######################################################################
254
255sub replace_all_setupscriptvariables_in_script
256
# spent 1.03s (707ms+322ms) within installer::setupscript::replace_all_setupscriptvariables_in_script which was called: # once (707ms+322ms) by installer::run at line 336 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer.pm
{
25712µs my ( $scriptref, $variablesref ) = @_;
258
25915µs180µs globallog("Replacing variables in setup script (start)");
# spent 80µs making 1 call to installer::logger::globallog
260
261 # make hash of variables to be substituted if they appear in the script
2621600ns my %subs;
263134µs for ( my $j = 0; $j <= $#{$variablesref}; $j++ )
264 {
2652216µs my $variableline = ${$variablesref}[$j];
266
26722260µs22111µs if ( $variableline =~ /^\s*(\%\w+?)\s+(.*?)\s*$/ )
# spent 111µs making 22 calls to installer::setupscript::CORE:match, avg 5µs/call
268 {
269 $subs{$1}= $2;
270 }
271 }
272
273 # This is far faster than running a regexp for each line
27411µs my $bigstring = '';
275129145139ms for my $line (@{$scriptref}) { $bigstring = $bigstring . $line; }
276
277183µs136µs foreach my $key (sort { length ($b) <=> length ($a) } keys %subs)
# spent 36µs making 1 call to installer::setupscript::CORE:sort
278 {
279 # Attention: It must be possible to substitute "%PRODUCTNAMEn", "%PRODUCTNAME%PRODUCTVERSIONabc"
28022100µs my $value = $subs{$key};
28122253ms44252ms $bigstring =~ s/$key/$value/g;
# spent 241ms making 22 calls to installer::setupscript::CORE:subst, avg 11.0ms/call # spent 10.9ms making 22 calls to installer::setupscript::CORE:regcomp, avg 495µs/call
282 }
283
2841100ms my @newlines = split /\n/, $bigstring;
28515µs $scriptref = \@newlines;
286
287 # now check for any mis-named '%' variables that we have left
28812µs my $num = 0;
289191µs for my $check (@newlines)
290 {
29112914344.0ms $num++;
292129143490ms12914368.9ms if ( $check =~ /^.*\%\w+.*$/ )
# spent 68.9ms making 129143 calls to installer::setupscript::CORE:match, avg 534ns/call
293 {
2944591.88ms452475µs if (( $check =~ /%1/ ) || ( $check =~ /%2/ ) || ( $check =~ /%verify/ )) { next; }
# spent 475µs making 452 calls to installer::setupscript::CORE:match, avg 1µs/call
29589134µs my $infoline = "WARNING: mis-named or un-known '%' variable in setup script at line $num:\n$check\n";
29689146µs push( @installer::globals::globallogfileinfo, $infoline);
297 }
298 }
299
30018µs192µs globallog("Replacing variables in setup script (end)");
# spent 92µs making 1 call to installer::logger::globallog
301
302135µs return $scriptref;
303}
304
305#######################################################################
306# Collecting all items of the type "searchitem" from the setup script
307#######################################################################
308
309sub get_all_items_from_script
310
# spent 17.8s (13.4+4.37) within installer::setupscript::get_all_items_from_script which was called 13 times, avg 1.37s/call: # once (2.18s+1.63s) by installer::run at line 466 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer.pm # once (1.26s+578ms) by installer::run at line 447 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer.pm # once (1.06s+361ms) by installer::run at line 372 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer.pm # once (929ms+209ms) by installer::run at line 359 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer.pm # once (901ms+191ms) by installer::run at line 439 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer.pm # once (896ms+179ms) by installer::run at line 453 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer.pm # once (889ms+180ms) by installer::run at line 423 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer.pm # once (890ms+173ms) by installer::run at line 415 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer.pm # once (883ms+177ms) by installer::run at line 419 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer.pm # once (885ms+173ms) by installer::run at line 435 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer.pm # once (881ms+171ms) by installer::run at line 411 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer.pm # once (877ms+173ms) by installer::run at line 400 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer.pm # once (873ms+173ms) by installer::run at line 457 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer.pm
{
3111329µs my ($scriptref, $searchitem) = @_;
312
3131312µs my @allitemarray = ();
314
3151310µs my ($itemkey, $itemvalue);
316
317131.03s for ( my $i = 0; $i <= $#{$scriptref}; $i++ )
318 {
31915578361.00s my $line = ${$scriptref}[$i];
320
321155783610.7s31156722.10s next unless ($line =~ /^\s*\Q$searchitem\E\s+(\S+)\s*$/);
# spent 1.23s making 1557836 calls to installer::setupscript::CORE:regcomp, avg 788ns/call # spent 868ms making 1557836 calls to installer::setupscript::CORE:match, avg 557ns/call
32240544.78ms my $gid = $1;
323
32440542.91ms my %oneitemhash = ();
32540541.96ms my $ismultilang = 0;
326
32740546.78ms $oneitemhash{'gid'} = $gid;
328
329405426.7ms40543.18ms while (!( $line =~ /^\s*End\s*$/ ))
# spent 3.18ms making 4054 calls to installer::setupscript::CORE:match, avg 785ns/call
330 {
33112077390.5ms if ( $i >= $#{$scriptref} ) {
332 installer::exiter::exit_program("Invalid setup script file. End of file reached before 'End' line of '$searchitem' section.", "get_all_items_from_script");
333 }
33412077389.9ms $line = ${$scriptref}[++$i];
335
3361207731.32s243170495ms if ( $line =~ /^\s*(.+?)\=\s*(.+?)\;\s*$/ ) # only oneliner!
# spent 495ms making 243170 calls to installer::setupscript::CORE:match, avg 2µs/call
337 {
338116696119ms $itemkey = $1;
33911669678.6ms $itemvalue = $2;
340
341116696585ms116696224ms $itemkey =~ s/\s+$//;
# spent 224ms making 116696 calls to installer::setupscript::CORE:subst, avg 2µs/call
342116696438ms116696116ms $itemvalue =~ s/\s+$//;
# spent 116ms making 116696 calls to installer::setupscript::CORE:subst, avg 991ns/call
343
344116696323ms1166961.42s installer::remover::remove_leading_and_ending_quotationmarks(\$itemvalue);
# spent 1.42s making 116696 calls to installer::remover::remove_leading_and_ending_quotationmarks, avg 12µs/call
345
346116696179ms $oneitemhash{$itemkey} = $itemvalue;
347
348116696145ms2105215.6ms $ismultilang ||= $itemkey =~ /^\S+\s+\(\S+\)$/;
# spent 15.6ms making 21052 calls to installer::setupscript::CORE:match, avg 740ns/call
349 }
350 elsif (($searchitem eq "Module") &&
351 ($line =~ /^\s*.+?\s*\=\s*\(/) &&
352 (!($line =~ /\)\;\s*$/))) # more than one line, for instance files at modules!
353 {
35423324µs23245µs $line =~ /^\s*(.+?)\s*\=\s*(.+?)\s*$/; # the first line
# spent 245µs making 23 calls to installer::setupscript::CORE:match, avg 11µs/call
3552325µs $itemkey = $1;
3562316µs $itemvalue = $2;
357
358 # collecting the complete itemvalue
359 do
360231.12ms250239µs {
# spent 239µs making 250 calls to installer::setupscript::CORE:match, avg 954ns/call
361250184µs if ( $i >= $#{$scriptref} ) {
362 installer::exiter::exit_program("Invalid setup script file. Premature end of file.", "get_all_items_from_script");
363 }
364250192µs $line = ${$scriptref}[++$i];
365250614µs2502.72ms installer::remover::remove_leading_and_ending_whitespaces(\$line);
# spent 2.72ms making 250 calls to installer::remover::remove_leading_and_ending_whitespaces, avg 11µs/call
366250157µs $itemvalue .= $line;
367 } while (!($line =~ /\)\;\s*$/));
368
369 # removing ending ";"
37023168µs2391µs $itemvalue =~ s/\;\s*$//;
# spent 91µs making 23 calls to installer::setupscript::CORE:subst, avg 4µs/call
371
3722352µs $oneitemhash{$itemkey} = $itemvalue;
373
3742370µs1412µs $ismultilang ||= $itemkey =~ /^\S+\s+\(\S+\)$/;
# spent 12µs making 14 calls to installer::setupscript::CORE:match, avg 836ns/call
375 }
376 }
377
37840544.64ms $oneitemhash{'ismultilingual'} = $ismultilang+0;
379
38040545.19ms push(@allitemarray, \%oneitemhash);
381 }
382
38313246µs return \@allitemarray;
384}
385
386######################################################################
387# Collecting all folder at folderitems, that are predefined values
388# For example: PREDEFINED_AUTOSTART
389######################################################################
390
391sub add_predefined_folder
392
# spent 91µs (77+13) within installer::setupscript::add_predefined_folder which was called: # once (77µs+13µs) by installer::run at line 441 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer.pm
{
39313µs my ( $folderitemref, $folderref ) = @_;
394
3951266µs for my $folderid ( map { $_->{FolderID} } @{$folderitemref} ) {
396 # FIXME: Anchor to start of line?
397840µs814µs next unless ( $folderid =~ /PREDEFINED_/ );
# spent 14µs making 8 calls to installer::setupscript::CORE:match, avg 2µs/call
39814µs next if grep { $_->{gid} eq $folderid } @{$folderref};
399
40018µs push @{$folderref}, {
401 ismultilingual => 0,
402 Name => "",
403 gid => $folderid,
404 };
405 }
406}
407
408#####################################################################################
409# If folderitems are non-advertised, the component needs to have a registry key
410# below HKCU as key path. Therefore it is required, to mark the file belonging
411# to a non-advertised shortcut, that a special userreg_xxx registry key can be
412# created during packing process.
413#####################################################################################
414
415sub prepare_non_advertised_files
416
# spent 1.92ms (150µs+1.77) within installer::setupscript::prepare_non_advertised_files which was called: # once (150µs+1.77ms) by installer::run at line 443 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer.pm
{
41712µs my ( $folderitemref, $filesref ) = @_;
418
419117µs for ( my $i = 0; $i <= $#{$folderitemref}; $i++ )
420 {
42185µs my $folderitem = ${$folderitemref}[$i];
42285µs my $styles = "";
423816µs if ( $folderitem->{'Styles'} ) { $styles = $folderitem->{'Styles'}; }
424
425859µs823µs if ( $styles =~ /\bNON_ADVERTISED\b/ )
# spent 23µs making 8 calls to installer::setupscript::CORE:match, avg 3µs/call
426 {
42788µs my $fileid = $folderitem->{'FileID'};
42886µs if ( $folderitem->{'ComponentIDFile'} ) { $fileid = $folderitem->{'ComponentIDFile'}; }
429825µs81.74ms my $onefile = installer::worker::find_file_by_id($filesref, $fileid);
# spent 1.74ms making 8 calls to installer::worker::find_file_by_id, avg 218µs/call
430
431 # Attention: If $onefile with "FileID" is not found, this is not always an error.
432 # FileID can also contain an executable file, for example msiexec.exe.
433819µs if ( $onefile ne "" ) { $onefile->{'needs_user_registry_key'} = 1; }
434 }
435 }
436}
437
438#####################################################################################
439# Adding all variables defined in the installation object into the hash
440# of all variables from the zip list file.
441# This is needed if variables are defined in the installation object,
442# but not in the zip list file.
443# If there is a definition in the zip list file and in the installation
444# object, the installation object is more important
445#####################################################################################
446
447sub add_installationobject_to_variables
448
# spent 402µs (296+106) within installer::setupscript::add_installationobject_to_variables which was called: # once (296µs+106µs) by installer::run at line 342 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer.pm
{
44915µs my ($allvariables, $allscriptvariablesref) = @_;
450
451146µs for ( my $i = 0; $i <= $#{$allscriptvariablesref}; $i++ )
452 {
4532220µs my $line = ${$allscriptvariablesref}[$i];
454
45522223µs22106µs if ( $line =~ /^\s*\%(\w+)\s+(.*?)\s*$/ )
# spent 106µs making 22 calls to installer::setupscript::CORE:match, avg 5µs/call
456 {
4572230µs my $key = $1;
4582218µs my $value = $2;
459
4602251µs $allvariables->{$key} = $value; # overwrite existing values from zip.lst
461 }
462 }
463}
464
465#####################################################################################
466# Adding all variables, that must be defined, but are not defined until now.
467#####################################################################################
468
469sub add_forced_properties
470
# spent 24µs within installer::setupscript::add_forced_properties which was called: # once (24µs+0s) by installer::run at line 345 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer.pm
{
47112µs my ($allvariables) = @_;
472
47315µs my @forced_properties = qw(
474 SERVICETAG_PRODUCTNAME
475 SERVICETAG_PRODUCTVERSION
476 SERVICETAG_PARENTNAME
477 SERVICETAG_SOURCE
478 SERVICETAG_URN
479 );
480
481111µs for my $property (@forced_properties)
482 {
48359µs if ( ! exists($allvariables->{$property}) ) {
484 $allvariables->{$property} = "";
485 }
486 }
487}
488
489#####################################################################################
490# Some properties are created automatically. It should be possible to
491# overwrite them, with PRESET properties. For example UNIXPRODUCTNAME
492# with PRESETUNIXPRODUCTNAME, if this is defined and the automatic process
493# does not deliver the desired results.
494#####################################################################################
495
496sub replace_preset_properties
497
# spent 20µs within installer::setupscript::replace_preset_properties which was called: # once (20µs+0s) by installer::run at line 348 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer.pm
{
49811µs my ($allvariables) = @_;
499
500 # SOLARISBRANDPACKAGENAME
501 # needs to be replaced by
502 # PRESETSOLARISBRANDPACKAGENAME
503
50411µs my @presetproperties = ();
50512µs push(@presetproperties, "SOLARISBRANDPACKAGENAME");
50611µs push(@presetproperties, "SYSTEMINTUNIXPACKAGENAME");
507
508
509114µs foreach $property ( @presetproperties )
510 {
51124µs my $presetproperty = "PRESET" . $property;
51224µs if (( exists($allvariables->{$presetproperty}) ) && ( $allvariables->{$presetproperty} ne "" ))
513 {
514 $allvariables->{$property} = $allvariables->{$presetproperty};
515 }
516 }
517}
518
519117µs1;
 
# spent 1.45s within installer::setupscript::CORE:match which was called 1956153 times, avg 743ns/call: # 1557836 times (868ms+0s) by installer::setupscript::get_all_items_from_script at line 321, avg 557ns/call # 243170 times (495ms+0s) by installer::setupscript::get_all_items_from_script at line 336, avg 2µs/call # 129143 times (68.9ms+0s) by installer::setupscript::replace_all_setupscriptvariables_in_script at line 292, avg 534ns/call # 21052 times (15.6ms+0s) by installer::setupscript::get_all_items_from_script at line 348, avg 740ns/call # 4054 times (3.18ms+0s) by installer::setupscript::get_all_items_from_script at line 329, avg 785ns/call # 452 times (475µs+0s) by installer::setupscript::replace_all_setupscriptvariables_in_script at line 294, avg 1µs/call # 250 times (239µs+0s) by installer::setupscript::get_all_items_from_script at line 360, avg 954ns/call # 23 times (245µs+0s) by installer::setupscript::get_all_items_from_script at line 354, avg 11µs/call # 22 times (111µs+0s) by installer::setupscript::replace_all_setupscriptvariables_in_script at line 267, avg 5µs/call # 22 times (110µs+0s) by installer::setupscript::resolve_lowercase_productname_setupscriptvariable at line 230, avg 5µs/call # 22 times (109µs+0s) by installer::setupscript::add_lowercase_productname_setupscriptvariable at line 157, avg 5µs/call # 22 times (106µs+0s) by installer::setupscript::add_installationobject_to_variables at line 455, avg 5µs/call # 22 times (15µs+0s) by installer::setupscript::resolve_lowercase_productname_setupscriptvariable at line 242, avg 668ns/call # 14 times (12µs+0s) by installer::setupscript::get_all_items_from_script at line 374, avg 836ns/call # 10 times (44µs+0s) by installer::setupscript::get_all_scriptvariables_from_installation_object at line 113, avg 4µs/call # 10 times (20µs+0s) by installer::setupscript::get_all_scriptvariables_from_installation_object at line 120, avg 2µs/call # 10 times (8µs+0s) by installer::setupscript::get_all_scriptvariables_from_installation_object at line 133, avg 780ns/call # 8 times (23µs+0s) by installer::setupscript::prepare_non_advertised_files at line 425, avg 3µs/call # 8 times (14µs+0s) by installer::setupscript::add_predefined_folder at line 397, avg 2µs/call # once (9µs+0s) by installer::setupscript::get_all_scriptvariables_from_installation_object at line 106 # once (3µs+0s) by installer::setupscript::set_setupscript_name at line 70 # once (1µs+0s) by installer::setupscript::get_all_scriptvariables_from_installation_object at line 111
sub installer::setupscript::CORE:match; # opcode
# spent 1.24s within installer::setupscript::CORE:regcomp which was called 1557859 times, avg 795ns/call: # 1557836 times (1.23s+0s) by installer::setupscript::get_all_items_from_script at line 321, avg 788ns/call # 22 times (10.9ms+0s) by installer::setupscript::replace_all_setupscriptvariables_in_script at line 281, avg 495µs/call # once (26µs+0s) by installer::setupscript::resolve_lowercase_productname_setupscriptvariable at line 245
sub installer::setupscript::CORE:regcomp; # opcode
# spent 36µs within installer::setupscript::CORE:sort which was called: # once (36µs+0s) by installer::setupscript::replace_all_setupscriptvariables_in_script at line 277
sub installer::setupscript::CORE:sort; # opcode
# spent 581ms within installer::setupscript::CORE:subst which was called 233446 times, avg 2µs/call: # 116696 times (224ms+0s) by installer::setupscript::get_all_items_from_script at line 341, avg 2µs/call # 116696 times (116ms+0s) by installer::setupscript::get_all_items_from_script at line 342, avg 991ns/call # 23 times (91µs+0s) by installer::setupscript::get_all_items_from_script at line 370, avg 4µs/call # 22 times (241ms+0s) by installer::setupscript::replace_all_setupscriptvariables_in_script at line 281, avg 11.0ms/call # once (17µs+0s) by installer::setupscript::add_lowercase_productname_setupscriptvariable at line 167 # once (7µs+0s) by installer::setupscript::add_lowercase_productname_setupscriptvariable at line 173 # once (4µs+0s) by installer::setupscript::add_lowercase_productname_setupscriptvariable at line 204 # once (4µs+0s) by installer::setupscript::add_lowercase_productname_setupscriptvariable at line 174 # once (3µs+0s) by installer::setupscript::resolve_lowercase_productname_setupscriptvariable at line 245 # once (2µs+0s) by installer::setupscript::add_lowercase_productname_setupscriptvariable at line 179 # once (1µs+0s) by installer::setupscript::add_lowercase_productname_setupscriptvariable at line 188 # once (1µs+0s) by installer::setupscript::add_lowercase_productname_setupscriptvariable at line 175 # once (500ns+0s) by installer::setupscript::add_lowercase_productname_setupscriptvariable at line 187
sub installer::setupscript::CORE:subst; # opcode
# spent 3µs within installer::setupscript::CORE:substcont which was called 2 times, avg 2µs/call: # 2 times (3µs+0s) by installer::setupscript::resolve_lowercase_productname_setupscriptvariable at line 245, avg 2µs/call
sub installer::setupscript::CORE:substcont; # opcode