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 | 9060 | 26.0ms | my ( $componentname, $componentidhashref ) = @_; | ||
47 | |||||
48 | # At this time only a template | ||||
49 | 9060 | 9.15ms | my $returnvalue = "\{COMPONENTGUID\}"; | ||
50 | |||||
51 | 9060 | 6.86ms | 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 | 9060 | 13.4ms | if ( exists($installer::globals::componentid{$componentname}) ) | ||
58 | { | ||||
59 | $returnvalue = "\{" . $installer::globals::componentid{$componentname} . "\}"; | ||||
60 | } | ||||
61 | |||||
62 | 9060 | 76.4ms | 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 | 9703 | 23.8ms | my ($componentname, $filesref, $dirref) = @_; | ||
72 | |||||
73 | 9703 | 7.86ms | my ($onefile, $component, $onedir, $hostname, $uniquedir); | ||
74 | 9703 | 6.29ms | my $found = 0; | ||
75 | |||||
76 | 9703 | 103s | for ( my $i = 0; $i <= $#{$filesref}; $i++ ) | ||
77 | { | ||||
78 | 95289765 | 58.6s | $onefile = ${$filesref}[$i]; | ||
79 | 95289765 | 81.9s | $component = $onefile->{'componentname'}; | ||
80 | |||||
81 | 95289765 | 38.4s | if ( $component eq $componentname ) | ||
82 | { | ||||
83 | 9703 | 8.81ms | $found = 1; | ||
84 | 9703 | 18.7ms | last; | ||
85 | } | ||||
86 | } | ||||
87 | |||||
88 | 9703 | 6.16ms | 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 | 9703 | 12.4ms | my $localstyles = ""; | ||
112 | |||||
113 | 9703 | 25.1ms | if ( $onefile->{'Styles'} ) { $localstyles = $onefile->{'Styles'}; } | ||
114 | |||||
115 | 9703 | 224ms | 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 | 9648 | 10.0ms | my $destdir = ""; | ||
121 | |||||
122 | 9648 | 19.6ms | if ( $onefile->{'Dir'} ) { $destdir = $onefile->{'Dir'}; } | ||
123 | |||||
124 | 9648 | 20.5ms | my $destination = $onefile->{'destination'}; | ||
125 | |||||
126 | 9648 | 106ms | 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 | 9648 | 187ms | 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 | 9648 | 15.4ms | if ($destination eq "") # files in the installation root | ||
133 | { | ||||
134 | $uniquedir = "INSTALLLOCATION"; | ||||
135 | } | ||||
136 | else | ||||
137 | { | ||||
138 | 9648 | 8.23ms | $found = 0; | ||
139 | |||||
140 | 9648 | 3.17s | for ( my $i = 0; $i <= $#{$dirref}; $i++ ) | ||
141 | { | ||||
142 | 2816528 | 1.77s | $onedir = ${$dirref}[$i]; | ||
143 | 2816528 | 3.10s | $hostname = $onedir->{'HostName'}; | ||
144 | |||||
145 | 2816528 | 1.15s | if ( $hostname eq $destination ) | ||
146 | { | ||||
147 | 9648 | 5.09ms | $found = 1; | ||
148 | 9648 | 8.37ms | last; | ||
149 | } | ||||
150 | } | ||||
151 | |||||
152 | 9648 | 4.61ms | if (!($found)) | ||
153 | { | ||||
154 | installer::exiter::exit_program("ERROR: Did not find destination $destination in directory collection", "get_file_component_directory"); | ||||
155 | } | ||||
156 | |||||
157 | 9648 | 16.8ms | $uniquedir = $onedir->{'uniquename'}; | ||
158 | |||||
159 | 9648 | 11.5ms | if ( $uniquedir eq $installer::globals::officeinstalldirectory ) | ||
160 | { | ||||
161 | $uniquedir = "INSTALLLOCATION"; | ||||
162 | } | ||||
163 | } | ||||
164 | |||||
165 | 9648 | 67.9ms | $onefile->{'uniquedirname'} = $uniquedir; # saving it in the file collection | ||
166 | |||||
167 | 9648 | 114ms | 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 | 45 | 43µs | my $componentdir = "INSTALLLOCATION"; | ||
178 | |||||
179 | 45 | 243µs | 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 | 9015 | 26.5ms | my ($componentname, $filesref, $allvariables) = @_; | ||
189 | |||||
190 | 9015 | 3.88ms | my $attributes; | ||
191 | |||||
192 | 9015 | 4.36ms | $attributes = 2; | ||
193 | |||||
194 | # special handling for font files | ||||
195 | |||||
196 | 9015 | 3.60ms | my $onefile; | ||
197 | 9015 | 5.02ms | my $found = 0; | ||
198 | |||||
199 | 9015 | 98.4s | for ( my $i = 0; $i <= $#{$filesref}; $i++ ) | ||
200 | { | ||||
201 | 89412900 | 55.6s | $onefile = ${$filesref}[$i]; | ||
202 | 89412900 | 78.4s | my $component = $onefile->{'componentname'}; | ||
203 | |||||
204 | 89412900 | 38.4s | if ( $component eq $componentname ) | ||
205 | { | ||||
206 | 9015 | 7.69ms | $found = 1; | ||
207 | 9015 | 17.1ms | last; | ||
208 | } | ||||
209 | } | ||||
210 | |||||
211 | 9015 | 4.87ms | if (!($found)) | ||
212 | { | ||||
213 | installer::exiter::exit_program("ERROR: Did not find component in file collection", "get_file_component_attributes"); | ||||
214 | } | ||||
215 | |||||
216 | 9015 | 9.62ms | my $localstyles = ""; | ||
217 | |||||
218 | 9015 | 16.7ms | if ( $onefile->{'Styles'} ) { $localstyles = $onefile->{'Styles'}; } | ||
219 | |||||
220 | 9015 | 206ms | 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 | 46.2ms | 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 | 9015 | 13.2ms | 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 | 9015 | 14.0ms | if (( $allvariables->{'64BITPRODUCT'} ) && ( $allvariables->{'64BITPRODUCT'} == 1 )) { $attributes |= 256; } | ||
237 | |||||
238 | 9015 | 125ms | 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 | 45 | 62µs | my ($componentname, $allvariables) = @_; | ||
250 | |||||
251 | 45 | 27µs | my $attributes; | ||
252 | |||||
253 | 45 | 30µs | $attributes = 4; | ||
254 | |||||
255 | # Setting msidbComponentAttributes64bit, if this is a 64 bit installation set. | ||||
256 | 45 | 62µs | if (( $allvariables->{'64BITPRODUCT'} ) && ( $allvariables->{'64BITPRODUCT'} == 1 )) { $attributes |= 256; } | ||
257 | |||||
258 | # Setting msidbComponentAttributes64bit for 64 bit shell extension in 32 bit installer, too | ||||
259 | 45 | 386µs | 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 | 45 | 31µs | if ( exists($installer::globals::dontdeletecomponents{$componentname}) ) { $attributes |= 16; } | ||
263 | |||||
264 | 45 | 227µs | 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 | 9015 | 34.2ms | my ($componentname, $filesref) = @_; | ||
276 | |||||
277 | 9015 | 7.94ms | my $condition = ""; | ||
278 | |||||
279 | 9015 | 20.1ms | 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 | 9015 | 9.56ms | 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 | 9015 | 71.7ms | 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 | 45 | 60µs | my ($componentname) = @_; | ||
307 | |||||
308 | 45 | 19µs | my $condition; | ||
309 | |||||
310 | 45 | 35µs | $condition = ""; # Always ? | ||
311 | |||||
312 | 45 | 124µs | if (exists($installer::globals::componentcondition{$componentname})) | ||
313 | { | ||||
314 | $condition = $installer::globals::componentcondition{$componentname}; | ||||
315 | } | ||||
316 | |||||
317 | 45 | 245µs | 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 | 9060 | 21.1ms | my ($componentname, $itemsref, $componentidkeypathhashref) = @_; | ||
331 | |||||
332 | 9060 | 3.30ms | my $oneitem; | ||
333 | 9060 | 4.20ms | my $found = 0; | ||
334 | 9060 | 6.42ms | my $infoline = ""; | ||
335 | |||||
336 | 9060 | 99.2s | for ( my $i = 0; $i <= $#{$itemsref}; $i++ ) | ||
337 | { | ||||
338 | 89942401 | 55.6s | $oneitem = ${$itemsref}[$i]; | ||
339 | 89942401 | 79.0s | my $component = $oneitem->{'componentname'}; | ||
340 | |||||
341 | 89942401 | 37.8s | if ( $component eq $componentname ) | ||
342 | { | ||||
343 | 9060 | 8.58ms | $found = 1; | ||
344 | 9060 | 16.8ms | last; | ||
345 | } | ||||
346 | } | ||||
347 | |||||
348 | 9060 | 5.31ms | 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 | 9060 | 16.5ms | my $keypath = $oneitem->{'uniquename'}; # "uniquename", not "Name" | ||
354 | |||||
355 | # Special handling for updates from existing databases, because KeyPath must not change | ||||
356 | 9060 | 9.39ms | 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 | 9060 | 10.8ms | if ( $oneitem->{'userregkeypath'} ) { $keypath = $oneitem->{'userregkeypath'}; } | ||
369 | |||||
370 | # saving it in the file and registry collection | ||||
371 | 9060 | 48.1ms | $oneitem->{'keypath'} = $keypath; | ||
372 | |||||
373 | 9060 | 197ms | 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 | 1 | 7µs | my ($filesref, $registryref, $dirref, $allfilecomponentsref, $allregistrycomponents, $basedir, $componentidhashref, $componentidkeypathhashref, $allvariables) = @_; | ||
385 | |||||
386 | 1 | 1µs | my @componenttable = (); | ||
387 | |||||
388 | 1 | 1µs | my ($oneline, $infoline); | ||
389 | |||||
390 | 1 | 5µs | 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 | 1 | 26.6ms | for ( my $i = 0; $i <= $#{$allfilecomponentsref}; $i++ ) | ||
395 | { | ||||
396 | 9015 | 18.5ms | my %onecomponent = (); | ||
397 | |||||
398 | 9015 | 23.8ms | $onecomponent{'name'} = ${$allfilecomponentsref}[$i]; | ||
399 | 9015 | 81.9ms | 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 | 60.6ms | 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 | 9015 | 8.98ms | if ( $onecomponent{'directory'} eq "IGNORE_COMP" ) { next; } | ||
402 | 9015 | 78.7ms | 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 | 84.9ms | 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 | 61.4ms | 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 | 9015 | 83.3ms | $oneline = $onecomponent{'name'} . "\t" . $onecomponent{'guid'} . "\t" . $onecomponent{'directory'} . "\t" | ||
407 | . $onecomponent{'attributes'} . "\t" . $onecomponent{'condition'} . "\t" . $onecomponent{'keypath'} . "\n"; | ||||
408 | |||||
409 | 9015 | 74.9ms | push(@componenttable, $oneline); | ||
410 | } | ||||
411 | |||||
412 | # Registry components | ||||
413 | |||||
414 | 1 | 120µs | for ( my $i = 0; $i <= $#{$allregistrycomponents}; $i++ ) | ||
415 | { | ||||
416 | 45 | 78µs | my %onecomponent = (); | ||
417 | |||||
418 | 45 | 114µs | $onecomponent{'name'} = ${$allregistrycomponents}[$i]; | ||
419 | 45 | 353µs | 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 | 177µs | 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 | 187µs | 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 | 174µs | 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 | 213µs | 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 | 45 | 351µs | $oneline = $onecomponent{'name'} . "\t" . $onecomponent{'guid'} . "\t" . $onecomponent{'directory'} . "\t" | ||
426 | . $onecomponent{'attributes'} . "\t" . $onecomponent{'condition'} . "\t" . $onecomponent{'keypath'} . "\n"; | ||||
427 | |||||
428 | 45 | 322µs | push(@componenttable, $oneline); | ||
429 | } | ||||
430 | |||||
431 | # Saving the file | ||||
432 | |||||
433 | 1 | 5µs | my $componenttablename = $basedir . $installer::globals::separator . "Componen.idt"; | ||
434 | 1 | 14µs | 1 | 5.91ms | installer::files::save_file($componenttablename ,\@componenttable); # spent 5.91ms making 1 call to installer::files::save_file |
435 | 1 | 6µs | $infoline = "Created idt file: $componenttablename\n"; | ||
436 | 1 | 4.18ms | 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 | 109 | 289µs | my ($basedir, $filesref) = @_; | ||
475 | |||||
476 | 109 | 126µs | my $infoline = ""; | ||
477 | |||||
478 | 109 | 218µs | my $environmentfilename = $basedir . $installer::globals::separator . "Environm.idt"; | ||
479 | |||||
480 | 109 | 23.5ms | 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 |