← 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:33 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
{
59834µs my ( $allsettingsarrayref, $includepatharrayref ) = @_;
60
61190µs my $scriptnameref = installer::ziplist::getinfofromziplist($allsettingsarrayref, "script");
# spent 90µs making 1 call to installer::ziplist::getinfofromziplist
62
63 my $scriptname = $$scriptnameref;
64
65 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
7013µ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
82124µs $scriptnameref = installer::scriptitems::get_sourcepath_from_filename_and_includepath(\$scriptname, $includepatharrayref, 1);
83
84 $installer::globals::setupscriptname = $$scriptnameref;
85
86 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
{
98100303µs my ($scriptref) = @_;
99
100 my @installobjectvariables;
101
102 for ( my $i = 0; $i <= $#{$scriptref}; $i++ )
103 {
104 my $line = ${$scriptref}[$i];
105
10619µ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 {
108 my $counter = $i+1;
109 my $installline = ${$scriptref}[$counter];
110
11111µs while (!($installline =~ /^\s*End\s*$/ ))
# spent 1µs making 1 call to installer::setupscript::CORE:match
112 {
1131044µ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 {
115 my $key = $1;
116 my $value = $2;
117
118 # removing leading and ending " in $value
119
1201020µ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
125 $key = "\%" . uc($key); # $key is %PRODUCTNAME
126
127 my $input = $key . " " . $value . "\n"; # $key can only be the first word
128
129 push(@installobjectvariables ,$input);
130 }
131
132 $counter++;
133108µs $installline = ${$scriptref}[$counter];
# spent 8µs making 10 calls to installer::setupscript::CORE:match, avg 780ns/call
134 }
135 }
136
137 last; # not interesting after installation object
138 }
139
140 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
{
149171445µs my ( $variablesref ) = @_;
150
151 for ( my $j = 0; $j <= $#{$variablesref}; $j++ )
152 {
153 my $variableline = ${$variablesref}[$j];
154
155 my ($key, $value);
156
15722109µs if ( $variableline =~ /^\s*\%(\w+?)\s+(.*?)\s*$/ )
# spent 109µs making 22 calls to installer::setupscript::CORE:match, avg 5µs/call
158 {
159 $key = $1;
160 $value = $2;
161
162 if ( $key eq "PRODUCTNAME" )
163 {
164 my $newline = "\%LCPRODUCTNAME " . lc($value) . "\n";
165 push(@{$variablesref} ,$newline);
166 my $original = $value;
167117µs $value =~ s/\s*//g;
# spent 17µs making 1 call to installer::setupscript::CORE:subst
168 $newline = "\%ONEWORDPRODUCTNAME " . $value . "\n";
169 push(@{$variablesref} ,$newline);
170 $newline = "\%LCONEWORDPRODUCTNAME " . lc($value) . "\n";
171 push(@{$variablesref} ,$newline);
172 $value = $original;
17317µs $value =~ s/\s*$//g;
# spent 7µs making 1 call to installer::setupscript::CORE:subst
17414µs $value =~ s/^\s*//g;
# spent 4µs making 1 call to installer::setupscript::CORE:subst
17511µs $value =~ s/ /\%20/g;
# spent 1µs making 1 call to installer::setupscript::CORE:subst
176 $newline = "\%MASKEDPRODUCTNAME " . $value . "\n";
177 push(@{$variablesref} ,$newline);
178 $value = $original;
17912µs $value =~ s/\s/\_/g;
# spent 2µs making 1 call to installer::setupscript::CORE:subst
180 $newline = "\%UNIXPRODUCTNAME " . lc($value) . "\n";
181 push(@{$variablesref} ,$newline);
182 $newline = "\%SYSTEMINTUNIXPACKAGENAME " . lc($value) . "\n";
183 push(@{$variablesref} ,$newline);
184 $newline = "\%UNIXPACKAGENAME " . lc($value) . "\n";
185 push(@{$variablesref} ,$newline);
186 $value = $original;
1871500ns $value =~ s/\s/\_/g;
# spent 500ns making 1 call to installer::setupscript::CORE:subst
18811µs $value =~ s/\.//g;
# spent 1µs making 1 call to installer::setupscript::CORE:subst
189 $newline = "\%WITHOUTDOTUNIXPRODUCTNAME " . lc($value) . "\n";
190 push(@{$variablesref} ,$newline);
191 $newline = "\%WITHOUTDOTUNIXPACKAGENAME " . lc($value) . "\n";
192 push(@{$variablesref} ,$newline);
193 $newline = "\%SOLARISBRANDPACKAGENAME " . lc($value) . "\n";
194 push(@{$variablesref} ,$newline);
195 $value = $original;
196 }
197 elsif ( $key eq "PRODUCTEXTENSION" )
198 {
199 my $newline = "\%LCPRODUCTEXTENSION " . lc($value) . "\n";
200 push(@{$variablesref} ,$newline);
201 }
202 elsif ( $key eq "PRODUCTVERSION" )
203 {
20414µs $value =~ s/\.//g;
# spent 4µs making 1 call to installer::setupscript::CORE:subst
205 my $newline = "\%WITHOUTDOTPRODUCTVERSION " . $value . "\n";
206 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
{
218160553µs my ( $variablesref ) = @_;
219
220 my %variables = ();
221
222 # First step: Collecting variables
223
224 for ( my $j = 0; $j <= $#{$variablesref}; $j++ )
225 {
226 my $variableline = ${$variablesref}[$j];
227
228 my ($key, $value);
229
23022110µs if ( $variableline =~ /^\s*\%(\w+?)\s+(.*?)\s*$/ )
# spent 110µs making 22 calls to installer::setupscript::CORE:match, avg 5µs/call
231 {
232 $key = $1;
233 $value = $2;
234 $variables{$key} = $value;
235 }
236 }
237
238 # Second step: Resolving variables
239
240 for ( my $j = 0; $j <= $#{$variablesref}; $j++ )
241 {
2422215µs if ( ${$variablesref}[$j] =~ /\$\{(.*?)\}/ )
# spent 15µs making 22 calls to installer::setupscript::CORE:match, avg 668ns/call
243 {
244 my $key = $1;
245432µ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
{
2573881681.03s my ( $scriptref, $variablesref ) = @_;
258
259180µ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
262 my %subs;
263 for ( my $j = 0; $j <= $#{$variablesref}; $j++ )
264 {
265 my $variableline = ${$variablesref}[$j];
266
26722111µ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
274 my $bigstring = '';
275 for my $line (@{$scriptref}) { $bigstring = $bigstring . $line; }
276
277136µ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"
280 my $value = $subs{$key};
28144252ms $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
284 my @newlines = split /\n/, $bigstring;
285 $scriptref = \@newlines;
286
287 # now check for any mis-named '%' variables that we have left
288 my $num = 0;
289 for my $check (@newlines)
290 {
291 $num++;
29212914368.9ms if ( $check =~ /^.*\%\w+.*$/ )
# spent 68.9ms making 129143 calls to installer::setupscript::CORE:match, avg 534ns/call
293 {
294452475µs if (( $check =~ /%1/ ) || ( $check =~ /%2/ ) || ( $check =~ /%verify/ )) { next; }
# spent 475µs making 452 calls to installer::setupscript::CORE:match, avg 1µs/call
295 my $infoline = "WARNING: mis-named or un-known '%' variable in setup script at line $num:\n$check\n";
296 push( @installer::globals::globallogfileinfo, $infoline);
297 }
298 }
299
300192µs globallog("Replacing variables in setup script (end)");
# spent 92µs making 1 call to installer::logger::globallog
301
302 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
{
311432446716.2s my ($scriptref, $searchitem) = @_;
312
313 my @allitemarray = ();
314
315 my ($itemkey, $itemvalue);
316
317 for ( my $i = 0; $i <= $#{$scriptref}; $i++ )
318 {
319 my $line = ${$scriptref}[$i];
320
32131156722.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
322 my $gid = $1;
323
324 my %oneitemhash = ();
325 my $ismultilang = 0;
326
327 $oneitemhash{'gid'} = $gid;
328
32940543.18ms while (!( $line =~ /^\s*End\s*$/ ))
# spent 3.18ms making 4054 calls to installer::setupscript::CORE:match, avg 785ns/call
330 {
331 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 }
334 $line = ${$scriptref}[++$i];
335
336243170495ms if ( $line =~ /^\s*(.+?)\=\s*(.+?)\;\s*$/ ) # only oneliner!
# spent 495ms making 243170 calls to installer::setupscript::CORE:match, avg 2µs/call
337 {
338 $itemkey = $1;
339 $itemvalue = $2;
340
341116696224ms $itemkey =~ s/\s+$//;
# spent 224ms making 116696 calls to installer::setupscript::CORE:subst, avg 2µs/call
342116696116ms $itemvalue =~ s/\s+$//;
# spent 116ms making 116696 calls to installer::setupscript::CORE:subst, avg 991ns/call
343
3441166961.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
346 $oneitemhash{$itemkey} = $itemvalue;
347
3482105215.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 {
35423245µs $line =~ /^\s*(.+?)\s*\=\s*(.+?)\s*$/; # the first line
# spent 245µs making 23 calls to installer::setupscript::CORE:match, avg 11µs/call
355 $itemkey = $1;
356 $itemvalue = $2;
357
358 # collecting the complete itemvalue
359 do
360250239µs {
# spent 239µs making 250 calls to installer::setupscript::CORE:match, avg 954ns/call
361 if ( $i >= $#{$scriptref} ) {
362 installer::exiter::exit_program("Invalid setup script file. Premature end of file.", "get_all_items_from_script");
363 }
364 $line = ${$scriptref}[++$i];
3652502.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
366 $itemvalue .= $line;
367 } while (!($line =~ /\)\;\s*$/));
368
369 # removing ending ";"
3702391µs $itemvalue =~ s/\;\s*$//;
# spent 91µs making 23 calls to installer::setupscript::CORE:subst, avg 4µs/call
371
372 $oneitemhash{$itemkey} = $itemvalue;
373
3741412µs $ismultilang ||= $itemkey =~ /^\S+\s+\(\S+\)$/;
# spent 12µs making 14 calls to installer::setupscript::CORE:match, avg 836ns/call
375 }
376 }
377
378 $oneitemhash{'ismultilingual'} = $ismultilang+0;
379
380 push(@allitemarray, \%oneitemhash);
381 }
382
383 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
{
39312322µs my ( $folderitemref, $folderref ) = @_;
394
395 for my $folderid ( map { $_->{FolderID} } @{$folderitemref} ) {
396 # FIXME: Anchor to start of line?
397814µs next unless ( $folderid =~ /PREDEFINED_/ );
# spent 14µs making 8 calls to installer::setupscript::CORE:match, avg 2µs/call
398 next if grep { $_->{gid} eq $folderid } @{$folderref};
399
400 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
{
41766162µs my ( $folderitemref, $filesref ) = @_;
418
419 for ( my $i = 0; $i <= $#{$folderitemref}; $i++ )
420 {
421 my $folderitem = ${$folderitemref}[$i];
422 my $styles = "";
423 if ( $folderitem->{'Styles'} ) { $styles = $folderitem->{'Styles'}; }
424
425823µs if ( $styles =~ /\bNON_ADVERTISED\b/ )
# spent 23µs making 8 calls to installer::setupscript::CORE:match, avg 3µs/call
426 {
427 my $fileid = $folderitem->{'FileID'};
428 if ( $folderitem->{'ComponentIDFile'} ) { $fileid = $folderitem->{'ComponentIDFile'}; }
42981.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.
433 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
{
449112392µs my ($allvariables, $allscriptvariablesref) = @_;
450
451 for ( my $i = 0; $i <= $#{$allscriptvariablesref}; $i++ )
452 {
453 my $line = ${$allscriptvariablesref}[$i];
454
45522106µs if ( $line =~ /^\s*\%(\w+)\s+(.*?)\s*$/ )
# spent 106µs making 22 calls to installer::setupscript::CORE:match, avg 5µs/call
456 {
457 my $key = $1;
458 my $value = $2;
459
460 $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
{
471827µs my ($allvariables) = @_;
472
473 my @forced_properties = qw(
474 SERVICETAG_PRODUCTNAME
475 SERVICETAG_PRODUCTVERSION
476 SERVICETAG_PARENTNAME
477 SERVICETAG_SOURCE
478 SERVICETAG_URN
479 );
480
481 for my $property (@forced_properties)
482 {
483 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
{
498927µs my ($allvariables) = @_;
499
500 # SOLARISBRANDPACKAGENAME
501 # needs to be replaced by
502 # PRESETSOLARISBRANDPACKAGENAME
503
504 my @presetproperties = ();
505 push(@presetproperties, "SOLARISBRANDPACKAGENAME");
506 push(@presetproperties, "SYSTEMINTUNIXPACKAGENAME");
507
508
509 foreach $property ( @presetproperties )
510 {
511 my $presetproperty = "PRESET" . $property;
512 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