← 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:53 2012

Filename/cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer/windows/component.pm
StatementsExecuted 833070569 statements in 837s
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
970322292s293sinstaller::windows::component::::get_file_component_directoryinstaller::windows::component::get_file_component_directory
906021272s272sinstaller::windows::component::::get_component_keypathinstaller::windows::component::get_component_keypath
901511271s271sinstaller::windows::component::::get_file_component_attributesinstaller::windows::component::get_file_component_attributes
901511148ms148msinstaller::windows::component::::get_file_component_conditioninstaller::windows::component::get_file_component_condition
906021129ms129msinstaller::windows::component::::get_component_guidinstaller::windows::component::get_component_guid
2777841128ms128msinstaller::windows::component::::CORE:matchinstaller::windows::component::CORE:match (opcode)
96481171.0ms71.0msinstaller::windows::component::::CORE:substinstaller::windows::component::CORE:subst (opcode)
1091121.9ms21.9msinstaller::windows::component::::CORE:ftfileinstaller::windows::component::CORE:ftfile (opcode)
96481112.4ms12.4msinstaller::windows::component::::CORE:regcompinstaller::windows::component::CORE:regcomp (opcode)
109112.22ms24.1msinstaller::windows::component::::set_component_in_environment_tableinstaller::windows::component::set_component_in_environment_table
4511554µs741µsinstaller::windows::component::::get_registry_component_attributesinstaller::windows::component::get_registry_component_attributes
4511386µs386µsinstaller::windows::component::::get_component_conditioninstaller::windows::component::get_component_condition
111359µs362µsinstaller::windows::component::::BEGIN@30installer::windows::component::BEGIN@30
4511197µs197µsinstaller::windows::component::::get_registry_component_directoryinstaller::windows::component::get_registry_component_directory
11119µs22µsinstaller::windows::component::::BEGIN@32installer::windows::component::BEGIN@32
11114µs17µsinstaller::windows::component::::BEGIN@31installer::windows::component::BEGIN@31
11114µs17µsinstaller::windows::component::::BEGIN@34installer::windows::component::BEGIN@34
11114µs16µsinstaller::windows::component::::BEGIN@33installer::windows::component::BEGIN@33
0000s0sinstaller::windows::component::::get_component_name_from_modulegidinstaller::windows::component::get_component_name_from_modulegid
111-2576s-1757sinstaller::windows::component::::create_component_tableinstaller::windows::component::create_component_table
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::windows::component;
29
30262µs2365µ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
use installer::exiter;
# spent 362µs making 1 call to installer::windows::component::BEGIN@30 # spent 3µs making 1 call to UNIVERSAL::import
31256µs220µ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
use installer::files;
# spent 17µs making 1 call to installer::windows::component::BEGIN@31 # spent 3µs making 1 call to UNIVERSAL::import
32254µs224µ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
use installer::globals;
# spent 22µs making 1 call to installer::windows::component::BEGIN@32 # spent 3µs making 1 call to UNIVERSAL::import
33258µs219µ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
use installer::windows::idtglobal;
# spent 16µs making 1 call to installer::windows::component::BEGIN@33 # spent 2µs making 1 call to UNIVERSAL::import
3423.84ms220µ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
use installer::windows::language;
# 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
44sub 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
{
46906026.0ms my ( $componentname, $componentidhashref ) = @_;
47
48 # At this time only a template
4990609.15ms my $returnvalue = "\{COMPONENTGUID\}";
50
5190606.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
57906013.4ms if ( exists($installer::globals::componentid{$componentname}) )
58 {
59 $returnvalue = "\{" . $installer::globals::componentid{$componentname} . "\}";
60 }
61
62906076.4ms return $returnvalue;
63}
64
65##############################################################
66# Returning the directory for a file component.
67##############################################################
68
69sub 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
{
71970323.8ms my ($componentname, $filesref, $dirref) = @_;
72
7397037.86ms my ($onefile, $component, $onedir, $hostname, $uniquedir);
7497036.29ms my $found = 0;
75
769703103s for ( my $i = 0; $i <= $#{$filesref}; $i++ )
77 {
789528976558.6s $onefile = ${$filesref}[$i];
799528976581.9s $component = $onefile->{'componentname'};
80
819528976538.4s if ( $component eq $componentname )
82 {
8397038.81ms $found = 1;
84970318.7ms last;
85 }
86 }
87
8897036.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
111970312.4ms my $localstyles = "";
112
113970325.1ms if ( $onefile->{'Styles'} ) { $localstyles = $onefile->{'Styles'}; }
114
1159703224ms970364.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
120964810.0ms my $destdir = "";
121
122964819.6ms if ( $onefile->{'Dir'} ) { $destdir = $onefile->{'Dir'}; }
123
124964820.5ms my $destination = $onefile->{'destination'};
125
1269648106ms9648631ms installer::pathanalyzer::get_path_from_fullqualifiedname(\$destination);
# spent 631ms making 9648 calls to installer::pathanalyzer::get_path_from_fullqualifiedname, avg 65µs/call
127
1289648187ms1929683.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
132964815.4ms if ($destination eq "") # files in the installation root
133 {
134 $uniquedir = "INSTALLLOCATION";
135 }
136 else
137 {
13896488.23ms $found = 0;
139
14096483.17s for ( my $i = 0; $i <= $#{$dirref}; $i++ )
141 {
14228165281.77s $onedir = ${$dirref}[$i];
14328165283.10s $hostname = $onedir->{'HostName'};
144
14528165281.15s if ( $hostname eq $destination )
146 {
14796485.09ms $found = 1;
14896488.37ms last;
149 }
150 }
151
15296484.61ms if (!($found))
153 {
154 installer::exiter::exit_program("ERROR: Did not find destination $destination in directory collection", "get_file_component_directory");
155 }
156
157964816.8ms $uniquedir = $onedir->{'uniquename'};
158
159964811.5ms if ( $uniquedir eq $installer::globals::officeinstalldirectory )
160 {
161 $uniquedir = "INSTALLLOCATION";
162 }
163 }
164
165964867.9ms $onefile->{'uniquedirname'} = $uniquedir; # saving it in the file collection
166
1679648114ms return $uniquedir
168}
169
170##############################################################
171# Returning the directory for a registry component.
172# This cannot be a useful value
173##############################################################
174
175sub 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
{
1774543µs my $componentdir = "INSTALLLOCATION";
178
17945243µs return $componentdir;
180}
181
182##############################################################
183# Returning the attributes for a file component.
184##############################################################
185
186sub 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
{
188901526.5ms my ($componentname, $filesref, $allvariables) = @_;
189
19090153.88ms my $attributes;
191
19290154.36ms $attributes = 2;
193
194 # special handling for font files
195
19690153.60ms my $onefile;
19790155.02ms my $found = 0;
198
199901598.4s for ( my $i = 0; $i <= $#{$filesref}; $i++ )
200 {
2018941290055.6s $onefile = ${$filesref}[$i];
2028941290078.4s my $component = $onefile->{'componentname'};
203
2048941290038.4s if ( $component eq $componentname )
205 {
20690157.69ms $found = 1;
207901517.1ms last;
208 }
209 }
210
21190154.87ms if (!($found))
212 {
213 installer::exiter::exit_program("ERROR: Did not find component in file collection", "get_file_component_attributes");
214 }
215
21690159.62ms my $localstyles = "";
217
218901516.7ms if ( $onefile->{'Styles'} ) { $localstyles = $onefile->{'Styles'}; }
219
2209015206ms901555.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
225901546.2ms90157.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
230901513.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.
236901514.0ms if (( $allvariables->{'64BITPRODUCT'} ) && ( $allvariables->{'64BITPRODUCT'} == 1 )) { $attributes |= 256; }
237
2389015125ms 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
247sub 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
{
2494562µs my ($componentname, $allvariables) = @_;
250
2514527µs my $attributes;
252
2534530µs $attributes = 4;
254
255 # Setting msidbComponentAttributes64bit, if this is a 64 bit installation set.
2564562µs if (( $allvariables->{'64BITPRODUCT'} ) && ( $allvariables->{'64BITPRODUCT'} == 1 )) { $attributes |= 256; }
257
258 # Setting msidbComponentAttributes64bit for 64 bit shell extension in 32 bit installer, too
25945386µs45186µ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
2624531µs if ( exists($installer::globals::dontdeletecomponents{$componentname}) ) { $attributes |= 16; }
263
26445227µ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
273sub 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
{
275901534.2ms my ($componentname, $filesref) = @_;
276
27790157.94ms my $condition = "";
278
279901520.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
28590159.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
297901571.7ms return $condition
298}
299
300##############################################################
301# Returning the conditions for a registry component.
302##############################################################
303
304sub 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
{
3064560µs my ($componentname) = @_;
307
3084519µs my $condition;
309
3104535µs $condition = ""; # Always ?
311
31245124µs if (exists($installer::globals::componentcondition{$componentname}))
313 {
314 $condition = $installer::globals::componentcondition{$componentname};
315 }
316
31745245µ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
328sub 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
{
330906021.1ms my ($componentname, $itemsref, $componentidkeypathhashref) = @_;
331
33290603.30ms my $oneitem;
33390604.20ms my $found = 0;
33490606.42ms my $infoline = "";
335
336906099.2s for ( my $i = 0; $i <= $#{$itemsref}; $i++ )
337 {
3388994240155.6s $oneitem = ${$itemsref}[$i];
3398994240179.0s my $component = $oneitem->{'componentname'};
340
3418994240137.8s if ( $component eq $componentname )
342 {
34390608.58ms $found = 1;
344906016.8ms last;
345 }
346 }
347
34890605.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
353906016.5ms my $keypath = $oneitem->{'uniquename'}; # "uniquename", not "Name"
354
355 # Special handling for updates from existing databases, because KeyPath must not change
35690609.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
368906010.8ms if ( $oneitem->{'userregkeypath'} ) { $keypath = $oneitem->{'userregkeypath'}; }
369
370 # saving it in the file and registry collection
371906048.1ms $oneitem->{'keypath'} = $keypath;
372
3739060197ms return $keypath
374}
375
376###################################################################
377# Creating the file Componen.idt dynamically
378# Content:
379# Component ComponentId Directory_ Attributes Condition KeyPath
380###################################################################
381
382sub 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
{
38417µs my ($filesref, $registryref, $dirref, $allfilecomponentsref, $allregistrycomponents, $basedir, $componentidhashref, $componentidkeypathhashref, $allvariables) = @_;
385
38611µs my @componenttable = ();
387
38811µs my ($oneline, $infoline);
389
39015µs128µ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
394126.6ms for ( my $i = 0; $i <= $#{$allfilecomponentsref}; $i++ )
395 {
396901518.5ms my %onecomponent = ();
397
398901523.8ms $onecomponent{'name'} = ${$allfilecomponentsref}[$i];
399901581.9ms9015128ms $onecomponent{'guid'} = get_component_guid($onecomponent{'name'}, $componentidhashref);
# spent 128ms making 9015 calls to installer::windows::component::get_component_guid, avg 14µs/call
400901560.6ms9015276s $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
40190158.98ms if ( $onecomponent{'directory'} eq "IGNORE_COMP" ) { next; }
402901578.7ms9015271s $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
403901584.9ms9015148ms $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
404901561.4ms9015270s $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
406901583.3ms $oneline = $onecomponent{'name'} . "\t" . $onecomponent{'guid'} . "\t" . $onecomponent{'directory'} . "\t"
407 . $onecomponent{'attributes'} . "\t" . $onecomponent{'condition'} . "\t" . $onecomponent{'keypath'} . "\n";
408
409901574.9ms push(@componenttable, $oneline);
410 }
411
412 # Registry components
413
4141120µs for ( my $i = 0; $i <= $#{$allregistrycomponents}; $i++ )
415 {
4164578µs my %onecomponent = ();
417
41845114µs $onecomponent{'name'} = ${$allregistrycomponents}[$i];
41945353µs45490µ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
42045177µs45197µ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
42145187µs45741µ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
42245174µs45386µ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
42345213µs451.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
42545351µs $oneline = $onecomponent{'name'} . "\t" . $onecomponent{'guid'} . "\t" . $onecomponent{'directory'} . "\t"
426 . $onecomponent{'attributes'} . "\t" . $onecomponent{'condition'} . "\t" . $onecomponent{'keypath'} . "\n";
427
42845322µs push(@componenttable, $oneline);
429 }
430
431 # Saving the file
432
43315µs my $componenttablename = $basedir . $installer::globals::separator . "Componen.idt";
434114µs15.91ms installer::files::save_file($componenttablename ,\@componenttable);
# spent 5.91ms making 1 call to installer::files::save_file
43516µs $infoline = "Created idt file: $componenttablename\n";
43614.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
444sub 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
472sub 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
{
474109289µs my ($basedir, $filesref) = @_;
475
476109126µs my $infoline = "";
477
478109218µs my $environmentfilename = $basedir . $installer::globals::separator . "Environm.idt";
479
48010923.5ms10921.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
51717µs1;
 
# 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
sub installer::windows::component::CORE:ftfile; # opcode
# 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
sub installer::windows::component::CORE:match; # opcode
# 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
sub installer::windows::component::CORE:regcomp; # opcode
# 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
sub installer::windows::component::CORE:subst; # opcode