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

Filename/cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer/languages.pm
StatementsExecuted 479 statements in 4.32ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
1117.07ms11.4msinstaller::languages::::BEGIN@34installer::languages::BEGIN@34
1111.24ms2.78msinstaller::languages::::get_all_languages_for_one_productinstaller::languages::get_all_languages_for_one_product
11141362µs362µsinstaller::languages::::CORE:matchinstaller::languages::CORE:match (opcode)
111343µs345µsinstaller::languages::::BEGIN@30installer::languages::BEGIN@30
111133µs158µsinstaller::languages::::get_language_stringinstaller::languages::get_language_string
11132µs37µsinstaller::languages::::analyze_languagelistinstaller::languages::analyze_languagelist
22128µs28µsinstaller::languages::::CORE:substinstaller::languages::CORE:subst (opcode)
11124µs24µsinstaller::languages::::all_elements_of_array1_in_array2installer::languages::all_elements_of_array1_in_array2
22219µs19µsinstaller::languages::::get_default_languageinstaller::languages::get_default_language
11118µs20µsinstaller::languages::::BEGIN@31installer::languages::BEGIN@31
11117µs19µsinstaller::languages::::BEGIN@33installer::languages::BEGIN@33
11113µs14µsinstaller::languages::::BEGIN@32installer::languages::BEGIN@32
0000s0sinstaller::languages::::get_info_about_languagesinstaller::languages::get_info_about_languages
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::languages;
29
30263µs2348µs
# spent 345µs (343+3) within installer::languages::BEGIN@30 which was called: # once (343µs+3µs) by installer::scriptitems::BEGIN@33 at line 30
use installer::converter;
# spent 345µs making 1 call to installer::languages::BEGIN@30 # spent 2µs making 1 call to UNIVERSAL::import
31253µs222µs
# spent 20µs (18+2) within installer::languages::BEGIN@31 which was called: # once (18µs+2µs) by installer::scriptitems::BEGIN@33 at line 31
use installer::exiter;
# spent 20µs making 1 call to installer::languages::BEGIN@31 # spent 2µs making 1 call to UNIVERSAL::import
32251µs216µs
# spent 14µs (13+2) within installer::languages::BEGIN@32 which was called: # once (13µs+2µs) by installer::scriptitems::BEGIN@33 at line 32
use installer::globals;
# spent 14µs making 1 call to installer::languages::BEGIN@32 # spent 2µs making 1 call to UNIVERSAL::import
33257µs222µs
# spent 19µs (17+3) within installer::languages::BEGIN@33 which was called: # once (17µs+3µs) by installer::scriptitems::BEGIN@33 at line 33
use installer::remover;
# spent 19µs making 1 call to installer::languages::BEGIN@33 # spent 2µs making 1 call to UNIVERSAL::import
3422.41ms211.4ms
# spent 11.4ms (7.07+4.32) within installer::languages::BEGIN@34 which was called: # once (7.07ms+4.32ms) by installer::scriptitems::BEGIN@33 at line 34
use installer::ziplist;
# spent 11.4ms making 1 call to installer::languages::BEGIN@34 # spent 5µs making 1 call to UNIVERSAL::import
35
36#############################################################################
37# Analyzing the laguage list parameter and language list from zip list file
38#############################################################################
39
40sub analyze_languagelist
41
# spent 37µs (32+5) within installer::languages::analyze_languagelist which was called: # once (32µs+5µs) by installer::run at line 124 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer.pm
{
42437µs my $first = $installer::globals::languagelist;
43
4413µs $first =~ s/\_/\,/g; # substituting "_" by ",", in case of dmake definition 01_49
# spent 3µs making 1 call to installer::languages::CORE:subst
45
46 # Products are separated by a "#", if defined in zip-list by a "|". But "get_info_about_languages"
47 # substitutes already "|" to "#". This procedure only knows "#" as product separator.
48 # Different languages for one product are separated by ",". But on the command line the "_" is used.
49 # Therefore "_" is replaced by "," at the beginning of this procedure.
50
5112µs while ($first =~ /^(\S+)\#(\S+?)$/) # Minimal matching, to keep the order of languages
# spent 2µs making 1 call to installer::languages::CORE:match
52 {
53 $first = $1;
54 my $last = $2;
55 unshift(@installer::globals::languageproducts, $last);
56 }
57
58 unshift(@installer::globals::languageproducts, $first);
59}
60
61####################################################
62# Reading languages from zip list file
63####################################################
64
65sub get_info_about_languages
66{
67 my ( $allsettingsarrayref ) = @_;
68
69 my $languagelistref;
70
71 $languagelistref = installer::ziplist::getinfofromziplist($allsettingsarrayref, "languages");
72 $installer::globals::languagelist = $$languagelistref;
73
74 if ( $installer::globals::languagelist eq "" ) # not defined on command line and not in product list
75 {
76 installer::exiter::exit_program("ERROR: Languages not defined on command line (-l) and not in product list!", "get_info_about_languages");
77 }
78
79 # Adapting the separator format from zip list.
80 # | means new product, , (comma) means more than one language in one product
81 # On the command line, | is difficult to use. Therefore this script uses hashes
82
83 $installer::globals::languagelist =~ s/\|/\#/g;
84
85 analyze_languagelist();
86}
87
88#############################################################################
89# Checking whether all elements of an array A are also member of array B
90#############################################################################
91
92sub all_elements_of_array1_in_array2
93
# spent 24µs within installer::languages::all_elements_of_array1_in_array2 which was called: # once (24µs+0s) by installer::languages::get_all_languages_for_one_product at line 208
{
94411µs my ($array1, $array2) = @_;
95
96 my $array2_contains_all_elements_of_array1 = 1;
97
98114µs for ( my $i = 0; $i <= $#{$array1}; $i++ )
99 {
10022µs if (! grep {$_ eq ${$array1}[$i]} @{$array2})
101 {
102 $array2_contains_all_elements_of_array1 = 0;
103 last;
104 }
105 }
106
107 return $array2_contains_all_elements_of_array1;
108}
109
110#############################################
111# All languages defined for one product
112#############################################
113
114sub get_all_languages_for_one_product
115
# spent 2.78ms (1.24+1.53) within installer::languages::get_all_languages_for_one_product which was called: # once (1.24ms+1.53ms) by installer::run at line 500 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer.pm
{
1161040µs my ( $languagestring, $allvariables ) = @_;
117
118 my @languagearray = ();
119
120 my $last = $languagestring;
121
122 $installer::globals::ismultilingual = 0; # setting the global variable $ismultilingual !
1231500ns13µs if ( $languagestring =~ /\,/ ) { $installer::globals::ismultilingual = 1; }
# spent 3µs making 1 call to installer::languages::CORE:match
124
12516µs while ( $last =~ /^\s*(.+?)\,(.+)\s*$/) # "$" for minimal matching, comma separated list
# spent 6µs making 1 call to installer::languages::CORE:match
126 {
1274321.33ms my $first = $1;
128 $last = $2;
1291081.14ms installer::remover::remove_leading_and_ending_whitespaces(\$first);
# spent 1.14ms making 108 calls to installer::remover::remove_leading_and_ending_whitespaces, avg 11µs/call
130108350µs push(@languagearray, "$first");
# spent 350µs making 108 calls to installer::languages::CORE:match, avg 3µs/call
131 }
132
133110µs installer::remover::remove_leading_and_ending_whitespaces(\$last);
134 push(@languagearray, "$last");
135
136461µs if ( $installer::globals::iswindowsbuild )
137 {
138 my $furthercheck = 1;
139
140 # For some languages (that are not supported by Windows, english needs to be added to the installation set
141
142 # FIXME The script i18npool/source/isolang/langid.pl greps this very
143 # source file to read this array. Be careful!
144 my @noMSLocaleLangs = (
145 "br",
146 "bs",
147 "dz",
148 "gu",
149 "km",
150 "nr",
151 "ns",
152 "nso",
153 "rw",
154 "ss",
155 "st",
156 "tg",
157 "ts",
158 "tn",
159 "ve",
160 "xh",
161 "zu",
162 "ne",
163 "bn",
164 "bn-BD",
165 "bn-IN",
166 "lo",
167 "cy",
168 "ku",
169 "as-IN",
170 "te-IN",
171 "ml-IN",
172 "mr-IN",
173 "ur-IN",
174 "ta-IN",
175 "or-IN",
176 "ti-ER",
177 "eo",
178 "ka",
179 "ga",
180 "uk",
181 "gd",
182 "my",
183 "mai",
184 "brx",
185 "dgo",
186 "kok",
187 "mni",
188 "ca-XV",
189 "sat",
190 "ug",
191 "om",
192 "si",
193 "or",
194 "oc",
195 "ml",
196 "as",
197 "ast",
198 "ht",
199 "jbo",
200 "fur",
201 "ny",
202 "so",
203 "kab",
204 "tk",
205 "ky-CN",
206 );
207
208124µs if ( all_elements_of_array1_in_array2(\@languagearray, \@noMSLocaleLangs) )
209 {
210 my $officestartlanguage = $languagearray[0];
211 unshift(@languagearray, "en-US"); # am Anfang einfügen!
212 $installer::globals::ismultilingual = 1;
213 $installer::globals::added_english = 1;
214 $installer::globals::set_office_start_language = 1;
215 # setting the variable PRODUCTLANGUAGE, needed for Linguistic-ForceDefaultLanguage.xcu
216 $allvariables->{'PRODUCTLANGUAGE'} = $officestartlanguage;
217 $furthercheck = 0;
218 }
219
220 # In bilingual installation sets, in which english is the first language,
221 # the Office start language shall be the second language.
222
22311µs if ( $furthercheck )
224 {
225 if (( $#languagearray == 1 ) && ( $languagearray[0] eq "en-US" ))
226 {
227 my $officestartlanguage = $languagearray[1];
228 $installer::globals::set_office_start_language = 1;
229 # setting the variable PRODUCTLANGUAGE, needed for Linguistic-ForceDefaultLanguage.xcu
230 $allvariables->{'PRODUCTLANGUAGE'} = $officestartlanguage;
231 }
232 }
233 }
234
235 return \@languagearray;
236}
237
238##########################################################
239# Converting the language array into a string for output
240##########################################################
241
242sub get_language_string
243
# spent 158µs (133+25) within installer::languages::get_language_string which was called: # once (133µs+25µs) by installer::run at line 502 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer.pm
{
2445161µs my ($languagesref) = @_;
245
246 my $newstring = "";
247
248 for ( my $i = 0; $i <= $#{$languagesref}; $i++ )
249 {
250 $newstring = $newstring . ${$languagesref}[$i] . "_";
251 }
252
253 # remove ending underline
254
255125µs $newstring =~ s/\_\s*$//;
# spent 25µs making 1 call to installer::languages::CORE:subst
256
257 return \$newstring;
258}
259
260##########################################################
261# Analyzing the languages in the languages array and
262# returning the most important language
263##########################################################
264
265sub get_default_language
266
# spent 19µs within installer::languages::get_default_language which was called 2 times, avg 10µs/call: # once (12µs+0s) by installer::run at line 1696 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer.pm # once (8µs+0s) by installer::scriptitems::add_License_Files_into_Installdir at line 1365 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer/scriptitems.pm
{
267425µs my ($languagesref) = @_;
268
269 return ${$languagesref}[0]; # ToDo, only returning the first language
270}
271
27217µs1;
 
# spent 362µs within installer::languages::CORE:match which was called 111 times, avg 3µs/call: # 108 times (350µs+0s) by installer::languages::get_all_languages_for_one_product at line 130, avg 3µs/call # once (6µs+0s) by installer::languages::get_all_languages_for_one_product at line 125 # once (3µs+0s) by installer::languages::get_all_languages_for_one_product at line 123 # once (2µs+0s) by installer::languages::analyze_languagelist at line 51
sub installer::languages::CORE:match; # opcode
# spent 28µs within installer::languages::CORE:subst which was called 2 times, avg 14µs/call: # once (25µs+0s) by installer::languages::get_language_string at line 255 # once (3µs+0s) by installer::languages::analyze_languagelist at line 44
sub installer::languages::CORE:subst; # opcode