Filename | /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer/parameter.pm |
Statements | Executed 260 statements in 443ms |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
4 | 2 | 1 | 436ms | 436ms | CORE:backtick (opcode) | installer::parameter::
1 | 1 | 1 | 453µs | 538µs | BEGIN@30 | installer::parameter::
3 | 3 | 1 | 293µs | 331ms | make_path_absolute | installer::parameter::
2 | 2 | 1 | 275µs | 275µs | CORE:ftdir (opcode) | installer::parameter::
1 | 1 | 1 | 226µs | 227ms | setglobalvariables | installer::parameter::
1 | 1 | 1 | 198µs | 355µs | outputparameter | installer::parameter::
12 | 6 | 1 | 127µs | 127µs | CORE:subst (opcode) | installer::parameter::
1 | 1 | 1 | 105µs | 214ms | control_required_parameter | installer::parameter::
22 | 12 | 1 | 84µs | 84µs | CORE:match (opcode) | installer::parameter::
1 | 1 | 1 | 65µs | 144µs | saveparameter | installer::parameter::
2 | 2 | 1 | 45µs | 45µs | CORE:regcomp (opcode) | installer::parameter::
1 | 1 | 1 | 44µs | 44µs | getparameter | installer::parameter::
1 | 1 | 1 | 38µs | 40µs | BEGIN@35 | installer::parameter::
1 | 1 | 1 | 15µs | 18µs | BEGIN@31 | installer::parameter::
1 | 1 | 1 | 14µs | 16µs | BEGIN@32 | installer::parameter::
1 | 1 | 1 | 14µs | 43µs | BEGIN@34 | installer::parameter::
1 | 1 | 1 | 13µs | 15µs | BEGIN@36 | installer::parameter::
1 | 1 | 1 | 13µs | 16µs | BEGIN@33 | installer::parameter::
1 | 1 | 1 | 4µs | 4µs | control_fundamental_parameter | installer::parameter::
0 | 0 | 0 | 0s | 0s | usage | installer::parameter::
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::parameter; | ||||
29 | |||||
30 | 2 | 62µs | 2 | 622µs | # spent 538µs (453+85) within installer::parameter::BEGIN@30 which was called:
# once (453µs+85µs) by installer::BEGIN@50 at line 30 # spent 538µs making 1 call to installer::parameter::BEGIN@30
# spent 85µs making 1 call to Exporter::import |
31 | 2 | 53µs | 2 | 21µs | # spent 18µs (15+3) within installer::parameter::BEGIN@31 which was called:
# once (15µs+3µs) by installer::BEGIN@50 at line 31 # spent 18µs making 1 call to installer::parameter::BEGIN@31
# spent 3µs making 1 call to UNIVERSAL::import |
32 | 2 | 52µs | 2 | 18µs | # spent 16µs (14+2) within installer::parameter::BEGIN@32 which was called:
# once (14µs+2µs) by installer::BEGIN@50 at line 32 # spent 16µs making 1 call to installer::parameter::BEGIN@32
# spent 2µs making 1 call to UNIVERSAL::import |
33 | 2 | 52µs | 2 | 18µs | # spent 16µs (13+3) within installer::parameter::BEGIN@33 which was called:
# once (13µs+3µs) by installer::BEGIN@50 at line 33 # spent 16µs making 1 call to installer::parameter::BEGIN@33
# spent 3µs making 1 call to UNIVERSAL::import |
34 | 2 | 53µs | 2 | 71µs | # spent 43µs (14+29) within installer::parameter::BEGIN@34 which was called:
# once (14µs+29µs) by installer::BEGIN@50 at line 34 # spent 43µs making 1 call to installer::parameter::BEGIN@34
# spent 29µs making 1 call to Exporter::import |
35 | 2 | 55µs | 2 | 43µs | # spent 40µs (38+3) within installer::parameter::BEGIN@35 which was called:
# once (38µs+3µs) by installer::BEGIN@50 at line 35 # spent 40µs making 1 call to installer::parameter::BEGIN@35
# spent 3µs making 1 call to UNIVERSAL::import |
36 | 2 | 5.56ms | 2 | 16µs | # spent 15µs (13+1) within installer::parameter::BEGIN@36 which was called:
# once (13µs+1µs) by installer::BEGIN@50 at line 36 # spent 15µs making 1 call to installer::parameter::BEGIN@36
# spent 2µs making 1 call to UNIVERSAL::import |
37 | |||||
38 | ############################################ | ||||
39 | # Parameter Operations | ||||
40 | ############################################ | ||||
41 | |||||
42 | sub usage | ||||
43 | { | ||||
44 | print <<Ende; | ||||
45 | -------------------------------------------------------------------------------- | ||||
46 | The following parameter are needed: | ||||
47 | -f: Path to the product list (required) | ||||
48 | -s: Path to the setup script (optional, if defined in product list) | ||||
49 | -i: Install path of the product (/opt/openofficeorg20) (optional) | ||||
50 | -p: Product from product list to be created (required) | ||||
51 | -l: Language of the product (comma and hash) (optional, defined in productlist) | ||||
52 | -b: Build, e.g. srx645 (optional) | ||||
53 | -m: Minor, e.g. m10 (optional) | ||||
54 | -simple: Path to do a simple install to | ||||
55 | -c: Compiler, e.g. wntmsci8, unxlngi5, unxsols4, ... (optional) | ||||
56 | -u: Path, in which zipfiles are unpacked (optional) | ||||
57 | -msitemplate: Source of the msi file templates (Windows compiler only) | ||||
58 | -msilanguage: Source of the msi file templates (Windows compiler only) | ||||
59 | -buildid: Current BuildID (optional) | ||||
60 | -pro: Product version | ||||
61 | -format: Package format | ||||
62 | -debian: Create Debian packages for Linux | ||||
63 | -dontunzip: do not unzip all files with flag ARCHIVE | ||||
64 | -dontcallepm : do not call epm to create install sets (opt., non-Windows only) | ||||
65 | -ispatchedepm : Usage of a patched (non-standard) epm (opt., non-Windows only) | ||||
66 | -copyproject : is set for projects that are only used for copying (optional) | ||||
67 | -languagepack : do create a languagepack, no product pack (optional) | ||||
68 | -helppack : do create a helppack, no product pack (optional) | ||||
69 | -patch : do create a patch (optional) | ||||
70 | -patchinc: Source for the patch include files (Solaris only) | ||||
71 | -strip: Stripping files (Unix only) | ||||
72 | -log : Logging all available information (optional) | ||||
73 | |||||
74 | Examples for Windows: | ||||
75 | |||||
76 | perl make_epmlist.pl -f zip.lst -p OfficeFAT -l en-US | ||||
77 | -u /export/unpack -buildid 8712 | ||||
78 | -msitemplate /export/msi_files | ||||
79 | -msilanguage /export/msi_languages | ||||
80 | |||||
81 | Examples for Non-Windows: | ||||
82 | |||||
83 | perl make_epmlist.pl -f zip.lst -p OfficeFAT -l en-US -format rpm | ||||
84 | -u /export/unpack -buildid 8712 -ispatchedepm | ||||
85 | -------------------------------------------------------------------------------- | ||||
86 | Ende | ||||
87 | exit(-1); | ||||
88 | } | ||||
89 | |||||
90 | ######################################### | ||||
91 | # Writing all parameter into logfile | ||||
92 | ######################################### | ||||
93 | |||||
94 | sub saveparameter | ||||
95 | # spent 144µs (65+79) within installer::parameter::saveparameter which was called:
# once (65µs+79µs) by installer::run at line 117 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer.pm | ||||
96 | 1 | 2µs | my $include = ""; | ||
97 | |||||
98 | 1 | 3µs | 1 | 79µs | installer::logger::globallog("Command line arguments:"); # spent 79µs making 1 call to installer::logger::globallog |
99 | |||||
100 | 1 | 21µs | for ( my $i = 0; $i <= $#ARGV; $i++ ) | ||
101 | { | ||||
102 | 16 | 11µs | $include = $ARGV[$i] . "\n"; | ||
103 | 16 | 16µs | push(@installer::globals::globallogfileinfo, $include); | ||
104 | } | ||||
105 | |||||
106 | # also saving global settings: | ||||
107 | |||||
108 | 1 | 2µs | $include = "Separator: $installer::globals::separator\n"; | ||
109 | 1 | 7µs | push(@installer::globals::globallogfileinfo, $include); | ||
110 | |||||
111 | } | ||||
112 | |||||
113 | ##################################### | ||||
114 | # Reading parameter | ||||
115 | ##################################### | ||||
116 | |||||
117 | sub getparameter | ||||
118 | # spent 44µs within installer::parameter::getparameter which was called:
# once (44µs+0s) by installer::run at line 118 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer.pm | ||||
119 | 1 | 8µs | while ( $#ARGV >= 0 ) | ||
120 | { | ||||
121 | 8 | 7µs | my $param = shift(@ARGV); | ||
122 | |||||
123 | 9 | 25µs | if ($param eq "-f") { $installer::globals::ziplistname = shift(@ARGV); } | ||
124 | elsif ($param eq "-s") { $installer::globals::setupscriptname = shift(@ARGV); } | ||||
125 | 1 | 1µs | elsif ($param eq "-p") { $installer::globals::product = shift(@ARGV); } | ||
126 | 1 | 1µs | elsif ($param eq "-l") { $installer::globals::languagelist = shift(@ARGV); } | ||
127 | elsif ($param eq "-b") { $installer::globals::build = shift(@ARGV); } | ||||
128 | elsif ($param eq "-m") { $installer::globals::minor = shift(@ARGV); } | ||||
129 | elsif ($param eq "-dontunzip") { $installer::globals::dounzip = 0; } | ||||
130 | elsif ($param eq "-c") { $installer::globals::compiler = shift(@ARGV); } | ||||
131 | elsif ($param eq "-pro") { $installer::globals::pro = 1; } | ||||
132 | 1 | 1µs | elsif ($param eq "-format") { $installer::globals::packageformat = shift(@ARGV); } | ||
133 | elsif ($param eq "-quiet") { $installer::globals::quiet = 1; } | ||||
134 | elsif ($param eq "-verbose") { $installer::globals::quiet = 0; } | ||||
135 | 1 | 1µs | elsif ($param eq "-u") { $installer::globals::unpackpath = shift(@ARGV); } | ||
136 | elsif ($param eq "-i") { $installer::globals::rootpath = shift(@ARGV); } | ||||
137 | elsif ($param eq "-dontcallepm") { $installer::globals::call_epm = 0; } | ||||
138 | 1 | 1µs | elsif ($param eq "-msitemplate") { $installer::globals::idttemplatepath = shift(@ARGV); } | ||
139 | 1 | 1µs | elsif ($param eq "-msilanguage") { $installer::globals::idtlanguagepath = shift(@ARGV); } | ||
140 | elsif ($param eq "-patchinc") { $installer::globals::patchincludepath = shift(@ARGV); } | ||||
141 | 1 | 1µs | elsif ($param eq "-buildid") { $installer::globals::buildid = shift(@ARGV); } | ||
142 | elsif ($param eq "-copyproject") { $installer::globals::is_copy_only_project = 1; } | ||||
143 | elsif ($param eq "-languagepack") { $installer::globals::languagepack = 1; } | ||||
144 | elsif ($param eq "-helppack") { $installer::globals::helppack = 1;} | ||||
145 | elsif ($param eq "-patch") { $installer::globals::patch = 1; } | ||||
146 | elsif ($param eq "-debian") { $installer::globals::debian = 1; } | ||||
147 | elsif ($param eq "-strip") { $installer::globals::strip = 1; } | ||||
148 | elsif ($param eq "-destdir") # new parameter for simple installer | ||||
149 | { | ||||
150 | $installer::globals::rootpath ne "" && die "must set destdir before -i or -simple"; | ||||
151 | |||||
152 | my $path = shift(@ARGV); | ||||
153 | mkdir $path; | ||||
154 | $installer::globals::destdir = Cwd::realpath($path); | ||||
155 | } | ||||
156 | elsif ($param eq "-simple") # new parameter for simple installer | ||||
157 | { | ||||
158 | $installer::globals::simple = 1; | ||||
159 | $installer::globals::call_epm = 0; | ||||
160 | $installer::globals::makedownload = 0; | ||||
161 | my $path = shift(@ARGV); | ||||
162 | $path =~ s/^\Q$installer::globals::destdir\E//; | ||||
163 | $installer::globals::rootpath = $path; | ||||
164 | } | ||||
165 | else | ||||
166 | { | ||||
167 | installer::logger::print_error( "unknown parameter: $param" ); | ||||
168 | usage(); | ||||
169 | exit(-1); | ||||
170 | } | ||||
171 | } | ||||
172 | |||||
173 | # Usage of simple installer (not for Windows): | ||||
174 | # $PERL -w $SOLARENV/bin/make_installer.pl \ | ||||
175 | # -f openoffice.lst -l en-US -p OpenOffice \ | ||||
176 | # -buildid $BUILD -rpm \ | ||||
177 | # -destdir /tmp/nurk -simple $INSTALL_PATH | ||||
178 | } | ||||
179 | |||||
180 | ############################################ | ||||
181 | # Controlling the fundamental parameter | ||||
182 | # (required for every process) | ||||
183 | ############################################ | ||||
184 | |||||
185 | sub control_fundamental_parameter | ||||
186 | # spent 4µs within installer::parameter::control_fundamental_parameter which was called:
# once (4µs+0s) by installer::run at line 120 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer.pm | ||||
187 | 1 | 7µs | if ($installer::globals::product eq "") | ||
188 | { | ||||
189 | installer::logger::print_error( "Product name not set!" ); | ||||
190 | usage(); | ||||
191 | exit(-1); | ||||
192 | } | ||||
193 | } | ||||
194 | |||||
195 | ########################################################## | ||||
196 | # The path parameters can be relative or absolute. | ||||
197 | # This function creates absolute paths. | ||||
198 | ########################################################## | ||||
199 | |||||
200 | sub make_path_absolute | ||||
201 | # spent 331ms (293µs+331) within installer::parameter::make_path_absolute which was called 3 times, avg 110ms/call:
# once (111µs+118ms) by installer::parameter::setglobalvariables at line 361
# once (84µs+107ms) by installer::parameter::control_required_parameter at line 460
# once (98µs+106ms) by installer::parameter::control_required_parameter at line 451 | ||||
202 | 3 | 6µs | my ($pathref) = @_; | ||
203 | |||||
204 | 3 | 2µs | if ( $installer::globals::isunix ) | ||
205 | { | ||||
206 | if (!($$pathref =~ /^\s*\//)) # this is a relative unix path | ||||
207 | { | ||||
208 | $$pathref = cwd() . $installer::globals::separator . $$pathref; | ||||
209 | } | ||||
210 | } | ||||
211 | |||||
212 | 3 | 4µs | if ( $installer::globals::iswin ) | ||
213 | { | ||||
214 | 3 | 50µs | 3 | 28µs | if ( $^O =~ /cygwin/i ) # spent 28µs making 3 calls to installer::parameter::CORE:match, avg 9µs/call |
215 | { | ||||
216 | 3 | 43µs | 6 | 19µs | if ( $$pathref !~ /^\s*\// && $$pathref !~ /^\s*\w\:/ ) # not an absolute POSIX or DOS path # spent 19µs making 6 calls to installer::parameter::CORE:match, avg 3µs/call |
217 | { | ||||
218 | 3 | 23µs | 3 | 47µs | $$pathref = cwd() . $installer::globals::separator . $$pathref; # spent 47µs making 3 calls to Cwd::__ANON__[Cwd.pm:406], avg 16µs/call |
219 | } | ||||
220 | 3 | 4µs | my $p = $$pathref; | ||
221 | 3 | 2µs | chomp( $p ); | ||
222 | 3 | 3µs | my $q = ''; | ||
223 | # Avoid the $(LANG) problem. | ||||
224 | 3 | 15µs | 3 | 3µs | if ($p =~ /(\A.*)(\$\(.*\Z)/) { # spent 3µs making 3 calls to installer::parameter::CORE:match, avg 1µs/call |
225 | $p = $1; | ||||
226 | $q = $2; | ||||
227 | } | ||||
228 | 3 | 19µs | 3 | 4µs | $p =~ s/\\/\\\\/g; # spent 4µs making 3 calls to installer::parameter::CORE:subst, avg 1µs/call |
229 | 3 | 331ms | 3 | 331ms | chomp( $p = qx{cygpath -w "$p"} ); # spent 331ms making 3 calls to installer::parameter::CORE:backtick, avg 110ms/call |
230 | 3 | 14µs | $$pathref = $p.$q; | ||
231 | # Use windows paths, but with '/'s. | ||||
232 | 3 | 121µs | 3 | 88µs | $$pathref =~ s/\\/\//g; # spent 88µs making 3 calls to installer::parameter::CORE:subst, avg 29µs/call |
233 | } | ||||
234 | else | ||||
235 | { | ||||
236 | if (!($$pathref =~ /^\s*\w\:/)) # this is a relative windows path (no dos drive) | ||||
237 | { | ||||
238 | $$pathref = cwd() . $installer::globals::separator . $$pathref; | ||||
239 | |||||
240 | $$pathref =~ s/\//\\/g; | ||||
241 | } | ||||
242 | } | ||||
243 | } | ||||
244 | 3 | 74µs | 3 | 26µs | $$pathref =~ s/[\/\\]\s*$//; # removing ending slashes # spent 26µs making 3 calls to installer::parameter::CORE:subst, avg 9µs/call |
245 | } | ||||
246 | |||||
247 | ################################################## | ||||
248 | # Setting some global parameters | ||||
249 | # This has to be expanded with furher platforms | ||||
250 | ################################################## | ||||
251 | |||||
252 | sub setglobalvariables | ||||
253 | # spent 227ms (226µs+226) within installer::parameter::setglobalvariables which was called:
# once (226µs+226ms) by installer::run at line 121 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer.pm | ||||
254 | # Setting the installertype directory corresponding to the environment variable PKGFORMAT | ||||
255 | # The global variable $installer::globals::packageformat can only contain one package format. | ||||
256 | # If PKGFORMAT cotains more than one format (for example "rpm deb") this is splitted in the | ||||
257 | # makefile calling the perl program. | ||||
258 | 1 | 1µs | $installer::globals::installertypedir = $installer::globals::packageformat; | ||
259 | |||||
260 | 1 | 24µs | 1 | 15µs | if ( $installer::globals::compiler =~ /wnt(msc|gcc)i/ ) # spent 15µs making 1 call to installer::parameter::CORE:match |
261 | { | ||||
262 | 1 | 500ns | $installer::globals::iswindowsbuild = 1; | ||
263 | } | ||||
264 | |||||
265 | 1 | 6µs | 1 | 2µs | if ( $installer::globals::compiler =~ /unxso[lg][siux]/ ) # spent 2µs making 1 call to installer::parameter::CORE:match |
266 | { | ||||
267 | $installer::globals::issolarisbuild = 1; | ||||
268 | if ( $installer::globals::packageformat eq "pkg" ) | ||||
269 | { | ||||
270 | $installer::globals::issolarispkgbuild = 1; | ||||
271 | $installer::globals::epmoutpath = "packages"; | ||||
272 | } | ||||
273 | } | ||||
274 | |||||
275 | 1 | 8µs | 2 | 2µs | if (( $installer::globals::compiler =~ /unxmacxi/ ) || ( $installer::globals::compiler =~ /unxmacxp/ )) # spent 2µs making 2 calls to installer::parameter::CORE:match, avg 750ns/call |
276 | { | ||||
277 | $installer::globals::ismacbuild = 1; | ||||
278 | |||||
279 | if ( $installer::globals::packageformat eq "dmg" ) | ||||
280 | { | ||||
281 | $installer::globals::ismacdmgbuild = 1; | ||||
282 | } | ||||
283 | } | ||||
284 | |||||
285 | 1 | 8µs | 1 | 1µs | if ( $installer::globals::compiler =~ /unxobsd/ ) # spent 1µs making 1 call to installer::parameter::CORE:match |
286 | { | ||||
287 | $installer::globals::epmoutpath = "openbsd"; | ||||
288 | } | ||||
289 | |||||
290 | 1 | 5µs | 1 | 1µs | if ( $installer::globals::compiler =~ /unxfbsd/ ) # spent 1µs making 1 call to installer::parameter::CORE:match |
291 | { | ||||
292 | $installer::globals::isfreebsdbuild = 1; | ||||
293 | |||||
294 | if ( $installer::globals::packageformat eq "bsd" ) | ||||
295 | { | ||||
296 | $installer::globals::epmoutpath = "freebsd"; | ||||
297 | $installer::globals::isfreebsdpkgbuild = 1; | ||||
298 | } | ||||
299 | } | ||||
300 | |||||
301 | 1 | 5µs | 1 | 500ns | if ( $installer::globals::compiler =~ /unxso[lg]s/ ) { $installer::globals::issolarissparcbuild = 1; } # spent 500ns making 1 call to installer::parameter::CORE:match |
302 | |||||
303 | 1 | 5µs | 1 | 1µs | if ( $installer::globals::compiler =~ /unxso[lg]i/ ) { $installer::globals::issolarisx86build = 1; } # spent 1µs making 1 call to installer::parameter::CORE:match |
304 | |||||
305 | 1 | 2µs | if ($ENV{OS} eq 'AIX') | ||
306 | { | ||||
307 | if ( $installer::globals::packageformat eq "rpm" ) | ||||
308 | { | ||||
309 | $installer::globals::isrpmbuild = 1; | ||||
310 | $installer::globals::epmoutpath = "RPMS"; | ||||
311 | } | ||||
312 | if ( $installer::globals::rpm eq "" ) { installer::exiter::exit_program("ERROR: Environment variable \"\$RPM\" has to be defined!", "setglobalvariables"); } | ||||
313 | } | ||||
314 | |||||
315 | 1 | 1µs | if ($ENV{OS} eq 'LINUX') | ||
316 | { | ||||
317 | $installer::globals::islinuxbuild = 1; | ||||
318 | if ( $installer::globals::packageformat eq "rpm" ) | ||||
319 | { | ||||
320 | $installer::globals::isrpmbuild = 1; | ||||
321 | $installer::globals::epmoutpath = "RPMS"; | ||||
322 | |||||
323 | if ( $installer::globals::rpm eq "" ) { installer::exiter::exit_program("ERROR: Environment variable \"\$RPM\" has to be defined!", "setglobalvariables"); } | ||||
324 | } | ||||
325 | |||||
326 | # Creating Debian packages ? | ||||
327 | if (( $installer::globals::packageformat eq "deb" ) || ( $installer::globals::debian )) | ||||
328 | { | ||||
329 | $installer::globals::debian = 1; | ||||
330 | $installer::globals::packageformat = "deb"; | ||||
331 | my $message = "Creating Debian packages"; | ||||
332 | installer::logger::print_message( $message ); | ||||
333 | push(@installer::globals::globallogfileinfo, $message); | ||||
334 | $installer::globals::isrpmbuild = 0; | ||||
335 | $installer::globals::isdebbuild = 1; | ||||
336 | $installer::globals::epmoutpath = "DEBS"; | ||||
337 | } | ||||
338 | } | ||||
339 | |||||
340 | # Defaulting to native package format for epm | ||||
341 | |||||
342 | 1 | 600ns | if ( ! $installer::globals::packageformat ) { $installer::globals::packageformat = "native"; } | ||
343 | |||||
344 | # extension, if $installer::globals::pro is set | ||||
345 | 2 | 2µs | if ($installer::globals::pro) { $installer::globals::productextension = ".pro"; } | ||
346 | |||||
347 | # no languages defined as parameter | ||||
348 | 1 | 500ns | if ($installer::globals::languagelist eq "") { $installer::globals::languages_defined_in_productlist = 1; } | ||
349 | |||||
350 | # setting and creating the unpackpath | ||||
351 | |||||
352 | 1 | 600ns | if ($installer::globals::unpackpath eq "") # unpackpath not set | ||
353 | { | ||||
354 | $installer::globals::unpackpath = cwd(); | ||||
355 | } | ||||
356 | |||||
357 | 1 | 1µs | if ( $installer::globals::localunpackdir ne "" ) { $installer::globals::unpackpath = $installer::globals::localunpackdir; } | ||
358 | |||||
359 | 1 | 2µs | if (!($installer::globals::unpackpath eq "")) | ||
360 | { | ||||
361 | 1 | 4µs | 1 | 118ms | make_path_absolute(\$installer::globals::unpackpath); # spent 118ms making 1 call to installer::parameter::make_path_absolute |
362 | } | ||||
363 | |||||
364 | 1 | 52µs | 2 | 36µs | $installer::globals::unpackpath =~ s/\Q$installer::globals::separator\E\s*$//; # spent 32µs making 1 call to installer::parameter::CORE:regcomp
# spent 3µs making 1 call to installer::parameter::CORE:subst |
365 | |||||
366 | 1 | 190µs | 1 | 177µs | if (! -d $installer::globals::unpackpath ) # create unpackpath # spent 177µs making 1 call to installer::parameter::CORE:ftdir |
367 | { | ||||
368 | installer::systemactions::create_directory($installer::globals::unpackpath); | ||||
369 | } | ||||
370 | |||||
371 | # setting and creating the temppath | ||||
372 | |||||
373 | 1 | 6µs | if (( $ENV{'TMP'} ) || ( $ENV{'TEMP'} ) || ( $ENV{'TMPDIR'} )) | ||
374 | { | ||||
375 | 2 | 5µs | if ( $ENV{'TMP'} ) { $installer::globals::temppath = $ENV{'TMP'}; } | ||
376 | elsif ( $ENV{'TEMP'} ) { $installer::globals::temppath = $ENV{'TEMP'}; } | ||||
377 | elsif ( $ENV{'TMPDIR'} ) { $installer::globals::temppath = $ENV{'TMPDIR'}; } | ||||
378 | 1 | 29µs | 2 | 16µs | $installer::globals::temppath =~ s/\Q$installer::globals::separator\E\s*$//; # removing ending slashes and backslashes # spent 12µs making 1 call to installer::parameter::CORE:regcomp
# spent 3µs making 1 call to installer::parameter::CORE:subst |
379 | 1 | 4µs | $installer::globals::temppath .= $installer::globals::separator . 'ooopackaging'; | ||
380 | 1 | 9µs | 1 | 572µs | installer::systemactions::create_directory_with_privileges($installer::globals::temppath, "777"); # spent 572µs making 1 call to installer::systemactions::create_directory_with_privileges |
381 | 1 | 2µs | my $dirsave = $installer::globals::temppath; | ||
382 | |||||
383 | 1 | 9µs | 1 | 4µs | if ( $installer::globals::compiler =~ /^unxmac/ ) # spent 4µs making 1 call to installer::parameter::CORE:match |
384 | { | ||||
385 | chmod 0777, $installer::globals::temppath; | ||||
386 | } | ||||
387 | |||||
388 | 1 | 2µs | $installer::globals::temppath = $installer::globals::temppath . $installer::globals::separator . "i"; | ||
389 | 1 | 6µs | 1 | 1.62ms | $installer::globals::temppath = installer::systemactions::create_pid_directory($installer::globals::temppath); # spent 1.62ms making 1 call to installer::systemactions::create_pid_directory |
390 | 1 | 3µs | push(@installer::globals::removedirs, $installer::globals::temppath); | ||
391 | |||||
392 | 1 | 105µs | 1 | 98µs | if ( ! -d $installer::globals::temppath ) { installer::exiter::exit_program("ERROR: Failed to create directory $installer::globals::temppath ! Possible reason: Wrong privileges in directory $dirsave .", "setglobalvariables"); } # spent 98µs making 1 call to installer::parameter::CORE:ftdir |
393 | |||||
394 | 1 | 4µs | $installer::globals::temppath = $installer::globals::temppath . $installer::globals::separator . $installer::globals::compiler . $installer::globals::productextension; | ||
395 | 1 | 4µs | 1 | 983µs | installer::systemactions::create_directory($installer::globals::temppath); # spent 983µs making 1 call to installer::systemactions::create_directory |
396 | 1 | 16µs | 1 | 9µs | if ( $^O =~ /cygwin/i ) # spent 9µs making 1 call to installer::parameter::CORE:match |
397 | { | ||||
398 | 1 | 2µs | $installer::globals::cyg_temppath = $installer::globals::temppath; | ||
399 | 1 | 7µs | 1 | 2µs | $installer::globals::cyg_temppath =~ s/\\/\\\\/g; # spent 2µs making 1 call to installer::parameter::CORE:subst |
400 | 1 | 105ms | 1 | 105ms | chomp( $installer::globals::cyg_temppath = qx{cygpath -w "$installer::globals::cyg_temppath"} ); # spent 105ms making 1 call to installer::parameter::CORE:backtick |
401 | } | ||||
402 | 1 | 3µs | $installer::globals::temppathdefined = 1; | ||
403 | } | ||||
404 | else | ||||
405 | { | ||||
406 | $installer::globals::temppathdefined = 0; | ||||
407 | } | ||||
408 | |||||
409 | # only one cab file, if Windows msp patches shall be prepared | ||||
410 | 1 | 13µs | if ( $installer::globals::prepare_winpatch ) { $installer::globals::number_of_cabfiles = 1; } | ||
411 | |||||
412 | } | ||||
413 | |||||
414 | ############################################ | ||||
415 | # Controlling the parameter that are | ||||
416 | # required for special processes | ||||
417 | ############################################ | ||||
418 | |||||
419 | sub control_required_parameter | ||||
420 | # spent 214ms (105µs+214) within installer::parameter::control_required_parameter which was called:
# once (105µs+214ms) by installer::run at line 122 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer.pm | ||||
421 | 1 | 2µs | if (!($installer::globals::is_copy_only_project)) | ||
422 | { | ||||
423 | ############################################################################################## | ||||
424 | # idt template path. Only required for Windows build ($installer::globals::compiler =~ /wntmsci/) | ||||
425 | # for the creation of the msi database. | ||||
426 | ############################################################################################## | ||||
427 | |||||
428 | 1 | 2µs | if (($installer::globals::idttemplatepath eq "") && ($installer::globals::iswindowsbuild)) | ||
429 | { | ||||
430 | installer::logger::print_error( "idt template path not set (-msitemplate)!" ); | ||||
431 | usage(); | ||||
432 | exit(-1); | ||||
433 | } | ||||
434 | |||||
435 | ############################################################################################## | ||||
436 | # idt language path. Only required for Windows build ($installer::globals::compiler =~ /wntmsci/) | ||||
437 | # for the creation of the msi database. | ||||
438 | ############################################################################################## | ||||
439 | |||||
440 | 1 | 2µs | if (($installer::globals::idtlanguagepath eq "") && ($installer::globals::iswindowsbuild)) | ||
441 | { | ||||
442 | installer::logger::print_error( "idt language path not set (-msilanguage)!" ); | ||||
443 | usage(); | ||||
444 | exit(-1); | ||||
445 | } | ||||
446 | |||||
447 | # Analyzing the idt template path | ||||
448 | |||||
449 | 1 | 1µs | if (!($installer::globals::idttemplatepath eq "")) # idttemplatepath set, relative or absolute? | ||
450 | { | ||||
451 | 1 | 6µs | 1 | 106ms | make_path_absolute(\$installer::globals::idttemplatepath); # spent 106ms making 1 call to installer::parameter::make_path_absolute |
452 | } | ||||
453 | |||||
454 | 1 | 9µs | 1 | 71µs | installer::remover::remove_ending_pathseparator(\$installer::globals::idttemplatepath); # spent 71µs making 1 call to installer::remover::remove_ending_pathseparator |
455 | |||||
456 | # Analyzing the idt language path | ||||
457 | |||||
458 | 1 | 4µs | if (!($installer::globals::idtlanguagepath eq "")) # idtlanguagepath set, relative or absolute? | ||
459 | { | ||||
460 | 1 | 5µs | 1 | 107ms | make_path_absolute(\$installer::globals::idtlanguagepath); # spent 107ms making 1 call to installer::parameter::make_path_absolute |
461 | } | ||||
462 | |||||
463 | 1 | 9µs | 1 | 27µs | installer::remover::remove_ending_pathseparator(\$installer::globals::idtlanguagepath); # spent 27µs making 1 call to installer::remover::remove_ending_pathseparator |
464 | |||||
465 | # In the msi template directory a files "codes.txt" has to exist, in which the ProductCode | ||||
466 | # and the UpgradeCode for the product are defined. | ||||
467 | # The name "codes.txt" can be overwritten in Product definition with CODEFILENAME (msiglobal.pm) | ||||
468 | |||||
469 | 1 | 5µs | if (( $installer::globals::iswindowsbuild ) && ( $installer::globals::packageformat ne "archive" ) && ( $installer::globals::packageformat ne "installed" )) | ||
470 | { | ||||
471 | 1 | 4µs | $installer::globals::codefilename = $installer::globals::idttemplatepath . $installer::globals::separator . $installer::globals::codefilename; | ||
472 | 1 | 6µs | 1 | 300µs | installer::files::check_file($installer::globals::codefilename); # spent 300µs making 1 call to installer::files::check_file |
473 | 1 | 4µs | $installer::globals::componentfilename = $installer::globals::idttemplatepath . $installer::globals::separator . $installer::globals::componentfilename; | ||
474 | 1 | 3µs | 1 | 174µs | installer::files::check_file($installer::globals::componentfilename); # spent 174µs making 1 call to installer::files::check_file |
475 | } | ||||
476 | |||||
477 | } | ||||
478 | |||||
479 | ####################################### | ||||
480 | # Patch currently only available | ||||
481 | # for Solaris packages and Linux | ||||
482 | ####################################### | ||||
483 | |||||
484 | 1 | 2µs | if (( $installer::globals::patch ) && ( ! $installer::globals::issolarispkgbuild ) && ( ! $installer::globals::isrpmbuild ) && ( ! $installer::globals::isdebbuild ) && ( ! $installer::globals::iswindowsbuild ) && ( ! $installer::globals::ismacdmgbuild )) | ||
485 | { | ||||
486 | installer::logger::print_error( "Sorry, Patch flag currently only available for Solaris pkg, Linux RPM and Windows builds!" ); | ||||
487 | usage(); | ||||
488 | exit(-1); | ||||
489 | } | ||||
490 | |||||
491 | 1 | 1µs | if (( $installer::globals::patch ) && ( $installer::globals::issolarispkgbuild ) && ( ! $installer::globals::patchincludepath )) | ||
492 | { | ||||
493 | installer::logger::print_error( "Solaris patch requires parameter -patchinc !" ); | ||||
494 | usage(); | ||||
495 | exit(-1); | ||||
496 | } | ||||
497 | |||||
498 | 1 | 600ns | if (( $installer::globals::patch ) && ( $installer::globals::issolarispkgbuild ) && ( $installer::globals::patchincludepath )) | ||
499 | { | ||||
500 | make_path_absolute(\$installer::globals::patchincludepath); | ||||
501 | $installer::globals::patchincludepath = installer::converter::make_path_conform($installer::globals::patchincludepath); | ||||
502 | } | ||||
503 | |||||
504 | ####################################### | ||||
505 | # Testing existence of files | ||||
506 | # also for copy-only projects | ||||
507 | ####################################### | ||||
508 | |||||
509 | 1 | 3µs | if ($installer::globals::ziplistname eq "") | ||
510 | { | ||||
511 | installer::logger::print_error( "ERROR: Zip list file has to be defined (Parameter -f) !" ); | ||||
512 | usage(); | ||||
513 | exit(-1); | ||||
514 | } | ||||
515 | else | ||||
516 | { | ||||
517 | 1 | 4µs | 1 | 109µs | installer::files::check_file($installer::globals::ziplistname); # spent 109µs making 1 call to installer::files::check_file |
518 | } | ||||
519 | |||||
520 | 2 | 11µs | if ($installer::globals::setupscriptname eq "") { $installer::globals::setupscript_defined_in_productlist = 1; } | ||
521 | else { installer::files::check_file($installer::globals::setupscriptname); } # if the setupscript file is defined, it has to exist | ||||
522 | |||||
523 | } | ||||
524 | |||||
525 | ################################################ | ||||
526 | # Writing parameter to shell and into logfile | ||||
527 | ################################################ | ||||
528 | |||||
529 | sub outputparameter | ||||
530 | # spent 355µs (198+157) within installer::parameter::outputparameter which was called:
# once (198µs+157µs) by installer::run at line 125 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer.pm | ||||
531 | 1 | 500ns | my $element; | ||
532 | |||||
533 | 1 | 2µs | my @output = (); | ||
534 | |||||
535 | 1 | 3µs | push(@output, "\n########################################################\n"); | ||
536 | 1 | 3µs | push(@output, "Product list file: $installer::globals::ziplistname\n"); | ||
537 | 1 | 2µs | if (!($installer::globals::setupscript_defined_in_productlist)) | ||
538 | { | ||||
539 | push(@output, "Setup script: $installer::globals::setupscriptname\n"); | ||||
540 | } | ||||
541 | else | ||||
542 | { | ||||
543 | 1 | 2µs | push(@output, "Taking setup script from solver\n"); | ||
544 | } | ||||
545 | 1 | 4µs | push(@output, "Unpackpath: $installer::globals::unpackpath\n"); | ||
546 | 1 | 4µs | push(@output, "Compiler: $installer::globals::compiler\n"); | ||
547 | 1 | 6µs | push(@output, "Product: $installer::globals::product\n"); | ||
548 | 1 | 2µs | push(@output, "BuildID: $installer::globals::buildid\n"); | ||
549 | 1 | 3µs | push(@output, "Build: $installer::globals::build\n"); | ||
550 | 1 | 1µs | if ( $installer::globals::minor ) { push(@output, "Minor: $installer::globals::minor\n"); } | ||
551 | 1 | 1µs | else { push(@output, "No minor set\n"); } | ||
552 | 1 | 2µs | if ( $installer::globals::pro ) { push(@output, "Product version\n"); } | ||
553 | else { push(@output, "Non-Product version\n"); } | ||||
554 | 1 | 2µs | if ( $installer::globals::rootpath eq "" ) { push(@output, "Using default installpath\n"); } | ||
555 | else { push(@output, "Installpath: $installer::globals::rootpath\n"); } | ||||
556 | 1 | 3µs | push(@output, "Package format: $installer::globals::packageformat\n"); | ||
557 | 1 | 4µs | if (!($installer::globals::idttemplatepath eq "")) { push(@output, "msi templatepath: $installer::globals::idttemplatepath\n"); } | ||
558 | 1 | 1µs | if ((!($installer::globals::idttemplatepath eq "")) && (!($installer::globals::iswindowsbuild))) { push(@output, "msi template path will be ignored for non Windows builds!\n"); } | ||
559 | 1 | 3µs | if (!($installer::globals::idtlanguagepath eq "")) { push(@output, "msi languagepath: $installer::globals::idtlanguagepath\n"); } | ||
560 | 1 | 500ns | if ((!($installer::globals::idtlanguagepath eq "")) && (!($installer::globals::iswindowsbuild))) { push(@output, "msi language path will be ignored for non Windows builds!\n"); } | ||
561 | 1 | 600ns | if ((!($installer::globals::iswindowsbuild)) && ( $installer::globals::call_epm )) { push(@output, "Calling epm\n"); } | ||
562 | 1 | 500ns | if ((!($installer::globals::iswindowsbuild)) && (!($installer::globals::call_epm))) { push(@output, "Not calling epm\n"); } | ||
563 | 1 | 500ns | if ( $installer::globals::patchincludepath ) { push(@output, "Patch include path: $installer::globals::patchincludepath\n"); } | ||
564 | 1 | 2µs | if ( $installer::globals::strip ) { push(@output, "Stripping files\n"); } | ||
565 | 1 | 2µs | else { push(@output, "No file stripping\n"); } | ||
566 | 1 | 500ns | if ( $installer::globals::debian ) { push(@output, "Linux: Creating Debian packages\n"); } | ||
567 | 1 | 1µs | if ( $installer::globals::dounzip ) { push(@output, "Unzip ARCHIVE files\n"); } | ||
568 | else { push(@output, "Not unzipping ARCHIVE files\n"); } | ||||
569 | 1 | 2µs | if (!($installer::globals::languages_defined_in_productlist)) | ||
570 | { | ||||
571 | 1 | 2µs | push(@output, "Languages:\n"); | ||
572 | 2 | 7µs | foreach $element (@installer::globals::languageproducts) { push(@output, "\t$element\n"); } | ||
573 | } | ||||
574 | else | ||||
575 | { | ||||
576 | push(@output, "Languages defined in $installer::globals::ziplistname\n"); | ||||
577 | } | ||||
578 | 1 | 600ns | if ( $installer::globals::is_copy_only_project ) { push(@output, "This is a copy only project!\n"); } | ||
579 | 1 | 500ns | if ( $installer::globals::languagepack ) { push(@output, "Creating language pack!\n"); } | ||
580 | 1 | 0s | if ( $installer::globals::helppack ) { push(@output, "Creating help pack!\n"); } | ||
581 | 1 | 600ns | if ( $installer::globals::patch ) { push(@output, "Creating patch!\n"); } | ||
582 | 1 | 1µs | push(@output, "########################################################\n"); | ||
583 | |||||
584 | # output into shell and into logfile | ||||
585 | |||||
586 | 1 | 37µs | for ( my $i = 0; $i <= $#output; $i++ ) | ||
587 | { | ||||
588 | 19 | 47µs | 19 | 157µs | installer::logger::print_message( $output[$i] ); # spent 157µs making 19 calls to installer::logger::print_message, avg 8µs/call |
589 | 19 | 24µs | push(@installer::globals::globallogfileinfo, $output[$i]); | ||
590 | } | ||||
591 | } | ||||
592 | |||||
593 | 1 | 9µs | 1; | ||
sub installer::parameter::CORE:backtick; # opcode | |||||
sub installer::parameter::CORE:ftdir; # opcode | |||||
# spent 84µs within installer::parameter::CORE:match which was called 22 times, avg 4µs/call:
# 6 times (19µs+0s) by installer::parameter::make_path_absolute at line 216, avg 3µs/call
# 3 times (28µs+0s) by installer::parameter::make_path_absolute at line 214, avg 9µs/call
# 3 times (3µs+0s) by installer::parameter::make_path_absolute at line 224, avg 1µs/call
# 2 times (2µs+0s) by installer::parameter::setglobalvariables at line 275, avg 750ns/call
# once (15µs+0s) by installer::parameter::setglobalvariables at line 260
# once (9µs+0s) by installer::parameter::setglobalvariables at line 396
# once (4µs+0s) by installer::parameter::setglobalvariables at line 383
# once (2µs+0s) by installer::parameter::setglobalvariables at line 265
# once (1µs+0s) by installer::parameter::setglobalvariables at line 285
# once (1µs+0s) by installer::parameter::setglobalvariables at line 303
# once (1µs+0s) by installer::parameter::setglobalvariables at line 290
# once (500ns+0s) by installer::parameter::setglobalvariables at line 301 | |||||
sub installer::parameter::CORE:regcomp; # opcode | |||||
# spent 127µs within installer::parameter::CORE:subst which was called 12 times, avg 11µs/call:
# 3 times (88µs+0s) by installer::parameter::make_path_absolute at line 232, avg 29µs/call
# 3 times (26µs+0s) by installer::parameter::make_path_absolute at line 244, avg 9µs/call
# 3 times (4µs+0s) by installer::parameter::make_path_absolute at line 228, avg 1µs/call
# once (3µs+0s) by installer::parameter::setglobalvariables at line 364
# once (3µs+0s) by installer::parameter::setglobalvariables at line 378
# once (2µs+0s) by installer::parameter::setglobalvariables at line 399 |