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 | 1 | 4µs | my ( $directoryref ) = @_; | ||
43 | |||||
44 | 1 | 1.93ms | for ( my $i = 0; $i <= $#{$directoryref}; $i++ ) | ||
45 | { | ||||
46 | 1848 | 1.21ms | my $onedir = ${$directoryref}[$i]; | ||
47 | 1848 | 777µs | my $styles = ""; | ||
48 | 1848 | 1.07ms | if ( $onedir->{'Styles'} ) { $styles = $onedir->{'Styles'}; } | ||
49 | |||||
50 | 1848 | 847µs | if ( $styles ne "" ) | ||
51 | { | ||||
52 | 16 | 32µs | 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 | 109 | 156µs | my ( $allvariables ) = @_; | ||
72 | |||||
73 | 109 | 808µs | 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 | 201432 | 218ms | my ($longstring, $length, $displayname) = @_; | ||
87 | |||||
88 | 201432 | 96.9ms | 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 | 201432 | 1.92s | for my $onestring ( split /_\s*/, $longstring ) | ||
95 | { | ||||
96 | 1256007 | 531ms | my $partstring = ""; | ||
97 | |||||
98 | 1256007 | 5.27s | 1256007 | 904ms | if ( $onestring =~ /\-/ ) # spent 904ms making 1256007 calls to installer::windows::directory::CORE:match, avg 720ns/call |
99 | { | ||||
100 | 140283 | 605ms | for my $onelocalstring ( split /-\s*/, $onestring ) | ||
101 | { | ||||
102 | 285253 | 224ms | if ( length($onelocalstring) > $length ) { | ||
103 | $onelocalstring = substr($onelocalstring, 0, $length); | ||||
104 | } | ||||
105 | 285253 | 432ms | $partstring .= "-" . $onelocalstring; | ||
106 | } | ||||
107 | 140283 | 755ms | 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 | 1115724 | 1.15s | if ( length($onestring) > $length ) { | ||
112 | $partstring = substr($onestring, 0, $length); | ||||
113 | } | ||||
114 | else { | ||||
115 | 870801 | 447ms | $partstring = $onestring; | ||
116 | } | ||||
117 | } | ||||
118 | |||||
119 | 1256007 | 1.65s | $shortstring .= "_" . $partstring; | ||
120 | } | ||||
121 | |||||
122 | 201432 | 1.04s | 201432 | 370ms | $shortstring =~ s/^\s*\_//; # spent 370ms making 201432 calls to installer::windows::directory::CORE:subst, avg 2µs/call |
123 | |||||
124 | 201432 | 118ms | 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 | 201432 | 915ms | 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 | 109 | 139µs | my ($directoryref, $allvariables) = @_; | ||
143 | |||||
144 | 109 | 501µs | my %conversionhash = (); | ||
145 | 109 | 92µs | my $infoline = ""; | ||
146 | 109 | 57µs | my $errorcount = 0; | ||
147 | |||||
148 | 109 | 318ms | for ( my $i = 0; $i <= $#{$directoryref}; $i++ ) | ||
149 | { | ||||
150 | 201432 | 173ms | my $onedir = ${$directoryref}[$i]; | ||
151 | 201432 | 256ms | my $hostname = $onedir->{'HostName'}; | ||
152 | |||||
153 | 201432 | 196ms | my $uniquename = $hostname; | ||
154 | 201432 | 93.2ms | my $styles = ""; | ||
155 | 201432 | 135ms | 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 | 1.54s | 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 | 3.32s | 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 | 1.37s | 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 | 725ms | 201432 | 140ms | $uniquename =~ s/\_//g; # removing existing underlines # spent 140ms making 201432 calls to installer::windows::directory::CORE:subst, avg 694ns/call |
163 | 201432 | 1.47s | 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 | 201432 | 3.10s | 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 | 727ms | 201432 | 128ms | $uniquename =~ s/OpenOffice/OO/g; # spent 128ms making 201432 calls to installer::windows::directory::CORE:subst, avg 634ns/call |
166 | 201432 | 1.41s | 201432 | 782ms | $uniquename =~ s/LibreOffice/LO/g; # spent 782ms making 201432 calls to installer::windows::directory::CORE:subst, avg 4µs/call |
167 | 201432 | 712ms | 201432 | 124ms | $uniquename =~ s/_registry/_rgy/g; # spent 124ms making 201432 calls to installer::windows::directory::CORE:subst, avg 615ns/call |
168 | 201432 | 673ms | 201432 | 105ms | $uniquename =~ s/_registration/_rgn/g; # spent 105ms making 201432 calls to installer::windows::directory::CORE:subst, avg 519ns/call |
169 | 201432 | 1.33s | 201432 | 715ms | $uniquename =~ s/_extension/_ext/g; # spent 715ms making 201432 calls to installer::windows::directory::CORE:subst, avg 4µs/call |
170 | 201432 | 690ms | 201432 | 116ms | $uniquename =~ s/_frame/_frm/g; # spent 116ms making 201432 calls to installer::windows::directory::CORE:subst, avg 577ns/call |
171 | 201432 | 674ms | 201432 | 107ms | $uniquename =~ s/_table/_tbl/g; # spent 107ms making 201432 calls to installer::windows::directory::CORE:subst, avg 533ns/call |
172 | 201432 | 669ms | 201432 | 108ms | $uniquename =~ s/_chart/_crt/g; # spent 108ms making 201432 calls to installer::windows::directory::CORE:subst, avg 535ns/call |
173 | |||||
174 | 201432 | 97.9ms | my $startlength = 5; | ||
175 | |||||
176 | 201432 | 714ms | 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 | 201432 | 89.3ms | 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 | 201432 | 409ms | $conversionhash{$uniquename} = $hostname; | ||
197 | |||||
198 | 201432 | 244ms | $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 | 201432 | 142ms | my $uniqueparentname = $uniquename; | ||
205 | |||||
206 | 201432 | 1.59s | 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 | 109 | 110µs | $uniqueparentname = $installer::globals::programfilesfolder; | ||
213 | } | ||||
214 | |||||
215 | 201432 | 671ms | 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 | 644ms | 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 | 648ms | 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 | 635ms | 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 | 632ms | 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 | 1.27s | 201432 | 631ms | $uniquename =~ s/\-/\_/g; # making "-" to "_" # spent 631ms making 201432 calls to installer::windows::directory::CORE:subst, avg 3µs/call |
227 | 201432 | 1.11s | 201432 | 495ms | $uniqueparentname =~ s/\-/\_/g; # making "-" to "_" # spent 495ms making 201432 calls to installer::windows::directory::CORE:subst, avg 2µs/call |
228 | |||||
229 | 201432 | 204ms | $onedir->{'uniquename'} = $uniquename; | ||
230 | 201432 | 171ms | $onedir->{'uniqueparentname'} = $uniqueparentname; | ||
231 | |||||
232 | # setting the installlocation directory | ||||
233 | 201432 | 931ms | 201432 | 89.0ms | if ( $styles =~ /\bISINSTALLLOCATION\b/ ) # spent 89.0ms making 201432 calls to installer::windows::directory::CORE:match, avg 442ns/call |
234 | { | ||||
235 | 109 | 61µs | if ( $installer::globals::installlocationdirectoryset ) { installer::exiter::exit_program("ERROR: Directory with flag ISINSTALLLOCATION alread set: \"$installer::globals::installlocationdirectory\".", "create_unique_directorynames"); } | ||
236 | 109 | 84µs | $installer::globals::installlocationdirectory = $uniquename; | ||
237 | 109 | 83µs | $installer::globals::installlocationdirectoryset = 1; | ||
238 | } | ||||
239 | } | ||||
240 | |||||
241 | 109 | 175ms | 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 | 109 | 169µs | my ( $onedir, $allvariableshashref ) = @_; | ||
254 | |||||
255 | 109 | 1.25ms | if (($installer::globals::patch) || | ||
256 | ($installer::globals::languagepack) || | ||||
257 | ($installer::globals::helppack) || | ||||
258 | ($allvariableshashref->{'CHANGETARGETDIR'})) | ||||
259 | { | ||||
260 | 109 | 92µs | my $sourcediraddon = "\:\."; | ||
261 | 109 | 245µs | $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 | 109 | 230µs | my ( $directoryref, $allvariableshashref ) = @_; | ||
274 | |||||
275 | 109 | 119µs | if ( ! $installer::globals::installlocationdirectoryset ) { installer::exiter::exit_program("ERROR: Directory with flag ISINSTALLLOCATION not set!", "set_installlocation_directory"); } | ||
276 | |||||
277 | 109 | 219ms | for ( my $i = 0; $i <= $#{$directoryref}; $i++ ) | ||
278 | { | ||||
279 | 201432 | 133ms | my $onedir = ${$directoryref}[$i]; | ||
280 | |||||
281 | 201432 | 167ms | if ( $onedir->{'uniquename'} eq $installer::globals::installlocationdirectory ) | ||
282 | { | ||||
283 | 109 | 117µs | $onedir->{'uniquename'} = "INSTALLLOCATION"; | ||
284 | 109 | 444µs | 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 | 201432 | 89.2ms | if ( $onedir->{'uniquename'} eq $installer::globals::vendordirectory ) | ||
288 | { | ||||
289 | check_sourcedir_addon($onedir, $allvariableshashref); | ||||
290 | } | ||||
291 | |||||
292 | 201432 | 147ms | 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 | 201432 | 181ms | my ($completepathref) = @_; | ||
307 | |||||
308 | 201432 | 2.44s | 201432 | 841ms | if ( $$completepathref =~ /^.*[\/\\](.+?)\s*$/ ) # spent 841ms making 201432 calls to installer::windows::directory::CORE:match, avg 4µs/call |
309 | { | ||||
310 | 201323 | 320ms | $$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 | 109 | 222µs | my ($directoryref, $shortdirnamehashref) = @_; | ||
321 | |||||
322 | 109 | 164µs | my @shortnames = (); | ||
323 | 109 | 164µs | if ( $installer::globals::updatedatabase ) { @shortnames = values(%{$shortdirnamehashref}); } | ||
324 | elsif ( $installer::globals::prepare_winpatch ) { @shortnames = values(%installer::globals::saved83dirmapping); } | ||||
325 | |||||
326 | 109 | 331ms | for ( my $i = 0; $i <= $#{$directoryref}; $i++ ) | ||
327 | { | ||||
328 | 201432 | 185ms | my $onedir = ${$directoryref}[$i]; | ||
329 | 201432 | 254ms | my $hostname = $onedir->{'HostName'}; | ||
330 | |||||
331 | 201432 | 2.23s | 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 | 622ms | 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 | 201432 | 273ms | my $uniquename = $onedir->{'uniquename'}; | ||
334 | 201432 | 71.2ms | my $shortstring; | ||
335 | 201432 | 235ms | 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 | 679ms | 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 | 201432 | 76.6ms | my $defaultdir; | ||
349 | |||||
350 | 201432 | 166ms | if ( $shortstring eq $hostname ) | ||
351 | { | ||||
352 | $defaultdir = $hostname; | ||||
353 | } | ||||
354 | else | ||||
355 | { | ||||
356 | 44799 | 57.0ms | $defaultdir = $shortstring . "|" . $hostname; | ||
357 | } | ||||
358 | |||||
359 | 201432 | 227ms | $onedir->{'defaultdir'} = $defaultdir; | ||
360 | |||||
361 | 201432 | 101ms | my $fontdir = ""; | ||
362 | 201432 | 227ms | if ( $onedir->{'Dir'} ) { $fontdir = $onedir->{'Dir'}; } | ||
363 | |||||
364 | 201432 | 95.2ms | my $fontdefaultdir = ""; | ||
365 | 201432 | 154ms | if ( $onedir->{'defaultdir'} ) { $fontdefaultdir = $onedir->{'defaultdir'}; } | ||
366 | |||||
367 | 201432 | 178ms | if (( $fontdir eq "PREDEFINED_OSSYSTEMFONTDIR" ) && ( $fontdefaultdir eq $installer::globals::fontsdirhostname )) | ||
368 | { | ||||
369 | 109 | 127µs | $installer::globals::fontsdirname = $onedir->{'defaultdir'}; | ||
370 | 109 | 199µs | $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 | 109 | 173µs | my ($directorytableref, $directoryref) = @_; | ||
382 | |||||
383 | 109 | 244ms | for ( my $i = 0; $i <= $#{$directoryref}; $i++ ) | ||
384 | { | ||||
385 | 201432 | 126ms | my $onedir = ${$directoryref}[$i]; | ||
386 | 201432 | 206ms | my $hostname = $onedir->{'HostName'}; | ||
387 | 201432 | 87.8ms | my $dir = ""; | ||
388 | |||||
389 | 201432 | 177ms | if ( $onedir->{'Dir'} ) { $dir = $onedir->{'Dir'}; } | ||
390 | |||||
391 | 201432 | 78.5ms | if (( $dir eq "PREDEFINED_PROGDIR" ) && ( $hostname eq "" )) { next; } # removing files from root directory | ||
392 | |||||
393 | 201432 | 403ms | my $oneline = $onedir->{'uniquename'} . "\t" . $onedir->{'uniqueparentname'} . "\t" . $onedir->{'defaultdir'} . "\n"; | ||
394 | |||||
395 | 201432 | 252ms | 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 | 109 | 241µs | my ($directorytableref, $allvariableshashref, $onelanguage) = @_; | ||
406 | |||||
407 | 109 | 119µs | my $oneline = ""; | ||
408 | |||||
409 | 109 | 378µs | if (( ! $installer::globals::patch ) && ( ! $installer::globals::languagepack ) && ( ! $installer::globals::helppack ) && ( ! $allvariableshashref->{'DONTUSESTARTMENUFOLDER'} )) | ||
410 | { | ||||
411 | 109 | 62µs | my $productname; | ||
412 | |||||
413 | 109 | 246µs | $productname = $allvariableshashref->{'PRODUCTNAME'}; | ||
414 | 109 | 168µs | my $productversion = $allvariableshashref->{'PRODUCTVERSION'}; | ||
415 | 109 | 75µs | my $baseproductversion = $productversion; | ||
416 | |||||
417 | 109 | 73µs | if (( $installer::globals::prepare_winpatch ) && ( $allvariableshashref->{'BASEPRODUCTVERSION'} )) | ||
418 | { | ||||
419 | $baseproductversion = $allvariableshashref->{'BASEPRODUCTVERSION'}; # for example "2.0" for OOo | ||||
420 | } | ||||
421 | |||||
422 | 109 | 183µs | my $realproductkey = $productname . " " . $productversion; | ||
423 | 109 | 141µs | my $productkey = $productname . " " . $baseproductversion; | ||
424 | |||||
425 | 109 | 214µs | if (( $allvariableshashref->{'POSTVERSIONEXTENSION'} ) && ( ! $allvariableshashref->{'DONTUSEEXTENSIONINDEFAULTDIR'} )) | ||
426 | { | ||||
427 | $productkey = $productkey . " " . $allvariableshashref->{'POSTVERSIONEXTENSION'}; | ||||
428 | $realproductkey = $realproductkey . " " . $allvariableshashref->{'POSTVERSIONEXTENSION'}; | ||||
429 | } | ||||
430 | 109 | 105µs | if ( $allvariableshashref->{'NOVERSIONINDIRNAME'} ) | ||
431 | { | ||||
432 | $productkey = $productname; | ||||
433 | $realproductkey = $realproductname; | ||||
434 | } | ||||
435 | 109 | 171µs | if ( $allvariableshashref->{'NOSPACEINDIRECTORYNAME'} ) | ||
436 | { | ||||
437 | $productkey =~ s/\ /\_/g; | ||||
438 | $realproductkey =~ s/\ /\_/g; | ||||
439 | } | ||||
440 | |||||
441 | 109 | 478µs | 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 | 709µs | 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 | 109 | 335µs | $oneline = "$installer::globals::officemenufolder\t$installer::globals::programmenufolder\t$shortproductkey|$realproductkey\n"; | ||
445 | 109 | 182µs | push(@{$directorytableref}, $oneline); | ||
446 | } | ||||
447 | |||||
448 | 109 | 64µs | $oneline = "TARGETDIR\t\tSourceDir\n"; | ||
449 | 109 | 109µs | push(@{$directorytableref}, $oneline); | ||
450 | |||||
451 | 109 | 51µs | $oneline = "WindowsFolder\tTARGETDIR\tWindows\n"; | ||
452 | 109 | 122µs | push(@{$directorytableref}, $oneline); | ||
453 | |||||
454 | 109 | 114µs | $oneline = "$installer::globals::programfilesfolder\tTARGETDIR\t.\n"; | ||
455 | 109 | 121µs | push(@{$directorytableref}, $oneline); | ||
456 | |||||
457 | 109 | 99µs | $oneline = "$installer::globals::programmenufolder\tTARGETDIR\t.\n"; | ||
458 | 109 | 133µs | push(@{$directorytableref}, $oneline); | ||
459 | |||||
460 | 109 | 103µs | $oneline = "$installer::globals::startupfolder\tTARGETDIR\t.\n"; | ||
461 | 109 | 102µs | push(@{$directorytableref}, $oneline); | ||
462 | |||||
463 | 109 | 95µs | $oneline = "$installer::globals::desktopfolder\tTARGETDIR\t.\n"; | ||
464 | 109 | 114µs | push(@{$directorytableref}, $oneline); | ||
465 | |||||
466 | 109 | 68µs | $oneline = "$installer::globals::startmenufolder\tTARGETDIR\t.\n"; | ||
467 | 109 | 140µs | push(@{$directorytableref}, $oneline); | ||
468 | |||||
469 | 109 | 90µs | $oneline = "$installer::globals::commonfilesfolder\tTARGETDIR\t.\n"; | ||
470 | 109 | 145µs | push(@{$directorytableref}, $oneline); | ||
471 | |||||
472 | 109 | 98µs | $oneline = "$installer::globals::commonappdatafolder\tTARGETDIR\t.\n"; | ||
473 | 109 | 154µs | push(@{$directorytableref}, $oneline); | ||
474 | |||||
475 | 109 | 93µs | $oneline = "$installer::globals::localappdatafolder\tTARGETDIR\t.\n"; | ||
476 | 109 | 145µs | push(@{$directorytableref}, $oneline); | ||
477 | |||||
478 | 109 | 64µs | if ( $installer::globals::usesharepointpath ) | ||
479 | { | ||||
480 | $oneline = "SHAREPOINTPATH\tTARGETDIR\t.\n"; | ||||
481 | push(@{$directorytableref}, $oneline); | ||||
482 | } | ||||
483 | |||||
484 | 109 | 109µs | $oneline = "$installer::globals::systemfolder\tTARGETDIR\t.\n"; | ||
485 | 109 | 128µs | push(@{$directorytableref}, $oneline); | ||
486 | |||||
487 | 109 | 92µs | my $localtemplatefoldername = $installer::globals::templatefoldername; | ||
488 | 109 | 93µs | my $directorytableentry = $localtemplatefoldername; | ||
489 | 109 | 452µs | 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 | 109 | 155µs | if ( $shorttemplatefoldername ne $localtemplatefoldername ) { $directorytableentry = "$shorttemplatefoldername|$localtemplatefoldername"; } | ||
491 | 109 | 114µs | $oneline = "$installer::globals::templatefolder\tTARGETDIR\t$directorytableentry\n"; | ||
492 | 109 | 152µs | push(@{$directorytableref}, $oneline); | ||
493 | |||||
494 | 109 | 363µs | 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 | 109 | 721µs | 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 | 1 | 5µ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 | 1 | 474µs | for ( my $m = 0; $m <= $#{$languagesarrayref}; $m++ ) | ||
524 | { | ||||
525 | 109 | 365µs | my $onelanguage = ${$languagesarrayref}[$m]; | ||
526 | 109 | 131µs | $installer::globals::installlocationdirectoryset = 0; | ||
527 | |||||
528 | 109 | 188µs | my @directorytable = (); | ||
529 | 109 | 56µs | my $infoline; | ||
530 | |||||
531 | 109 | 705µs | 109 | 982µs | overwrite_programfilesfolder($allvariableshashref); # spent 982µs making 109 calls to installer::windows::directory::overwrite_programfilesfolder, avg 9µs/call |
532 | 109 | 419µs | 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 | 109 | 69µs | $already_checked_the_frigging_directories_for_uniqueness++; | ||
534 | 109 | 558µs | 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 | 477µs | 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 | 904µs | 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 | 537µs | 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 | 511µs | 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 | 109 | 366µs | my $directorytablename = $basedir . $installer::globals::separator . "Director.idt" . "." . $onelanguage; | ||
543 | 109 | 1.31ms | 109 | 226ms | installer::files::save_file($directorytablename ,\@directorytable); # spent 226ms making 109 calls to installer::files::save_file, avg 2.07ms/call |
544 | 109 | 265µs | $infoline = "Created idt file: $directorytablename\n"; | ||
545 | 109 | 73.6ms | 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 |