Filename | /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer/substfilenamefiles.pm |
Statements | Executed 63597 statements in 112ms |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
1 | 1 | 1 | 103ms | 407ms | resolving_subst_filename_flag | installer::substfilenamefiles::
15895 | 1 | 1 | 7.26ms | 7.26ms | CORE:match (opcode) | installer::substfilenamefiles::
1 | 1 | 1 | 341µs | 343µs | BEGIN@30 | installer::substfilenamefiles::
1 | 1 | 1 | 19µs | 22µs | BEGIN@31 | installer::substfilenamefiles::
1 | 1 | 1 | 17µs | 50µs | BEGIN@32 | installer::substfilenamefiles::
1 | 1 | 1 | 16µs | 19µs | BEGIN@33 | installer::substfilenamefiles::
1 | 1 | 1 | 14µs | 16µs | BEGIN@34 | installer::substfilenamefiles::
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::substfilenamefiles; | ||||
29 | |||||
30 | 2 | 67µs | 2 | 346µs | # spent 343µs (341+3) within installer::substfilenamefiles::BEGIN@30 which was called:
# once (341µs+3µs) by installer::BEGIN@59 at line 30 # spent 343µs making 1 call to installer::substfilenamefiles::BEGIN@30
# spent 3µs making 1 call to UNIVERSAL::import |
31 | 2 | 57µs | 2 | 25µs | # spent 22µs (19+3) within installer::substfilenamefiles::BEGIN@31 which was called:
# once (19µs+3µs) by installer::BEGIN@59 at line 31 # spent 22µs making 1 call to installer::substfilenamefiles::BEGIN@31
# spent 3µs making 1 call to UNIVERSAL::import |
32 | 2 | 58µs | 2 | 83µs | # spent 50µs (17+33) within installer::substfilenamefiles::BEGIN@32 which was called:
# once (17µs+33µs) by installer::BEGIN@59 at line 32 # spent 50µs making 1 call to installer::substfilenamefiles::BEGIN@32
# spent 33µs making 1 call to Exporter::import |
33 | 2 | 55µs | 2 | 21µs | # spent 19µs (16+3) within installer::substfilenamefiles::BEGIN@33 which was called:
# once (16µs+3µs) by installer::BEGIN@59 at line 33 # spent 19µs making 1 call to installer::substfilenamefiles::BEGIN@33
# spent 3µs making 1 call to UNIVERSAL::import |
34 | 2 | 1.59ms | 2 | 19µs | # spent 16µs (14+3) within installer::substfilenamefiles::BEGIN@34 which was called:
# once (14µs+3µs) by installer::BEGIN@59 at line 34 # spent 16µs making 1 call to installer::substfilenamefiles::BEGIN@34
# spent 3µs making 1 call to UNIVERSAL::import |
35 | |||||
36 | ######################################################### | ||||
37 | # Analyzing files with flag SUBST_FILENAME | ||||
38 | ######################################################### | ||||
39 | |||||
40 | sub resolving_subst_filename_flag | ||||
41 | # spent 407ms (103+304) within installer::substfilenamefiles::resolving_subst_filename_flag which was called:
# once (103ms+304ms) by installer::run at line 703 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer.pm | ||||
42 | 63586 | 111ms | my ($filesarrayref, $variableshashref, $languagestringref) = @_; | ||
43 | |||||
44 | 1 | 297ms | my $replacedirbase = installer::systemactions::create_directories("change_filename", $languagestringref); # spent 297ms making 1 call to installer::systemactions::create_directories | ||
45 | |||||
46 | 1 | 148µs | installer::logger::include_header_into_logfile("Files with flag SUBST_FILENAME:"); # spent 148µs making 1 call to installer::logger::include_header_into_logfile | ||
47 | |||||
48 | for ( my $i = 0; $i <= $#{$filesarrayref}; $i++ ) | ||||
49 | { | ||||
50 | my $onefile = ${$filesarrayref}[$i]; | ||||
51 | my $styles = ""; | ||||
52 | |||||
53 | if ( $onefile->{'Styles'} ) { $styles = $onefile->{'Styles'}; } | ||||
54 | |||||
55 | 15895 | 7.26ms | if ( $styles =~ /\bSUBST_FILENAME\b/ ) # spent 7.26ms making 15895 calls to installer::substfilenamefiles::CORE:match, avg 457ns/call | ||
56 | { | ||||
57 | # Files with flag SUBST_FILENAME must have a "Substitute" key | ||||
58 | if (( ! $onefile->{'Substitute'} ) && ( ! $onefile->{'InstallName'} )) | ||||
59 | { | ||||
60 | installer::exiter::exit_program("ERROR: SUBST_FILENAME is set, but no Substitute and no InstallName defined at file $onefile->{'gid'}!", "resolving_subst_filename_flag"); | ||||
61 | } | ||||
62 | |||||
63 | # Language specific subdirectory | ||||
64 | my $onelanguage = $onefile->{'specificlanguage'}; | ||||
65 | |||||
66 | if ($onelanguage eq "") | ||||
67 | { | ||||
68 | $onelanguage = "00"; # files without language into directory "00" | ||||
69 | } | ||||
70 | |||||
71 | my $replacedir = $replacedirbase . $installer::globals::separator . $onelanguage . $installer::globals::separator; | ||||
72 | installer::systemactions::create_directory($replacedir); # creating language specific directories | ||||
73 | |||||
74 | # copy files and edit them with the variables defined in the zip.lst | ||||
75 | |||||
76 | my $longfilename = 0; | ||||
77 | |||||
78 | my $onefilename = $onefile->{'Name'}; | ||||
79 | |||||
80 | my $sourcepath = $onefile->{'sourcepath'}; | ||||
81 | |||||
82 | if ( $onefilename =~ /\Q$installer::globals::separator\E/ ) # filename begins with a slash, for instance /registry/schema/org/openoffice/VCL.xcs | ||||
83 | { | ||||
84 | $onefilename =~ s/^\s*\Q$installer::globals::separator\E//; | ||||
85 | $longfilename = 1; | ||||
86 | } | ||||
87 | |||||
88 | my $destinationpath = $replacedir . $onefilename; | ||||
89 | my $movepath = $destinationpath . ".orig"; | ||||
90 | my $destdir = $replacedir; | ||||
91 | |||||
92 | if ( $longfilename ) # the destination directory has to be created before copying | ||||
93 | { | ||||
94 | $destdir = $movepath; | ||||
95 | installer::pathanalyzer::get_path_from_fullqualifiedname(\$destdir); | ||||
96 | installer::systemactions::create_directory_structure($destdir); | ||||
97 | } | ||||
98 | |||||
99 | my $copysuccess = installer::systemactions::copy_one_file($sourcepath, $movepath); | ||||
100 | |||||
101 | if ( $copysuccess ) | ||||
102 | { | ||||
103 | if ( $onefile->{'Substitute'} ) | ||||
104 | { | ||||
105 | my $substitute = $onefile->{'Substitute'}; | ||||
106 | |||||
107 | my $newfilename = $destinationpath; | ||||
108 | installer::pathanalyzer::make_absolute_filename_to_relative_filename(\$newfilename); | ||||
109 | eval '$newfilename =~ ' . "$substitute"; | ||||
110 | |||||
111 | my $longnewfilename = $destdir . $newfilename; | ||||
112 | |||||
113 | $copysuccess = installer::systemactions::copy_one_file($movepath, $longnewfilename); | ||||
114 | |||||
115 | # Saving the new file name | ||||
116 | $onefile->{'Name'} = $newfilename; | ||||
117 | |||||
118 | # Saving the new destination | ||||
119 | my $newdest = $onefile->{'destination'}; | ||||
120 | installer::pathanalyzer::get_path_from_fullqualifiedname(\$newdest); | ||||
121 | $onefile->{'destination'} = $newdest . $newfilename; | ||||
122 | |||||
123 | # Saving the original source, where the file was found | ||||
124 | $onefile->{'originalsourcepath'} = $onefile->{'sourcepath'}; | ||||
125 | |||||
126 | # Writing the new sourcepath into the hashref, even if it was not copied | ||||
127 | $onefile->{'sourcepath'} = $longnewfilename; | ||||
128 | } | ||||
129 | else | ||||
130 | { | ||||
131 | if ( $onefile->{'InstallName'} ) | ||||
132 | { | ||||
133 | my $installname = $onefile->{'InstallName'}; | ||||
134 | |||||
135 | my $newfilename = $destinationpath; | ||||
136 | installer::pathanalyzer::make_absolute_filename_to_relative_filename(\$newfilename); | ||||
137 | |||||
138 | my $longnewfilename = $destdir . $installname; | ||||
139 | |||||
140 | $copysuccess = installer::systemactions::copy_one_file($movepath, $longnewfilename); | ||||
141 | |||||
142 | # Saving the new file name | ||||
143 | $onefile->{'Name'} = $installname; | ||||
144 | |||||
145 | # Saving the new destination | ||||
146 | my $newdest = $onefile->{'destination'}; | ||||
147 | installer::pathanalyzer::get_path_from_fullqualifiedname(\$newdest); | ||||
148 | $onefile->{'destination'} = $newdest . $installname; | ||||
149 | |||||
150 | # Saving the original source, where the file was found | ||||
151 | $onefile->{'originalsourcepath'} = $onefile->{'sourcepath'}; | ||||
152 | |||||
153 | # Writing the new sourcepath into the hashref, even if it was not copied | ||||
154 | $onefile->{'sourcepath'} = $longnewfilename; | ||||
155 | } | ||||
156 | } | ||||
157 | } | ||||
158 | } | ||||
159 | } | ||||
160 | |||||
161 | my $infoline = "\n"; | ||||
162 | push( @installer::globals::logfileinfo, $infoline); | ||||
163 | } | ||||
164 | |||||
165 | 1 | 10µs | 1; | ||
# spent 7.26ms within installer::substfilenamefiles::CORE:match which was called 15895 times, avg 457ns/call:
# 15895 times (7.26ms+0s) by installer::substfilenamefiles::resolving_subst_filename_flag at line 55, avg 457ns/call |