Filename | /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer/windows/directory.pm |
Statements | Executed 21170973 statements in 56.9s |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
109 | 1 | 1 | 18.6s | 45.3s | create_unique_directorynames | installer::windows::directory::
201432 | 1 | 1 | 13.5s | 15.1s | make_short_dir_version | installer::windows::directory::
3766168 | 20 | 1 | 11.7s | 11.7s | CORE:subst (opcode) | installer::windows::directory::
109 | 1 | 1 | 6.02s | 2211s | create_defaultdir_directorynames | installer::windows::directory::
2867463 | 9 | 1 | 2.92s | 2.92s | CORE:match (opcode) | installer::windows::directory::
201432 | 1 | 1 | 1.77s | 2.61s | get_last_directory_name | installer::windows::directory::
109 | 1 | 1 | 1.57s | 1.57s | create_directorytable_from_collection | installer::windows::directory::
109 | 1 | 1 | 755ms | 757ms | set_installlocation_directory | installer::windows::directory::
402864 | 2 | 1 | 313ms | 313ms | CORE:regcomp (opcode) | installer::windows::directory::
109 | 1 | 1 | 8.69ms | 21.8ms | add_root_directories | installer::windows::directory::
1 | 1 | 1 | 5.87ms | 5.87ms | collectdirectorytrees | installer::windows::directory::
109 | 1 | 1 | 1.43ms | 1.43ms | check_sourcedir_addon | installer::windows::directory::
109 | 1 | 1 | 982µs | 982µs | overwrite_programfilesfolder | installer::windows::directory::
1 | 1 | 1 | 423µs | 427µs | BEGIN@30 | installer::windows::directory::
1 | 1 | 1 | 16µs | 18µs | BEGIN@31 | installer::windows::directory::
1 | 1 | 1 | 15µs | 16µs | BEGIN@33 | installer::windows::directory::
1 | 1 | 1 | 15µs | 18µs | BEGIN@32 | installer::windows::directory::
1 | 1 | 1 | 14µs | 15µs | BEGIN@34 | installer::windows::directory::
1 | 1 | 1 | -6872s | -4613s | create_directory_table | installer::windows::directory::
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::directory; | ||||
29 | |||||
30 | 2 | 62µs | 2 | 430µs | # spent 427µs (423+3) within installer::windows::directory::BEGIN@30 which was called:
# once (423µs+3µs) by installer::BEGIN@65 at line 30 # spent 427µs making 1 call to installer::windows::directory::BEGIN@30
# spent 3µs making 1 call to UNIVERSAL::import |
31 | 2 | 55µs | 2 | 20µs | # spent 18µs (16+2) within installer::windows::directory::BEGIN@31 which was called:
# once (16µs+2µs) by installer::BEGIN@65 at line 31 # spent 18µs making 1 call to installer::windows::directory::BEGIN@31
# spent 2µs making 1 call to UNIVERSAL::import |
32 | 2 | 54µs | 2 | 20µs | # spent 18µs (15+3) within installer::windows::directory::BEGIN@32 which was called:
# once (15µs+3µs) by installer::BEGIN@65 at line 32 # spent 18µs making 1 call to installer::windows::directory::BEGIN@32
# spent 3µs making 1 call to UNIVERSAL::import |
33 | 2 | 53µs | 2 | 18µs | # spent 16µs (15+1) within installer::windows::directory::BEGIN@33 which was called:
# once (15µs+1µs) by installer::BEGIN@65 at line 33 # spent 16µs making 1 call to installer::windows::directory::BEGIN@33
# spent 2µs making 1 call to UNIVERSAL::import |
34 | 2 | 5.08ms | 2 | 17µs | # spent 15µs (14+1) within installer::windows::directory::BEGIN@34 which was called:
# once (14µs+1µs) by installer::BEGIN@65 at line 34 # spent 15µs making 1 call to installer::windows::directory::BEGIN@34
# spent 2µs making 1 call to UNIVERSAL::import |
35 | |||||
36 | ############################################################## | ||||
37 | # Collecting all directory trees in global hash | ||||
38 | ############################################################## | ||||
39 | |||||
40 | sub collectdirectorytrees | ||||
41 | # spent 5.87ms within installer::windows::directory::collectdirectorytrees which was called:
# once (5.87ms+0s) by installer::run at line 1491 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer.pm | ||||
42 | 2 | 1.94ms | my ( $directoryref ) = @_; | ||
43 | |||||
44 | 7392 | 3.91ms | for ( my $i = 0; $i <= $#{$directoryref}; $i++ ) | ||
45 | { | ||||
46 | my $onedir = ${$directoryref}[$i]; | ||||
47 | my $styles = ""; | ||||
48 | if ( $onedir->{'Styles'} ) { $styles = $onedir->{'Styles'}; } | ||||
49 | |||||
50 | 16 | 32µs | if ( $styles ne "" ) | ||
51 | { | ||||
52 | foreach my $treestyle ( keys %installer::globals::treestyles ) | ||||
53 | { | ||||
54 | if ( $styles =~ /\b$treestyle\b/ ) | ||||
55 | { | ||||
56 | my $hostname = $onedir->{'HostName'}; | ||||
57 | # -> hostname is the key, the style the value! | ||||
58 | $installer::globals::hostnametreestyles{$hostname} = $treestyle; | ||||
59 | } | ||||
60 | } | ||||
61 | } | ||||
62 | } | ||||
63 | } | ||||
64 | |||||
65 | ############################################################## | ||||
66 | # Overwriting global programfilesfolder, if required | ||||
67 | ############################################################## | ||||
68 | |||||
69 | sub overwrite_programfilesfolder | ||||
70 | # spent 982µs within installer::windows::directory::overwrite_programfilesfolder which was called 109 times, avg 9µs/call:
# 109 times (982µs+0s) by installer::windows::directory::create_directory_table at line 531, avg 9µs/call | ||||
71 | 218 | 964µs | my ( $allvariables ) = @_; | ||
72 | |||||
73 | if ( $allvariables->{'PROGRAMFILESFOLDERNAME'} ) | ||||
74 | { | ||||
75 | $installer::globals::programfilesfolder = $allvariables->{'PROGRAMFILESFOLDERNAME'}; | ||||
76 | } | ||||
77 | } | ||||
78 | |||||
79 | ############################################################## | ||||
80 | # Maximum length of directory name is 72. | ||||
81 | # Taking care of underlines, which are the separator. | ||||
82 | ############################################################## | ||||
83 | |||||
84 | sub make_short_dir_version | ||||
85 | # spent 15.1s (13.5+1.52) within installer::windows::directory::make_short_dir_version which was called 201432 times, avg 75µs/call:
# 201432 times (13.5s+1.52s) by installer::windows::directory::create_unique_directorynames at line 176, avg 75µs/call | ||||
86 | 1208592 | 4.31s | my ($longstring, $length, $displayname) = @_; | ||
87 | |||||
88 | my $shortstring = ""; | ||||
89 | |||||
90 | # Splitting the string at each "underline" and allowing only | ||||
91 | # $length characters per directory name. | ||||
92 | # Checking also uniqueness and length. | ||||
93 | |||||
94 | for my $onestring ( split /_\s*/, $longstring ) | ||||
95 | { | ||||
96 | 3768021 | 7.45s | my $partstring = ""; | ||
97 | |||||
98 | 1396290 | 2.51s | 1256007 | 904ms | if ( $onestring =~ /\-/ ) # spent 904ms making 1256007 calls to installer::windows::directory::CORE:match, avg 720ns/call |
99 | { | ||||
100 | for my $onelocalstring ( split /-\s*/, $onestring ) | ||||
101 | { | ||||
102 | 570506 | 656ms | if ( length($onelocalstring) > $length ) { | ||
103 | $onelocalstring = substr($onelocalstring, 0, $length); | ||||
104 | } | ||||
105 | $partstring .= "-" . $onelocalstring; | ||||
106 | } | ||||
107 | 140283 | 248ms | $partstring =~ s/^\s*\-//; # spent 248ms making 140283 calls to installer::windows::directory::CORE:subst, avg 2µs/call | ||
108 | } | ||||
109 | else | ||||
110 | { | ||||
111 | 870801 | 447ms | if ( length($onestring) > $length ) { | ||
112 | $partstring = substr($onestring, 0, $length); | ||||
113 | } | ||||
114 | else { | ||||
115 | $partstring = $onestring; | ||||
116 | } | ||||
117 | } | ||||
118 | |||||
119 | $shortstring .= "_" . $partstring; | ||||
120 | } | ||||
121 | |||||
122 | 201432 | 370ms | $shortstring =~ s/^\s*\_//; # spent 370ms making 201432 calls to installer::windows::directory::CORE:subst, avg 2µs/call | ||
123 | |||||
124 | if ( length($shortstring) > 72 ) | ||||
125 | { | ||||
126 | my $shortlength = length($shortstring); | ||||
127 | my $infoline = "WARNING: Failed to create unique directory name with less than 72 characters: \"$displayname\" ($shortstring ($shortlength)).\n"; | ||||
128 | push(@installer::globals::logfileinfo, $infoline); | ||||
129 | } | ||||
130 | |||||
131 | return $shortstring; | ||||
132 | } | ||||
133 | |||||
134 | ############################################################## | ||||
135 | # Adding unique directory names to the directory collection | ||||
136 | ############################################################## | ||||
137 | |||||
138 | 1 | 2µs | my $already_checked_the_frigging_directories_for_uniqueness = 0; | ||
139 | |||||
140 | sub create_unique_directorynames | ||||
141 | # spent 45.3s (18.6+26.7) within installer::windows::directory::create_unique_directorynames which was called 109 times, avg 416ms/call:
# 109 times (18.6s+26.7s) by installer::windows::directory::create_directory_table at line 532, avg 416ms/call | ||||
142 | 654 | 494ms | my ($directoryref, $allvariables) = @_; | ||
143 | |||||
144 | my %conversionhash = (); | ||||
145 | my $infoline = ""; | ||||
146 | my $errorcount = 0; | ||||
147 | |||||
148 | 7251552 | 29.5s | for ( my $i = 0; $i <= $#{$directoryref}; $i++ ) | ||
149 | { | ||||
150 | my $onedir = ${$directoryref}[$i]; | ||||
151 | my $hostname = $onedir->{'HostName'}; | ||||
152 | |||||
153 | my $uniquename = $hostname; | ||||
154 | my $styles = ""; | ||||
155 | if ( $onedir->{'Styles'} ) { $styles = $onedir->{'Styles'}; } | ||||
156 | # get_path_from_fullqualifiedname(\$uniqueparentname); | ||||
157 | # making /registry/schema/org/openoffice/VCL.xcs to VCL.xcs | ||||
158 | |||||
159 | 201432 | 858ms | $uniquename =~ s/^\s*//g; # removing beginning white spaces # spent 858ms making 201432 calls to installer::windows::directory::CORE:subst, avg 4µs/call | ||
160 | 201432 | 2.66s | $uniquename =~ s/\s*$//g; # removing ending white spaces # spent 2.66s making 201432 calls to installer::windows::directory::CORE:subst, avg 13µs/call | ||
161 | 201432 | 734ms | $uniquename =~ s/\s//g; # removing white spaces # spent 734ms making 201432 calls to installer::windows::directory::CORE:subst, avg 4µs/call | ||
162 | 201432 | 140ms | $uniquename =~ s/\_//g; # removing existing underlines # spent 140ms making 201432 calls to installer::windows::directory::CORE:subst, avg 694ns/call | ||
163 | 201432 | 850ms | $uniquename =~ s/\.//g; # removing dots in directoryname # spent 850ms making 201432 calls to installer::windows::directory::CORE:subst, avg 4µs/call | ||
164 | 402864 | 1.91s | $uniquename =~ s/\Q$installer::globals::separator\E/\_/g; # replacing slash and backslash with underline # spent 1.82s making 201432 calls to installer::windows::directory::CORE:subst, avg 9µs/call
# spent 94.2ms making 201432 calls to installer::windows::directory::CORE:regcomp, avg 468ns/call | ||
165 | 201432 | 128ms | $uniquename =~ s/OpenOffice/OO/g; # spent 128ms making 201432 calls to installer::windows::directory::CORE:subst, avg 634ns/call | ||
166 | 201432 | 782ms | $uniquename =~ s/LibreOffice/LO/g; # spent 782ms making 201432 calls to installer::windows::directory::CORE:subst, avg 4µs/call | ||
167 | 201432 | 124ms | $uniquename =~ s/_registry/_rgy/g; # spent 124ms making 201432 calls to installer::windows::directory::CORE:subst, avg 615ns/call | ||
168 | 201432 | 105ms | $uniquename =~ s/_registration/_rgn/g; # spent 105ms making 201432 calls to installer::windows::directory::CORE:subst, avg 519ns/call | ||
169 | 201432 | 715ms | $uniquename =~ s/_extension/_ext/g; # spent 715ms making 201432 calls to installer::windows::directory::CORE:subst, avg 4µs/call | ||
170 | 201432 | 116ms | $uniquename =~ s/_frame/_frm/g; # spent 116ms making 201432 calls to installer::windows::directory::CORE:subst, avg 577ns/call | ||
171 | 201432 | 107ms | $uniquename =~ s/_table/_tbl/g; # spent 107ms making 201432 calls to installer::windows::directory::CORE:subst, avg 533ns/call | ||
172 | 201432 | 108ms | $uniquename =~ s/_chart/_crt/g; # spent 108ms making 201432 calls to installer::windows::directory::CORE:subst, avg 535ns/call | ||
173 | |||||
174 | my $startlength = 5; | ||||
175 | |||||
176 | 201432 | 15.1s | if ( ! $allvariables->{'NOSHORTDIRECTORYNAMES'} ) # spent 15.1s making 201432 calls to installer::windows::directory::make_short_dir_version, avg 75µs/call | ||
177 | { | ||||
178 | # This process does not work for SDK, because of its long and similar paths | ||||
179 | $uniquename = make_short_dir_version($uniquename, $startlength, $hostname); # taking care of underlines! | ||||
180 | } | ||||
181 | |||||
182 | if ( !$already_checked_the_frigging_directories_for_uniqueness && | ||||
183 | exists($installer::globals::alluniquedirectorynames{$uniquename}) ) | ||||
184 | { | ||||
185 | # This is an error, that must stop the packaging process | ||||
186 | $errorcount++; | ||||
187 | |||||
188 | $infoline = "$errorcount: Already existing unique directory: $uniquename\n"; | ||||
189 | push( @installer::globals::logfileinfo, $infoline); | ||||
190 | $infoline = "$errorcount: First full directory: $conversionhash{$uniquename}\n"; | ||||
191 | push( @installer::globals::logfileinfo, $infoline); | ||||
192 | $infoline = "$errorcount: Current full directory: $hostname\n"; | ||||
193 | push( @installer::globals::logfileinfo, $infoline); | ||||
194 | } | ||||
195 | |||||
196 | $conversionhash{$uniquename} = $hostname; | ||||
197 | |||||
198 | $installer::globals::alluniquedirectorynames{$uniquename} = 1; | ||||
199 | |||||
200 | # Important: The unique parent is generated from the string $uniquename. Therefore counters | ||||
201 | # like adding "_1" is not allowed to achive uniqueness, because this depends from other directories | ||||
202 | # and does not deliver always the same result. | ||||
203 | |||||
204 | my $uniqueparentname = $uniquename; | ||||
205 | |||||
206 | 109 | 110µs | 201432 | 703ms | if ( $uniqueparentname =~ /^\s*(.*)\_(.*?)\s*$/ ) # the underline is now the separator # spent 703ms making 201432 calls to installer::windows::directory::CORE:match, avg 3µs/call |
207 | { | ||||
208 | $uniqueparentname = $1; | ||||
209 | } | ||||
210 | else | ||||
211 | { | ||||
212 | $uniqueparentname = $installer::globals::programfilesfolder; | ||||
213 | } | ||||
214 | |||||
215 | 201432 | 85.7ms | if ( $styles =~ /\bPROGRAMFILESFOLDER\b/ ) { $uniqueparentname = $installer::globals::programfilesfolder; } # spent 85.7ms making 201432 calls to installer::windows::directory::CORE:match, avg 426ns/call | ||
216 | 201432 | 79.4ms | if ( $styles =~ /\bCOMMONFILESFOLDER\b/ ) { $uniqueparentname = $installer::globals::commonfilesfolder; } # spent 79.4ms making 201432 calls to installer::windows::directory::CORE:match, avg 394ns/call | ||
217 | 201432 | 72.6ms | if ( $styles =~ /\bCOMMONAPPDATAFOLDER\b/ ) { $uniqueparentname = $installer::globals::commonappdatafolder; } # spent 72.6ms making 201432 calls to installer::windows::directory::CORE:match, avg 360ns/call | ||
218 | 201432 | 75.5ms | if ( $styles =~ /\bLOCALAPPDATAFOLDER\b/ ) { $uniqueparentname = $installer::globals::localappdatafolder; } # spent 75.5ms making 201432 calls to installer::windows::directory::CORE:match, avg 375ns/call | ||
219 | |||||
220 | 201432 | 72.9ms | if ( $styles =~ /\bSHAREPOINTPATH\b/ ) # spent 72.9ms making 201432 calls to installer::windows::directory::CORE:match, avg 362ns/call | ||
221 | { | ||||
222 | $uniqueparentname = "SHAREPOINTPATH"; | ||||
223 | $installer::globals::usesharepointpath = 1; | ||||
224 | } | ||||
225 | |||||
226 | 201432 | 631ms | $uniquename =~ s/\-/\_/g; # making "-" to "_" # spent 631ms making 201432 calls to installer::windows::directory::CORE:subst, avg 3µs/call | ||
227 | 201432 | 495ms | $uniqueparentname =~ s/\-/\_/g; # making "-" to "_" # spent 495ms making 201432 calls to installer::windows::directory::CORE:subst, avg 2µs/call | ||
228 | |||||
229 | $onedir->{'uniquename'} = $uniquename; | ||||
230 | $onedir->{'uniqueparentname'} = $uniqueparentname; | ||||
231 | |||||
232 | # setting the installlocation directory | ||||
233 | 327 | 228µs | 201432 | 89.0ms | if ( $styles =~ /\bISINSTALLLOCATION\b/ ) # spent 89.0ms making 201432 calls to installer::windows::directory::CORE:match, avg 442ns/call |
234 | { | ||||
235 | if ( $installer::globals::installlocationdirectoryset ) { installer::exiter::exit_program("ERROR: Directory with flag ISINSTALLLOCATION alread set: \"$installer::globals::installlocationdirectory\".", "create_unique_directorynames"); } | ||||
236 | $installer::globals::installlocationdirectory = $uniquename; | ||||
237 | $installer::globals::installlocationdirectoryset = 1; | ||||
238 | } | ||||
239 | } | ||||
240 | |||||
241 | if ( $errorcount > 0 ) | ||||
242 | { | ||||
243 | installer::exiter::exit_program("ERROR: Failed to create unique directory names.", "create_unique_directorynames"); | ||||
244 | } | ||||
245 | } | ||||
246 | |||||
247 | ##################################################### | ||||
248 | # Adding ":." to selected default directory names | ||||
249 | ##################################################### | ||||
250 | |||||
251 | sub check_sourcedir_addon | ||||
252 | # spent 1.43ms within installer::windows::directory::check_sourcedir_addon which was called 109 times, avg 13µs/call:
# 109 times (1.43ms+0s) by installer::windows::directory::set_installlocation_directory at line 284, avg 13µs/call | ||||
253 | 218 | 1.42ms | my ( $onedir, $allvariableshashref ) = @_; | ||
254 | |||||
255 | 218 | 338µs | if (($installer::globals::patch) || | ||
256 | ($installer::globals::languagepack) || | ||||
257 | ($installer::globals::helppack) || | ||||
258 | ($allvariableshashref->{'CHANGETARGETDIR'})) | ||||
259 | { | ||||
260 | my $sourcediraddon = "\:\."; | ||||
261 | $onedir->{'defaultdir'} = $onedir->{'defaultdir'} . $sourcediraddon; | ||||
262 | } | ||||
263 | |||||
264 | } | ||||
265 | |||||
266 | ##################################################### | ||||
267 | # The directory with the style ISINSTALLLOCATION | ||||
268 | # will be replaced by INSTALLLOCATION | ||||
269 | ##################################################### | ||||
270 | |||||
271 | sub set_installlocation_directory | ||||
272 | # spent 757ms (755+1.43) within installer::windows::directory::set_installlocation_directory which was called 109 times, avg 6.94ms/call:
# 109 times (755ms+1.43ms) by installer::windows::directory::create_directory_table at line 535, avg 6.94ms/call | ||||
273 | 327 | 219ms | my ( $directoryref, $allvariableshashref ) = @_; | ||
274 | |||||
275 | if ( ! $installer::globals::installlocationdirectoryset ) { installer::exiter::exit_program("ERROR: Directory with flag ISINSTALLLOCATION not set!", "set_installlocation_directory"); } | ||||
276 | |||||
277 | 805728 | 536ms | for ( my $i = 0; $i <= $#{$directoryref}; $i++ ) | ||
278 | { | ||||
279 | my $onedir = ${$directoryref}[$i]; | ||||
280 | |||||
281 | 218 | 562µs | if ( $onedir->{'uniquename'} eq $installer::globals::installlocationdirectory ) | ||
282 | { | ||||
283 | $onedir->{'uniquename'} = "INSTALLLOCATION"; | ||||
284 | 109 | 1.43ms | check_sourcedir_addon($onedir, $allvariableshashref); # spent 1.43ms making 109 calls to installer::windows::directory::check_sourcedir_addon, avg 13µs/call | ||
285 | } | ||||
286 | |||||
287 | if ( $onedir->{'uniquename'} eq $installer::globals::vendordirectory ) | ||||
288 | { | ||||
289 | check_sourcedir_addon($onedir, $allvariableshashref); | ||||
290 | } | ||||
291 | |||||
292 | if ( $onedir->{'uniqueparentname'} eq $installer::globals::installlocationdirectory ) | ||||
293 | { | ||||
294 | $onedir->{'uniqueparentname'} = "INSTALLLOCATION"; | ||||
295 | } | ||||
296 | } | ||||
297 | } | ||||
298 | |||||
299 | ##################################################### | ||||
300 | # Getting the name of the top level directory. This | ||||
301 | # can have only one letter | ||||
302 | ##################################################### | ||||
303 | |||||
304 | sub get_last_directory_name | ||||
305 | # spent 2.61s (1.77+841ms) within installer::windows::directory::get_last_directory_name which was called 201432 times, avg 13µs/call:
# 201432 times (1.77s+841ms) by installer::windows::directory::create_defaultdir_directorynames at line 332, avg 13µs/call | ||||
306 | 402864 | 2.63s | my ($completepathref) = @_; | ||
307 | |||||
308 | 201323 | 320ms | 201432 | 841ms | if ( $$completepathref =~ /^.*[\/\\](.+?)\s*$/ ) # spent 841ms making 201432 calls to installer::windows::directory::CORE:match, avg 4µs/call |
309 | { | ||||
310 | $$completepathref = $1; | ||||
311 | } | ||||
312 | } | ||||
313 | |||||
314 | ##################################################### | ||||
315 | # Creating the defaultdir for the file Director.idt | ||||
316 | ##################################################### | ||||
317 | |||||
318 | sub create_defaultdir_directorynames | ||||
319 | # spent 2211s (6.02+2205) within installer::windows::directory::create_defaultdir_directorynames which was called 109 times, avg 20.3s/call:
# 109 times (6.02s+2205s) by installer::windows::directory::create_directory_table at line 534, avg 20.3s/call | ||||
320 | 436 | 331ms | my ($directoryref, $shortdirnamehashref) = @_; | ||
321 | |||||
322 | my @shortnames = (); | ||||
323 | if ( $installer::globals::updatedatabase ) { @shortnames = values(%{$shortdirnamehashref}); } | ||||
324 | elsif ( $installer::globals::prepare_winpatch ) { @shortnames = values(%installer::globals::saved83dirmapping); } | ||||
325 | |||||
326 | 3021480 | 5.10s | for ( my $i = 0; $i <= $#{$directoryref}; $i++ ) | ||
327 | { | ||||
328 | my $onedir = ${$directoryref}[$i]; | ||||
329 | my $hostname = $onedir->{'HostName'}; | ||||
330 | |||||
331 | 402864 | 890ms | $hostname =~ s/\Q$installer::globals::separator\E\s*$//; # spent 671ms making 201432 calls to installer::windows::directory::CORE:subst, avg 3µs/call
# spent 219ms making 201432 calls to installer::windows::directory::CORE:regcomp, avg 1µs/call | ||
332 | 201432 | 2.61s | get_last_directory_name(\$hostname); # spent 2.61s making 201432 calls to installer::windows::directory::get_last_directory_name, avg 13µs/call | ||
333 | my $uniquename = $onedir->{'uniquename'}; | ||||
334 | my $shortstring; | ||||
335 | 201432 | 679ms | if (( $installer::globals::updatedatabase ) && ( exists($shortdirnamehashref->{$uniquename}) )) | ||
336 | { | ||||
337 | $shortstring = $shortdirnamehashref->{$uniquename}; | ||||
338 | } | ||||
339 | elsif (( $installer::globals::prepare_winpatch ) && ( exists($installer::globals::saved83dirmapping{$uniquename}) )) | ||||
340 | { | ||||
341 | $shortstring = $installer::globals::saved83dirmapping{$uniquename}; | ||||
342 | } | ||||
343 | else | ||||
344 | { | ||||
345 | 201432 | 2201s | $shortstring = installer::windows::idtglobal::make_eight_three_conform($hostname, "dir", \@shortnames); # spent 2201s making 201432 calls to installer::windows::idtglobal::make_eight_three_conform, avg 10.9ms/call | ||
346 | } | ||||
347 | |||||
348 | my $defaultdir; | ||||
349 | |||||
350 | 44799 | 57.0ms | if ( $shortstring eq $hostname ) | ||
351 | { | ||||
352 | $defaultdir = $hostname; | ||||
353 | } | ||||
354 | else | ||||
355 | { | ||||
356 | $defaultdir = $shortstring . "|" . $hostname; | ||||
357 | } | ||||
358 | |||||
359 | $onedir->{'defaultdir'} = $defaultdir; | ||||
360 | |||||
361 | my $fontdir = ""; | ||||
362 | if ( $onedir->{'Dir'} ) { $fontdir = $onedir->{'Dir'}; } | ||||
363 | |||||
364 | my $fontdefaultdir = ""; | ||||
365 | if ( $onedir->{'defaultdir'} ) { $fontdefaultdir = $onedir->{'defaultdir'}; } | ||||
366 | |||||
367 | 218 | 326µs | if (( $fontdir eq "PREDEFINED_OSSYSTEMFONTDIR" ) && ( $fontdefaultdir eq $installer::globals::fontsdirhostname )) | ||
368 | { | ||||
369 | $installer::globals::fontsdirname = $onedir->{'defaultdir'}; | ||||
370 | $installer::globals::fontsdirparent = $onedir->{'uniqueparentname'}; | ||||
371 | } | ||||
372 | } | ||||
373 | } | ||||
374 | |||||
375 | ############################################### | ||||
376 | # Fill content into the directory table | ||||
377 | ############################################### | ||||
378 | |||||
379 | sub create_directorytable_from_collection | ||||
380 | # spent 1.57s within installer::windows::directory::create_directorytable_from_collection which was called 109 times, avg 14.4ms/call:
# 109 times (1.57s+0s) by installer::windows::directory::create_directory_table at line 538, avg 14.4ms/call | ||||
381 | 218 | 244ms | my ($directorytableref, $directoryref) = @_; | ||
382 | |||||
383 | 1410024 | 1.33s | for ( my $i = 0; $i <= $#{$directoryref}; $i++ ) | ||
384 | { | ||||
385 | my $onedir = ${$directoryref}[$i]; | ||||
386 | my $hostname = $onedir->{'HostName'}; | ||||
387 | my $dir = ""; | ||||
388 | |||||
389 | if ( $onedir->{'Dir'} ) { $dir = $onedir->{'Dir'}; } | ||||
390 | |||||
391 | if (( $dir eq "PREDEFINED_PROGDIR" ) && ( $hostname eq "" )) { next; } # removing files from root directory | ||||
392 | |||||
393 | my $oneline = $onedir->{'uniquename'} . "\t" . $onedir->{'uniqueparentname'} . "\t" . $onedir->{'defaultdir'} . "\n"; | ||||
394 | |||||
395 | push(@{$directorytableref}, $oneline); | ||||
396 | } | ||||
397 | } | ||||
398 | |||||
399 | ############################################### | ||||
400 | # Defining the root installation structure | ||||
401 | ############################################### | ||||
402 | |||||
403 | sub add_root_directories | ||||
404 | # spent 21.8ms (8.69+13.1) within installer::windows::directory::add_root_directories which was called 109 times, avg 200µs/call:
# 109 times (8.69ms+13.1ms) by installer::windows::directory::create_directory_table at line 537, avg 200µs/call | ||||
405 | 3706 | 5.35ms | my ($directorytableref, $allvariableshashref, $onelanguage) = @_; | ||
406 | |||||
407 | my $oneline = ""; | ||||
408 | |||||
409 | 1526 | 3.14ms | if (( ! $installer::globals::patch ) && ( ! $installer::globals::languagepack ) && ( ! $installer::globals::helppack ) && ( ! $allvariableshashref->{'DONTUSESTARTMENUFOLDER'} )) | ||
410 | { | ||||
411 | my $productname; | ||||
412 | |||||
413 | $productname = $allvariableshashref->{'PRODUCTNAME'}; | ||||
414 | my $productversion = $allvariableshashref->{'PRODUCTVERSION'}; | ||||
415 | my $baseproductversion = $productversion; | ||||
416 | |||||
417 | if (( $installer::globals::prepare_winpatch ) && ( $allvariableshashref->{'BASEPRODUCTVERSION'} )) | ||||
418 | { | ||||
419 | $baseproductversion = $allvariableshashref->{'BASEPRODUCTVERSION'}; # for example "2.0" for OOo | ||||
420 | } | ||||
421 | |||||
422 | my $realproductkey = $productname . " " . $productversion; | ||||
423 | my $productkey = $productname . " " . $baseproductversion; | ||||
424 | |||||
425 | if (( $allvariableshashref->{'POSTVERSIONEXTENSION'} ) && ( ! $allvariableshashref->{'DONTUSEEXTENSIONINDEFAULTDIR'} )) | ||||
426 | { | ||||
427 | $productkey = $productkey . " " . $allvariableshashref->{'POSTVERSIONEXTENSION'}; | ||||
428 | $realproductkey = $realproductkey . " " . $allvariableshashref->{'POSTVERSIONEXTENSION'}; | ||||
429 | } | ||||
430 | if ( $allvariableshashref->{'NOVERSIONINDIRNAME'} ) | ||||
431 | { | ||||
432 | $productkey = $productname; | ||||
433 | $realproductkey = $realproductname; | ||||
434 | } | ||||
435 | if ( $allvariableshashref->{'NOSPACEINDIRECTORYNAME'} ) | ||||
436 | { | ||||
437 | $productkey =~ s/\ /\_/g; | ||||
438 | $realproductkey =~ s/\ /\_/g; | ||||
439 | } | ||||
440 | |||||
441 | 109 | 7.73ms | my $shortproductkey = installer::windows::idtglobal::make_eight_three_conform($productkey, "dir"); # third parameter not used # spent 7.73ms making 109 calls to installer::windows::idtglobal::make_eight_three_conform, avg 71µs/call | ||
442 | 109 | 202µs | $shortproductkey =~ s/\s/\_/g; # changing empty space to underline # spent 202µs making 109 calls to installer::windows::directory::CORE:subst, avg 2µs/call | ||
443 | |||||
444 | $oneline = "$installer::globals::officemenufolder\t$installer::globals::programmenufolder\t$shortproductkey|$realproductkey\n"; | ||||
445 | push(@{$directorytableref}, $oneline); | ||||
446 | } | ||||
447 | |||||
448 | $oneline = "TARGETDIR\t\tSourceDir\n"; | ||||
449 | push(@{$directorytableref}, $oneline); | ||||
450 | |||||
451 | $oneline = "WindowsFolder\tTARGETDIR\tWindows\n"; | ||||
452 | push(@{$directorytableref}, $oneline); | ||||
453 | |||||
454 | $oneline = "$installer::globals::programfilesfolder\tTARGETDIR\t.\n"; | ||||
455 | push(@{$directorytableref}, $oneline); | ||||
456 | |||||
457 | $oneline = "$installer::globals::programmenufolder\tTARGETDIR\t.\n"; | ||||
458 | push(@{$directorytableref}, $oneline); | ||||
459 | |||||
460 | $oneline = "$installer::globals::startupfolder\tTARGETDIR\t.\n"; | ||||
461 | push(@{$directorytableref}, $oneline); | ||||
462 | |||||
463 | $oneline = "$installer::globals::desktopfolder\tTARGETDIR\t.\n"; | ||||
464 | push(@{$directorytableref}, $oneline); | ||||
465 | |||||
466 | $oneline = "$installer::globals::startmenufolder\tTARGETDIR\t.\n"; | ||||
467 | push(@{$directorytableref}, $oneline); | ||||
468 | |||||
469 | $oneline = "$installer::globals::commonfilesfolder\tTARGETDIR\t.\n"; | ||||
470 | push(@{$directorytableref}, $oneline); | ||||
471 | |||||
472 | $oneline = "$installer::globals::commonappdatafolder\tTARGETDIR\t.\n"; | ||||
473 | push(@{$directorytableref}, $oneline); | ||||
474 | |||||
475 | $oneline = "$installer::globals::localappdatafolder\tTARGETDIR\t.\n"; | ||||
476 | push(@{$directorytableref}, $oneline); | ||||
477 | |||||
478 | if ( $installer::globals::usesharepointpath ) | ||||
479 | { | ||||
480 | $oneline = "SHAREPOINTPATH\tTARGETDIR\t.\n"; | ||||
481 | push(@{$directorytableref}, $oneline); | ||||
482 | } | ||||
483 | |||||
484 | $oneline = "$installer::globals::systemfolder\tTARGETDIR\t.\n"; | ||||
485 | push(@{$directorytableref}, $oneline); | ||||
486 | |||||
487 | my $localtemplatefoldername = $installer::globals::templatefoldername; | ||||
488 | my $directorytableentry = $localtemplatefoldername; | ||||
489 | 109 | 5.15ms | my $shorttemplatefoldername = installer::windows::idtglobal::make_eight_three_conform($localtemplatefoldername, "dir"); # spent 5.15ms making 109 calls to installer::windows::idtglobal::make_eight_three_conform, avg 47µs/call | ||
490 | if ( $shorttemplatefoldername ne $localtemplatefoldername ) { $directorytableentry = "$shorttemplatefoldername|$localtemplatefoldername"; } | ||||
491 | $oneline = "$installer::globals::templatefolder\tTARGETDIR\t$directorytableentry\n"; | ||||
492 | push(@{$directorytableref}, $oneline); | ||||
493 | |||||
494 | if ( $installer::globals::fontsdirname ) | ||||
495 | { | ||||
496 | $oneline = "$installer::globals::fontsfolder\t$installer::globals::fontsdirparent\t$installer::globals::fontsfoldername\:$installer::globals::fontsdirname\n"; | ||||
497 | } | ||||
498 | else | ||||
499 | { | ||||
500 | $oneline = "$installer::globals::fontsfolder\tTARGETDIR\t$installer::globals::fontsfoldername\n"; | ||||
501 | } | ||||
502 | |||||
503 | push(@{$directorytableref}, $oneline); | ||||
504 | |||||
505 | } | ||||
506 | |||||
507 | ############################################### | ||||
508 | # Creating the file Director.idt dynamically | ||||
509 | ############################################### | ||||
510 | |||||
511 | sub create_directory_table | ||||
512 | # spent -4613s (-6872+2259) within installer::windows::directory::create_directory_table which was called:
# once (-6872s+2259s) by installer::run at line 1494 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer.pm | ||||
513 | 2 | 479µs | my ($directoryref, $languagesarrayref, $basedir, $allvariableshashref, $shortdirnamehashref, $loggingdir) = @_; | ||
514 | |||||
515 | # Structure of the directory table: | ||||
516 | # Directory Directory_Parent DefaultDir | ||||
517 | # Directory is a unique identifier | ||||
518 | # Directory_Parent is the unique identifier of the parent | ||||
519 | # DefaultDir is .:APPLIC~1|Application Data with | ||||
520 | # Before ":" : [sourcedir]:[destdir] (not programmed yet) | ||||
521 | # After ":" : 8+3 and not 8+3 the destination directory name | ||||
522 | |||||
523 | 1744 | 80.4ms | for ( my $m = 0; $m <= $#{$languagesarrayref}; $m++ ) | ||
524 | { | ||||
525 | my $onelanguage = ${$languagesarrayref}[$m]; | ||||
526 | $installer::globals::installlocationdirectoryset = 0; | ||||
527 | |||||
528 | my @directorytable = (); | ||||
529 | my $infoline; | ||||
530 | |||||
531 | 109 | 982µs | overwrite_programfilesfolder($allvariableshashref); # spent 982µs making 109 calls to installer::windows::directory::overwrite_programfilesfolder, avg 9µs/call | ||
532 | 109 | 45.3s | create_unique_directorynames($directoryref, $allvariableshashref); # spent 45.3s making 109 calls to installer::windows::directory::create_unique_directorynames, avg 416ms/call | ||
533 | $already_checked_the_frigging_directories_for_uniqueness++; | ||||
534 | 109 | 2211s | create_defaultdir_directorynames($directoryref, $shortdirnamehashref); # only destdir! # spent 2211s making 109 calls to installer::windows::directory::create_defaultdir_directorynames, avg 20.3s/call | ||
535 | 109 | 757ms | set_installlocation_directory($directoryref, $allvariableshashref); # spent 757ms making 109 calls to installer::windows::directory::set_installlocation_directory, avg 6.94ms/call | ||
536 | 109 | 3.63ms | installer::windows::idtglobal::write_idt_header(\@directorytable, "directory"); # spent 3.63ms making 109 calls to installer::windows::idtglobal::write_idt_header, avg 33µs/call | ||
537 | 109 | 21.8ms | add_root_directories(\@directorytable, $allvariableshashref, $onelanguage); # spent 21.8ms making 109 calls to installer::windows::directory::add_root_directories, avg 200µs/call | ||
538 | 109 | 1.57s | create_directorytable_from_collection(\@directorytable, $directoryref); # spent 1.57s making 109 calls to installer::windows::directory::create_directorytable_from_collection, avg 14.4ms/call | ||
539 | |||||
540 | # Saving the file | ||||
541 | |||||
542 | my $directorytablename = $basedir . $installer::globals::separator . "Director.idt" . "." . $onelanguage; | ||||
543 | 109 | 226ms | installer::files::save_file($directorytablename ,\@directorytable); # spent 226ms making 109 calls to installer::files::save_file, avg 2.07ms/call | ||
544 | $infoline = "Created idt file: $directorytablename\n"; | ||||
545 | push(@installer::globals::logfileinfo, $infoline); | ||||
546 | } | ||||
547 | } | ||||
548 | |||||
549 | 1 | 10µs | 1; | ||
# spent 2.92s within installer::windows::directory::CORE:match which was called 2867463 times, avg 1µs/call:
# 1256007 times (904ms+0s) by installer::windows::directory::make_short_dir_version at line 98, avg 720ns/call
# 201432 times (841ms+0s) by installer::windows::directory::get_last_directory_name at line 308, avg 4µs/call
# 201432 times (703ms+0s) by installer::windows::directory::create_unique_directorynames at line 206, avg 3µs/call
# 201432 times (89.0ms+0s) by installer::windows::directory::create_unique_directorynames at line 233, avg 442ns/call
# 201432 times (85.7ms+0s) by installer::windows::directory::create_unique_directorynames at line 215, avg 426ns/call
# 201432 times (79.4ms+0s) by installer::windows::directory::create_unique_directorynames at line 216, avg 394ns/call
# 201432 times (75.5ms+0s) by installer::windows::directory::create_unique_directorynames at line 218, avg 375ns/call
# 201432 times (72.9ms+0s) by installer::windows::directory::create_unique_directorynames at line 220, avg 362ns/call
# 201432 times (72.6ms+0s) by installer::windows::directory::create_unique_directorynames at line 217, avg 360ns/call | |||||
# spent 313ms within installer::windows::directory::CORE:regcomp which was called 402864 times, avg 777ns/call:
# 201432 times (219ms+0s) by installer::windows::directory::create_defaultdir_directorynames at line 331, avg 1µs/call
# 201432 times (94.2ms+0s) by installer::windows::directory::create_unique_directorynames at line 164, avg 468ns/call | |||||
# spent 11.7s within installer::windows::directory::CORE:subst which was called 3766168 times, avg 3µs/call:
# 201432 times (2.66s+0s) by installer::windows::directory::create_unique_directorynames at line 160, avg 13µs/call
# 201432 times (1.82s+0s) by installer::windows::directory::create_unique_directorynames at line 164, avg 9µs/call
# 201432 times (858ms+0s) by installer::windows::directory::create_unique_directorynames at line 159, avg 4µs/call
# 201432 times (850ms+0s) by installer::windows::directory::create_unique_directorynames at line 163, avg 4µs/call
# 201432 times (782ms+0s) by installer::windows::directory::create_unique_directorynames at line 166, avg 4µs/call
# 201432 times (734ms+0s) by installer::windows::directory::create_unique_directorynames at line 161, avg 4µs/call
# 201432 times (715ms+0s) by installer::windows::directory::create_unique_directorynames at line 169, avg 4µs/call
# 201432 times (671ms+0s) by installer::windows::directory::create_defaultdir_directorynames at line 331, avg 3µs/call
# 201432 times (631ms+0s) by installer::windows::directory::create_unique_directorynames at line 226, avg 3µs/call
# 201432 times (495ms+0s) by installer::windows::directory::create_unique_directorynames at line 227, avg 2µs/call
# 201432 times (370ms+0s) by installer::windows::directory::make_short_dir_version at line 122, avg 2µs/call
# 201432 times (140ms+0s) by installer::windows::directory::create_unique_directorynames at line 162, avg 694ns/call
# 201432 times (128ms+0s) by installer::windows::directory::create_unique_directorynames at line 165, avg 634ns/call
# 201432 times (124ms+0s) by installer::windows::directory::create_unique_directorynames at line 167, avg 615ns/call
# 201432 times (116ms+0s) by installer::windows::directory::create_unique_directorynames at line 170, avg 577ns/call
# 201432 times (108ms+0s) by installer::windows::directory::create_unique_directorynames at line 172, avg 535ns/call
# 201432 times (107ms+0s) by installer::windows::directory::create_unique_directorynames at line 171, avg 533ns/call
# 201432 times (105ms+0s) by installer::windows::directory::create_unique_directorynames at line 168, avg 519ns/call
# 140283 times (248ms+0s) by installer::windows::directory::make_short_dir_version at line 107, avg 2µs/call
# 109 times (202µs+0s) by installer::windows::directory::add_root_directories at line 442, avg 2µs/call |