Filename | /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer/windows/component.pm |
Statements | Executed 833070569 statements in 837s |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
9703 | 2 | 2 | 292s | 293s | get_file_component_directory | installer::windows::component::
9060 | 2 | 1 | 272s | 272s | get_component_keypath | installer::windows::component::
9015 | 1 | 1 | 271s | 271s | get_file_component_attributes | installer::windows::component::
9015 | 1 | 1 | 148ms | 148ms | get_file_component_condition | installer::windows::component::
9060 | 2 | 1 | 129ms | 129ms | get_component_guid | installer::windows::component::
27778 | 4 | 1 | 128ms | 128ms | CORE:match (opcode) | installer::windows::component::
9648 | 1 | 1 | 71.0ms | 71.0ms | CORE:subst (opcode) | installer::windows::component::
109 | 1 | 1 | 21.9ms | 21.9ms | CORE:ftfile (opcode) | installer::windows::component::
9648 | 1 | 1 | 12.4ms | 12.4ms | CORE:regcomp (opcode) | installer::windows::component::
109 | 1 | 1 | 2.22ms | 24.1ms | set_component_in_environment_table | installer::windows::component::
45 | 1 | 1 | 554µs | 741µs | get_registry_component_attributes | installer::windows::component::
45 | 1 | 1 | 386µs | 386µs | get_component_condition | installer::windows::component::
1 | 1 | 1 | 359µs | 362µs | BEGIN@30 | installer::windows::component::
45 | 1 | 1 | 197µs | 197µs | get_registry_component_directory | installer::windows::component::
1 | 1 | 1 | 19µs | 22µs | BEGIN@32 | installer::windows::component::
1 | 1 | 1 | 14µs | 17µs | BEGIN@31 | installer::windows::component::
1 | 1 | 1 | 14µs | 17µs | BEGIN@34 | installer::windows::component::
1 | 1 | 1 | 14µs | 16µs | BEGIN@33 | installer::windows::component::
0 | 0 | 0 | 0s | 0s | get_component_name_from_modulegid | installer::windows::component::
1 | 1 | 1 | -2576s | -1757s | create_component_table | installer::windows::component::
Line | State ments |
Time on line |
Calls | Time in subs |
Code |
---|---|---|---|---|---|
1 | #************************************************************************* | ||||
2 | # | ||||
3 | # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. | ||||
4 | # | ||||
5 | # Copyright 2000, 2010 Oracle and/or its affiliates. | ||||
6 | # | ||||
7 | # OpenOffice.org - a multi-platform office productivity suite | ||||
8 | # | ||||
9 | # This file is part of OpenOffice.org. | ||||
10 | # | ||||
11 | # OpenOffice.org is free software: you can redistribute it and/or modify | ||||
12 | # it under the terms of the GNU Lesser General Public License version 3 | ||||
13 | # only, as published by the Free Software Foundation. | ||||
14 | # | ||||
15 | # OpenOffice.org is distributed in the hope that it will be useful, | ||||
16 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||||
17 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||||
18 | # GNU Lesser General Public License version 3 for more details | ||||
19 | # (a copy is included in the LICENSE file that accompanied this code). | ||||
20 | # | ||||
21 | # You should have received a copy of the GNU Lesser General Public License | ||||
22 | # version 3 along with OpenOffice.org. If not, see | ||||
23 | # <http://www.openoffice.org/license.html> | ||||
24 | # for a copy of the LGPLv3 License. | ||||
25 | # | ||||
26 | #************************************************************************* | ||||
27 | |||||
28 | package installer::windows::component; | ||||
29 | |||||
30 | 2 | 62µs | 2 | 365µs | # spent 362µs (359+3) within installer::windows::component::BEGIN@30 which was called:
# once (359µs+3µs) by installer::BEGIN@63 at line 30 # spent 362µs making 1 call to installer::windows::component::BEGIN@30
# spent 3µs making 1 call to UNIVERSAL::import |
31 | 2 | 56µs | 2 | 20µs | # spent 17µs (14+3) within installer::windows::component::BEGIN@31 which was called:
# once (14µs+3µs) by installer::BEGIN@63 at line 31 # spent 17µs making 1 call to installer::windows::component::BEGIN@31
# spent 3µs making 1 call to UNIVERSAL::import |
32 | 2 | 54µs | 2 | 24µs | # spent 22µs (19+3) within installer::windows::component::BEGIN@32 which was called:
# once (19µs+3µs) by installer::BEGIN@63 at line 32 # spent 22µs making 1 call to installer::windows::component::BEGIN@32
# spent 3µs making 1 call to UNIVERSAL::import |
33 | 2 | 58µs | 2 | 19µs | # spent 16µs (14+3) within installer::windows::component::BEGIN@33 which was called:
# once (14µs+3µs) by installer::BEGIN@63 at line 33 # spent 16µs making 1 call to installer::windows::component::BEGIN@33
# spent 2µs making 1 call to UNIVERSAL::import |
34 | 2 | 3.84ms | 2 | 20µs | # spent 17µs (14+3) within installer::windows::component::BEGIN@34 which was called:
# once (14µs+3µs) by installer::BEGIN@63 at line 34 # spent 17µs making 1 call to installer::windows::component::BEGIN@34
# spent 3µs making 1 call to UNIVERSAL::import |
35 | |||||
36 | ############################################################## | ||||
37 | # Returning a globally unique ID (GUID) for a component | ||||
38 | # If the component is new, a unique guid has to be created. | ||||
39 | # If the component already exists, the guid has to be | ||||
40 | # taken from a list component <-> guid | ||||
41 | # Sample for a guid: {B68FD953-3CEF-4489-8269-8726848056E8} | ||||
42 | ############################################################## | ||||
43 | |||||
44 | sub get_component_guid | ||||
45 | # spent 129ms within installer::windows::component::get_component_guid which was called 9060 times, avg 14µs/call:
# 9015 times (128ms+0s) by installer::windows::component::create_component_table at line 399, avg 14µs/call
# 45 times (490µs+0s) by installer::windows::component::create_component_table at line 419, avg 11µs/call | ||||
46 | 45300 | 132ms | my ( $componentname, $componentidhashref ) = @_; | ||
47 | |||||
48 | # At this time only a template | ||||
49 | my $returnvalue = "\{COMPONENTGUID\}"; | ||||
50 | |||||
51 | if (( $installer::globals::updatedatabase ) && ( exists($componentidhashref->{$componentname}) )) | ||||
52 | { | ||||
53 | $returnvalue = $componentidhashref->{$componentname}; | ||||
54 | } | ||||
55 | |||||
56 | # Returning a ComponentID, that is assigned in scp project | ||||
57 | if ( exists($installer::globals::componentid{$componentname}) ) | ||||
58 | { | ||||
59 | $returnvalue = "\{" . $installer::globals::componentid{$componentname} . "\}"; | ||||
60 | } | ||||
61 | |||||
62 | return $returnvalue; | ||||
63 | } | ||||
64 | |||||
65 | ############################################################## | ||||
66 | # Returning the directory for a file component. | ||||
67 | ############################################################## | ||||
68 | |||||
69 | sub get_file_component_directory | ||||
70 | # spent 293s (292+779ms) within installer::windows::component::get_file_component_directory which was called 9703 times, avg 30.2ms/call:
# 9015 times (275s+727ms) by installer::windows::component::create_component_table at line 400, avg 30.6ms/call
# 688 times (17.3s+52.7ms) by installer::windows::file::create_files_table at line 932 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer/windows/file.pm, avg 25.2ms/call | ||||
71 | 294560629 | 292s | my ($componentname, $filesref, $dirref) = @_; | ||
72 | |||||
73 | my ($onefile, $component, $onedir, $hostname, $uniquedir); | ||||
74 | my $found = 0; | ||||
75 | |||||
76 | for ( my $i = 0; $i <= $#{$filesref}; $i++ ) | ||||
77 | { | ||||
78 | $onefile = ${$filesref}[$i]; | ||||
79 | $component = $onefile->{'componentname'}; | ||||
80 | |||||
81 | if ( $component eq $componentname ) | ||||
82 | { | ||||
83 | $found = 1; | ||||
84 | last; | ||||
85 | } | ||||
86 | } | ||||
87 | |||||
88 | if (!($found)) | ||||
89 | { | ||||
90 | # This component can be ignored, if it exists in a version with extension "_pff" (this was renamed in file::get_sequence_for_file() ) | ||||
91 | my $ignore_this_component = 0; | ||||
92 | my $origcomponentname = $componentname; | ||||
93 | my $componentname = $componentname . "_pff"; | ||||
94 | |||||
95 | for ( my $j = 0; $j <= $#{$filesref}; $j++ ) | ||||
96 | { | ||||
97 | $onefile = ${$filesref}[$j]; | ||||
98 | $component = $onefile->{'componentname'}; | ||||
99 | |||||
100 | if ( $component eq $componentname ) | ||||
101 | { | ||||
102 | $ignore_this_component = 1; | ||||
103 | last; | ||||
104 | } | ||||
105 | } | ||||
106 | |||||
107 | if ( $ignore_this_component ) { return "IGNORE_COMP"; } | ||||
108 | else { installer::exiter::exit_program("ERROR: Did not find component \"$origcomponentname\" in file collection", "get_file_component_directory"); } | ||||
109 | } | ||||
110 | |||||
111 | my $localstyles = ""; | ||||
112 | |||||
113 | if ( $onefile->{'Styles'} ) { $localstyles = $onefile->{'Styles'}; } | ||||
114 | |||||
115 | 9703 | 64.5ms | if ( $localstyles =~ /\bFONT\b/ ) # special handling for font files # spent 64.5ms making 9703 calls to installer::windows::component::CORE:match, avg 7µs/call | ||
116 | { | ||||
117 | return $installer::globals::fontsfolder; | ||||
118 | } | ||||
119 | |||||
120 | my $destdir = ""; | ||||
121 | |||||
122 | if ( $onefile->{'Dir'} ) { $destdir = $onefile->{'Dir'}; } | ||||
123 | |||||
124 | my $destination = $onefile->{'destination'}; | ||||
125 | |||||
126 | 9648 | 631ms | installer::pathanalyzer::get_path_from_fullqualifiedname(\$destination); # spent 631ms making 9648 calls to installer::pathanalyzer::get_path_from_fullqualifiedname, avg 65µs/call | ||
127 | |||||
128 | 19296 | 83.4ms | $destination =~ s/\Q$installer::globals::separator\E\s*$//; # spent 71.0ms making 9648 calls to installer::windows::component::CORE:subst, avg 7µs/call
# spent 12.4ms making 9648 calls to installer::windows::component::CORE:regcomp, avg 1µs/call | ||
129 | |||||
130 | # This path has to be defined in the directory collection at "HostName" | ||||
131 | |||||
132 | if ($destination eq "") # files in the installation root | ||||
133 | { | ||||
134 | $uniquedir = "INSTALLLOCATION"; | ||||
135 | } | ||||
136 | else | ||||
137 | { | ||||
138 | $found = 0; | ||||
139 | |||||
140 | for ( my $i = 0; $i <= $#{$dirref}; $i++ ) | ||||
141 | { | ||||
142 | $onedir = ${$dirref}[$i]; | ||||
143 | $hostname = $onedir->{'HostName'}; | ||||
144 | |||||
145 | if ( $hostname eq $destination ) | ||||
146 | { | ||||
147 | $found = 1; | ||||
148 | last; | ||||
149 | } | ||||
150 | } | ||||
151 | |||||
152 | if (!($found)) | ||||
153 | { | ||||
154 | installer::exiter::exit_program("ERROR: Did not find destination $destination in directory collection", "get_file_component_directory"); | ||||
155 | } | ||||
156 | |||||
157 | $uniquedir = $onedir->{'uniquename'}; | ||||
158 | |||||
159 | if ( $uniquedir eq $installer::globals::officeinstalldirectory ) | ||||
160 | { | ||||
161 | $uniquedir = "INSTALLLOCATION"; | ||||
162 | } | ||||
163 | } | ||||
164 | |||||
165 | $onefile->{'uniquedirname'} = $uniquedir; # saving it in the file collection | ||||
166 | |||||
167 | return $uniquedir | ||||
168 | } | ||||
169 | |||||
170 | ############################################################## | ||||
171 | # Returning the directory for a registry component. | ||||
172 | # This cannot be a useful value | ||||
173 | ############################################################## | ||||
174 | |||||
175 | sub get_registry_component_directory | ||||
176 | # spent 197µs within installer::windows::component::get_registry_component_directory which was called 45 times, avg 4µs/call:
# 45 times (197µs+0s) by installer::windows::component::create_component_table at line 420, avg 4µs/call | ||||
177 | 90 | 286µs | my $componentdir = "INSTALLLOCATION"; | ||
178 | |||||
179 | return $componentdir; | ||||
180 | } | ||||
181 | |||||
182 | ############################################################## | ||||
183 | # Returning the attributes for a file component. | ||||
184 | ############################################################## | ||||
185 | |||||
186 | sub get_file_component_attributes | ||||
187 | # spent 271s (271+63.5ms) within installer::windows::component::get_file_component_attributes which was called 9015 times, avg 30.1ms/call:
# 9015 times (271s+63.5ms) by installer::windows::component::create_component_table at line 402, avg 30.1ms/call | ||||
188 | 268382940 | 271s | my ($componentname, $filesref, $allvariables) = @_; | ||
189 | |||||
190 | my $attributes; | ||||
191 | |||||
192 | $attributes = 2; | ||||
193 | |||||
194 | # special handling for font files | ||||
195 | |||||
196 | my $onefile; | ||||
197 | my $found = 0; | ||||
198 | |||||
199 | for ( my $i = 0; $i <= $#{$filesref}; $i++ ) | ||||
200 | { | ||||
201 | $onefile = ${$filesref}[$i]; | ||||
202 | my $component = $onefile->{'componentname'}; | ||||
203 | |||||
204 | if ( $component eq $componentname ) | ||||
205 | { | ||||
206 | $found = 1; | ||||
207 | last; | ||||
208 | } | ||||
209 | } | ||||
210 | |||||
211 | if (!($found)) | ||||
212 | { | ||||
213 | installer::exiter::exit_program("ERROR: Did not find component in file collection", "get_file_component_attributes"); | ||||
214 | } | ||||
215 | |||||
216 | my $localstyles = ""; | ||||
217 | |||||
218 | if ( $onefile->{'Styles'} ) { $localstyles = $onefile->{'Styles'}; } | ||||
219 | |||||
220 | 9015 | 55.8ms | if ( $localstyles =~ /\bFONT\b/ ) # spent 55.8ms making 9015 calls to installer::windows::component::CORE:match, avg 6µs/call | ||
221 | { | ||||
222 | $attributes = 16; # font files will not be deinstalled | ||||
223 | } | ||||
224 | |||||
225 | 9015 | 7.67ms | if ( $localstyles =~ /\bASSEMBLY\b/ ) # spent 7.67ms making 9015 calls to installer::windows::component::CORE:match, avg 851ns/call | ||
226 | { | ||||
227 | $attributes = 0; # Assembly files cannot run from source | ||||
228 | } | ||||
229 | |||||
230 | if ( $onefile->{'needs_user_registry_key'} ) | ||||
231 | { | ||||
232 | $attributes = 4; # Files in non advertised startmenu entries must have user registry key as KeyPath | ||||
233 | } | ||||
234 | |||||
235 | # Setting msidbComponentAttributes64bit, if this is a 64 bit installation set. | ||||
236 | if (( $allvariables->{'64BITPRODUCT'} ) && ( $allvariables->{'64BITPRODUCT'} == 1 )) { $attributes |= 256; } | ||||
237 | |||||
238 | return $attributes; | ||||
239 | } | ||||
240 | |||||
241 | ############################################################## | ||||
242 | # Returning the attributes for a registry component. | ||||
243 | # Always 4, indicating, the keypath is a defined in | ||||
244 | # table registry | ||||
245 | ############################################################## | ||||
246 | |||||
247 | sub get_registry_component_attributes | ||||
248 | # spent 741µs (554+186) within installer::windows::component::get_registry_component_attributes which was called 45 times, avg 16µs/call:
# 45 times (554µs+186µs) by installer::windows::component::create_component_table at line 421, avg 16µs/call | ||||
249 | 315 | 824µs | my ($componentname, $allvariables) = @_; | ||
250 | |||||
251 | my $attributes; | ||||
252 | |||||
253 | $attributes = 4; | ||||
254 | |||||
255 | # Setting msidbComponentAttributes64bit, if this is a 64 bit installation set. | ||||
256 | if (( $allvariables->{'64BITPRODUCT'} ) && ( $allvariables->{'64BITPRODUCT'} == 1 )) { $attributes |= 256; } | ||||
257 | |||||
258 | # Setting msidbComponentAttributes64bit for 64 bit shell extension in 32 bit installer, too | ||||
259 | 45 | 186µs | if ( $componentname =~ m/winexplorerext_x64/ ) { $attributes |= 256; } # spent 186µs making 45 calls to installer::windows::component::CORE:match, avg 4µs/call | ||
260 | |||||
261 | # Setting msidbComponentAttributesPermanent | ||||
262 | if ( exists($installer::globals::dontdeletecomponents{$componentname}) ) { $attributes |= 16; } | ||||
263 | |||||
264 | return $attributes; | ||||
265 | } | ||||
266 | |||||
267 | ############################################################## | ||||
268 | # Returning the conditions for a component. | ||||
269 | # This is important for language dependent components | ||||
270 | # in multilingual installation sets. | ||||
271 | ############################################################## | ||||
272 | |||||
273 | sub get_file_component_condition | ||||
274 | # spent 148ms within installer::windows::component::get_file_component_condition which was called 9015 times, avg 16µs/call:
# 9015 times (148ms+0s) by installer::windows::component::create_component_table at line 403, avg 16µs/call | ||||
275 | 45075 | 143ms | my ($componentname, $filesref) = @_; | ||
276 | |||||
277 | my $condition = ""; | ||||
278 | |||||
279 | if (exists($installer::globals::componentcondition{$componentname})) | ||||
280 | { | ||||
281 | $condition = $installer::globals::componentcondition{$componentname}; | ||||
282 | } | ||||
283 | |||||
284 | # there can be also tree conditions for multilayer products | ||||
285 | if (exists($installer::globals::treeconditions{$componentname})) | ||||
286 | { | ||||
287 | if ( $condition eq "" ) | ||||
288 | { | ||||
289 | $condition = $installer::globals::treeconditions{$componentname}; | ||||
290 | } | ||||
291 | else | ||||
292 | { | ||||
293 | $condition = "($condition) And ($installer::globals::treeconditions{$componentname})"; | ||||
294 | } | ||||
295 | } | ||||
296 | |||||
297 | return $condition | ||||
298 | } | ||||
299 | |||||
300 | ############################################################## | ||||
301 | # Returning the conditions for a registry component. | ||||
302 | ############################################################## | ||||
303 | |||||
304 | sub get_component_condition | ||||
305 | # spent 386µs within installer::windows::component::get_component_condition which was called 45 times, avg 9µs/call:
# 45 times (386µs+0s) by installer::windows::component::create_component_table at line 422, avg 9µs/call | ||||
306 | 225 | 483µs | my ($componentname) = @_; | ||
307 | |||||
308 | my $condition; | ||||
309 | |||||
310 | $condition = ""; # Always ? | ||||
311 | |||||
312 | if (exists($installer::globals::componentcondition{$componentname})) | ||||
313 | { | ||||
314 | $condition = $installer::globals::componentcondition{$componentname}; | ||||
315 | } | ||||
316 | |||||
317 | return $condition | ||||
318 | } | ||||
319 | |||||
320 | #################################################################### | ||||
321 | # Returning the keypath for a component. | ||||
322 | # This will be the name of the first file/registry, found in the | ||||
323 | # collection $itemsref | ||||
324 | # Attention: This has to be the unique (file)name, not the | ||||
325 | # real filename! | ||||
326 | #################################################################### | ||||
327 | |||||
328 | sub get_component_keypath | ||||
329 | # spent 272s within installer::windows::component::get_component_keypath which was called 9060 times, avg 30.0ms/call:
# 9015 times (270s+0s) by installer::windows::component::create_component_table at line 404, avg 30.0ms/call
# 45 times (1.64s+0s) by installer::windows::component::create_component_table at line 423, avg 36.4ms/call | ||||
330 | 269944983 | 272s | my ($componentname, $itemsref, $componentidkeypathhashref) = @_; | ||
331 | |||||
332 | my $oneitem; | ||||
333 | my $found = 0; | ||||
334 | my $infoline = ""; | ||||
335 | |||||
336 | for ( my $i = 0; $i <= $#{$itemsref}; $i++ ) | ||||
337 | { | ||||
338 | $oneitem = ${$itemsref}[$i]; | ||||
339 | my $component = $oneitem->{'componentname'}; | ||||
340 | |||||
341 | if ( $component eq $componentname ) | ||||
342 | { | ||||
343 | $found = 1; | ||||
344 | last; | ||||
345 | } | ||||
346 | } | ||||
347 | |||||
348 | if (!($found)) | ||||
349 | { | ||||
350 | installer::exiter::exit_program("ERROR: Did not find component in file/registry collection, function get_component_keypath", "get_component_keypath"); | ||||
351 | } | ||||
352 | |||||
353 | my $keypath = $oneitem->{'uniquename'}; # "uniquename", not "Name" | ||||
354 | |||||
355 | # Special handling for updates from existing databases, because KeyPath must not change | ||||
356 | if (( $installer::globals::updatedatabase ) && ( exists($componentidkeypathhashref->{$componentname}) )) | ||||
357 | { | ||||
358 | $keypath = $componentidkeypathhashref->{$componentname}; | ||||
359 | # -> check, if this is a valid key path?! | ||||
360 | if ( $keypath ne $oneitem->{'uniquename'} ) | ||||
361 | { | ||||
362 | # Warning: This keypath was changed because of info from old database | ||||
363 | $infoline = "WARNING: The KeyPath for component \"$componentname\" was changed from \"$oneitem->{'uniquename'}\" to \"$keypath\" because of information from update database"; | ||||
364 | push(@installer::globals::logfileinfo, $infoline); | ||||
365 | } | ||||
366 | } | ||||
367 | |||||
368 | if ( $oneitem->{'userregkeypath'} ) { $keypath = $oneitem->{'userregkeypath'}; } | ||||
369 | |||||
370 | # saving it in the file and registry collection | ||||
371 | $oneitem->{'keypath'} = $keypath; | ||||
372 | |||||
373 | return $keypath | ||||
374 | } | ||||
375 | |||||
376 | ################################################################### | ||||
377 | # Creating the file Componen.idt dynamically | ||||
378 | # Content: | ||||
379 | # Component ComponentId Directory_ Attributes Condition KeyPath | ||||
380 | ################################################################### | ||||
381 | |||||
382 | sub create_component_table | ||||
383 | # spent -1757s (-2576+819) within installer::windows::component::create_component_table which was called:
# once (-2576s+819s) by installer::run at line 1502 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer.pm | ||||
384 | 90565 | 610ms | my ($filesref, $registryref, $dirref, $allfilecomponentsref, $allregistrycomponents, $basedir, $componentidhashref, $componentidkeypathhashref, $allvariables) = @_; | ||
385 | |||||
386 | my @componenttable = (); | ||||
387 | |||||
388 | my ($oneline, $infoline); | ||||
389 | |||||
390 | 1 | 28µs | installer::windows::idtglobal::write_idt_header(\@componenttable, "component"); # spent 28µs making 1 call to installer::windows::idtglobal::write_idt_header | ||
391 | |||||
392 | # File components | ||||
393 | |||||
394 | for ( my $i = 0; $i <= $#{$allfilecomponentsref}; $i++ ) | ||||
395 | { | ||||
396 | my %onecomponent = (); | ||||
397 | |||||
398 | $onecomponent{'name'} = ${$allfilecomponentsref}[$i]; | ||||
399 | 9015 | 128ms | $onecomponent{'guid'} = get_component_guid($onecomponent{'name'}, $componentidhashref); # spent 128ms making 9015 calls to installer::windows::component::get_component_guid, avg 14µs/call | ||
400 | 9015 | 276s | $onecomponent{'directory'} = get_file_component_directory($onecomponent{'name'}, $filesref, $dirref); # spent 276s making 9015 calls to installer::windows::component::get_file_component_directory, avg 30.6ms/call | ||
401 | if ( $onecomponent{'directory'} eq "IGNORE_COMP" ) { next; } | ||||
402 | 9015 | 271s | $onecomponent{'attributes'} = get_file_component_attributes($onecomponent{'name'}, $filesref, $allvariables); # spent 271s making 9015 calls to installer::windows::component::get_file_component_attributes, avg 30.1ms/call | ||
403 | 9015 | 148ms | $onecomponent{'condition'} = get_file_component_condition($onecomponent{'name'}, $filesref); # spent 148ms making 9015 calls to installer::windows::component::get_file_component_condition, avg 16µs/call | ||
404 | 9015 | 270s | $onecomponent{'keypath'} = get_component_keypath($onecomponent{'name'}, $filesref, $componentidkeypathhashref); # spent 270s making 9015 calls to installer::windows::component::get_component_keypath, avg 30.0ms/call | ||
405 | |||||
406 | $oneline = $onecomponent{'name'} . "\t" . $onecomponent{'guid'} . "\t" . $onecomponent{'directory'} . "\t" | ||||
407 | . $onecomponent{'attributes'} . "\t" . $onecomponent{'condition'} . "\t" . $onecomponent{'keypath'} . "\n"; | ||||
408 | |||||
409 | push(@componenttable, $oneline); | ||||
410 | } | ||||
411 | |||||
412 | # Registry components | ||||
413 | |||||
414 | for ( my $i = 0; $i <= $#{$allregistrycomponents}; $i++ ) | ||||
415 | { | ||||
416 | my %onecomponent = (); | ||||
417 | |||||
418 | $onecomponent{'name'} = ${$allregistrycomponents}[$i]; | ||||
419 | 45 | 490µs | $onecomponent{'guid'} = get_component_guid($onecomponent{'name'}, $componentidhashref); # spent 490µs making 45 calls to installer::windows::component::get_component_guid, avg 11µs/call | ||
420 | 45 | 197µs | $onecomponent{'directory'} = get_registry_component_directory(); # spent 197µs making 45 calls to installer::windows::component::get_registry_component_directory, avg 4µs/call | ||
421 | 45 | 741µs | $onecomponent{'attributes'} = get_registry_component_attributes($onecomponent{'name'}, $allvariables); # spent 741µs making 45 calls to installer::windows::component::get_registry_component_attributes, avg 16µs/call | ||
422 | 45 | 386µs | $onecomponent{'condition'} = get_component_condition($onecomponent{'name'}); # spent 386µs making 45 calls to installer::windows::component::get_component_condition, avg 9µs/call | ||
423 | 45 | 1.64s | $onecomponent{'keypath'} = get_component_keypath($onecomponent{'name'}, $registryref, $componentidkeypathhashref); # spent 1.64s making 45 calls to installer::windows::component::get_component_keypath, avg 36.4ms/call | ||
424 | |||||
425 | $oneline = $onecomponent{'name'} . "\t" . $onecomponent{'guid'} . "\t" . $onecomponent{'directory'} . "\t" | ||||
426 | . $onecomponent{'attributes'} . "\t" . $onecomponent{'condition'} . "\t" . $onecomponent{'keypath'} . "\n"; | ||||
427 | |||||
428 | push(@componenttable, $oneline); | ||||
429 | } | ||||
430 | |||||
431 | # Saving the file | ||||
432 | |||||
433 | my $componenttablename = $basedir . $installer::globals::separator . "Componen.idt"; | ||||
434 | 1 | 5.91ms | installer::files::save_file($componenttablename ,\@componenttable); # spent 5.91ms making 1 call to installer::files::save_file | ||
435 | $infoline = "Created idt file: $componenttablename\n"; | ||||
436 | push(@installer::globals::logfileinfo, $infoline); | ||||
437 | } | ||||
438 | |||||
439 | #################################################################################### | ||||
440 | # Returning a component for a scp module gid. | ||||
441 | # Pairs are saved in the files collector. | ||||
442 | #################################################################################### | ||||
443 | |||||
444 | sub get_component_name_from_modulegid | ||||
445 | { | ||||
446 | my ($modulegid, $filesref) = @_; | ||||
447 | |||||
448 | my $componentname = ""; | ||||
449 | |||||
450 | for my $file ( @{$filesref} ) | ||||
451 | { | ||||
452 | next if ( ! $file->{'modules'} ); | ||||
453 | |||||
454 | my @filemodules = split /,\s*/, $file->{'modules'}; | ||||
455 | |||||
456 | if (grep {$_ eq $modulegid} @filemodules) | ||||
457 | { | ||||
458 | $componentname = $file->{'componentname'}; | ||||
459 | last; | ||||
460 | } | ||||
461 | } | ||||
462 | |||||
463 | return $componentname; | ||||
464 | } | ||||
465 | |||||
466 | #################################################################################### | ||||
467 | # Updating the file Environm.idt dynamically | ||||
468 | # Content: | ||||
469 | # Environment Name Value Component_ | ||||
470 | #################################################################################### | ||||
471 | |||||
472 | sub set_component_in_environment_table | ||||
473 | # spent 24.1ms (2.22+21.9) within installer::windows::component::set_component_in_environment_table which was called 109 times, avg 221µs/call:
# 109 times (2.22ms+21.9ms) by installer::run at line 1635 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer.pm, avg 221µs/call | ||||
474 | 436 | 24.1ms | my ($basedir, $filesref) = @_; | ||
475 | |||||
476 | my $infoline = ""; | ||||
477 | |||||
478 | my $environmentfilename = $basedir . $installer::globals::separator . "Environm.idt"; | ||||
479 | |||||
480 | 109 | 21.9ms | if ( -f $environmentfilename ) # only do something, if file exists # spent 21.9ms making 109 calls to installer::windows::component::CORE:ftfile, avg 201µs/call | ||
481 | { | ||||
482 | my $environmentfile = installer::files::read_file($environmentfilename); | ||||
483 | |||||
484 | for ( my $i = 3; $i <= $#{$environmentfile}; $i++ ) # starting in line 4 of Environm.idt | ||||
485 | { | ||||
486 | if ( ${$environmentfile}[$i] =~ /^\s*(.*?)\t(.*?)\t(.*?)\t(.*?)\s*$/ ) | ||||
487 | { | ||||
488 | my $modulegid = $4; # in Environment table a scp module gid can be used as component replacement | ||||
489 | |||||
490 | my $componentname = get_component_name_from_modulegid($modulegid, $filesref); | ||||
491 | |||||
492 | if ( $componentname ) # only do something if a component could be found | ||||
493 | { | ||||
494 | $infoline = "Updated Environment table:\n"; | ||||
495 | push(@installer::globals::logfileinfo, $infoline); | ||||
496 | $infoline = "Old line: ${$environmentfile}[$i]\n"; | ||||
497 | push(@installer::globals::logfileinfo, $infoline); | ||||
498 | |||||
499 | ${$environmentfile}[$i] =~ s/$modulegid/$componentname/; | ||||
500 | |||||
501 | $infoline = "New line: ${$environmentfile}[$i]\n"; | ||||
502 | push(@installer::globals::logfileinfo, $infoline); | ||||
503 | |||||
504 | } | ||||
505 | } | ||||
506 | } | ||||
507 | |||||
508 | # Saving the file | ||||
509 | |||||
510 | installer::files::save_file($environmentfilename ,$environmentfile); | ||||
511 | $infoline = "Updated idt file: $environmentfilename\n"; | ||||
512 | push(@installer::globals::logfileinfo, $infoline); | ||||
513 | |||||
514 | } | ||||
515 | } | ||||
516 | |||||
517 | 1 | 7µs | 1; | ||
# spent 21.9ms within installer::windows::component::CORE:ftfile which was called 109 times, avg 201µs/call:
# 109 times (21.9ms+0s) by installer::windows::component::set_component_in_environment_table at line 480, avg 201µs/call | |||||
# spent 128ms within installer::windows::component::CORE:match which was called 27778 times, avg 5µs/call:
# 9703 times (64.5ms+0s) by installer::windows::component::get_file_component_directory at line 115, avg 7µs/call
# 9015 times (55.8ms+0s) by installer::windows::component::get_file_component_attributes at line 220, avg 6µs/call
# 9015 times (7.67ms+0s) by installer::windows::component::get_file_component_attributes at line 225, avg 851ns/call
# 45 times (186µs+0s) by installer::windows::component::get_registry_component_attributes at line 259, avg 4µs/call | |||||
# spent 12.4ms within installer::windows::component::CORE:regcomp which was called 9648 times, avg 1µs/call:
# 9648 times (12.4ms+0s) by installer::windows::component::get_file_component_directory at line 128, avg 1µs/call | |||||
# spent 71.0ms within installer::windows::component::CORE:subst which was called 9648 times, avg 7µs/call:
# 9648 times (71.0ms+0s) by installer::windows::component::get_file_component_directory at line 128, avg 7µs/call |