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

Filename/cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer/windows/media.pm
StatementsExecuted 190716 statements in 160ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
111158ms159msinstaller::windows::media::::create_media_tableinstaller::windows::media::create_media_table
111393µs396µsinstaller::windows::media::::BEGIN@30installer::windows::media::BEGIN@30
11148µs56µsinstaller::windows::media::::generate_cab_filename_for_some_cabsinstaller::windows::media::generate_cab_filename_for_some_cabs
33120µs20µsinstaller::windows::media::::CORE:substinstaller::windows::media::CORE:subst (opcode)
11117µs17µsinstaller::windows::media::::get_maximum_filenumberinstaller::windows::media::get_maximum_filenumber
11117µs17µsinstaller::windows::media::::get_media_diskidinstaller::windows::media::get_media_diskid
11114µs16µsinstaller::windows::media::::BEGIN@33installer::windows::media::BEGIN@33
11114µs16µsinstaller::windows::media::::BEGIN@31installer::windows::media::BEGIN@31
11114µs16µsinstaller::windows::media::::BEGIN@32installer::windows::media::BEGIN@32
1115µs5µsinstaller::windows::media::::get_media_volumelabelinstaller::windows::media::get_media_volumelabel
1114µs4µsinstaller::windows::media::::get_media_sourceinstaller::windows::media::get_media_source
1114µs4µsinstaller::windows::media::::get_media_diskpromptinstaller::windows::media::get_media_diskprompt
0000s0sinstaller::windows::media::::generate_cab_filenameinstaller::windows::media::generate_cab_filename
0000s0sinstaller::windows::media::::get_cabfilenameinstaller::windows::media::get_cabfilename
0000s0sinstaller::windows::media::::get_last_sequenceinstaller::windows::media::get_last_sequence
0000s0sinstaller::windows::media::::get_media_cabinetinstaller::windows::media::get_media_cabinet
0000s0sinstaller::windows::media::::get_media_lastsequenceinstaller::windows::media::get_media_lastsequence
0000s0sinstaller::windows::media::::set_cabinetfilename_for_component_in_file_collectorinstaller::windows::media::set_cabinetfilename_for_component_in_file_collector
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::windows::media;
29
30266µs2399µs
# spent 396µs (393+3) within installer::windows::media::BEGIN@30 which was called: # once (393µs+3µs) by installer::BEGIN@73 at line 30
use installer::exiter;
# spent 396µs making 1 call to installer::windows::media::BEGIN@30 # spent 3µs making 1 call to UNIVERSAL::import
31254µs218µs
# spent 16µs (14+2) within installer::windows::media::BEGIN@31 which was called: # once (14µs+2µs) by installer::BEGIN@73 at line 31
use installer::files;
# spent 16µs making 1 call to installer::windows::media::BEGIN@31 # spent 2µs making 1 call to UNIVERSAL::import
32251µs219µs
# spent 16µs (14+3) within installer::windows::media::BEGIN@32 which was called: # once (14µs+3µs) by installer::BEGIN@73 at line 32
use installer::globals;
# spent 16µs making 1 call to installer::windows::media::BEGIN@32 # spent 3µs making 1 call to UNIVERSAL::import
3322.20ms218µs
# spent 16µs (14+2) within installer::windows::media::BEGIN@33 which was called: # once (14µs+2µs) by installer::BEGIN@73 at line 33
use installer::windows::idtglobal;
# spent 16µs making 1 call to installer::windows::media::BEGIN@33 # spent 2µs making 1 call to UNIVERSAL::import
34
35##############################################################
36# Returning the diskid for the media table.
37##############################################################
38
39sub get_media_diskid
40
# spent 17µs within installer::windows::media::get_media_diskid which was called: # once (17µs+0s) by installer::windows::media::create_media_table at line 287
{
41230µs my ($id) = @_;
42
43 return $id;
44}
45
46##############################################################
47# Returning the lastsequence for the media table.
48##############################################################
49
50sub get_media_lastsequence
51{
52 my ($fileref) = @_;
53
54 return $fileref->{'sequencenumber'};
55}
56
57##############################################################
58# Returning the diskprompt for the media table.
59##############################################################
60
61sub get_media_diskprompt
62
# spent 4µs within installer::windows::media::get_media_diskprompt which was called: # once (4µs+0s) by installer::windows::media::create_media_table at line 289
{
6319µs return 1;
64}
65
66##############################################################
67# Returning the cabinet file name for the media table.
68##############################################################
69
70sub get_media_cabinet
71{
72 my ($id) = @_;
73
74 my $number = 1000 + $id;
75 my $filename = "f_" . $number . ".cab";
76
77 if ( $installer::globals::include_cab_in_msi ) { $filename = "\#" . $filename; }
78
79 return $filename;
80}
81
82##############################################################
83# Returning the volumelabel for the media table.
84##############################################################
85
86sub get_media_volumelabel
87
# spent 5µs within installer::windows::media::get_media_volumelabel which was called: # once (5µs+0s) by installer::windows::media::create_media_table at line 291
{
88111µs return "DISK1";
89}
90
91##############################################################
92# Returning the source for the media table.
93##############################################################
94
95sub get_media_source
96
# spent 4µs within installer::windows::media::get_media_source which was called: # once (4µs+0s) by installer::windows::media::create_media_table at line 292
{
97110µs return "";
98}
99
100##############################################################
101# Saving the cabinet file name in the files collector.
102# This is useful for making a list to connect the
103# source of each file with the destination cabinet file.
104##############################################################
105
106sub set_cabinetfilename_for_component_in_file_collector
107{
108 my ($cabinetfilename, $filesref, $componentname, $max) = @_;
109
110 for ( my $i = 0; $i <= $max; $i++ )
111 {
112 my $onefile = ${$filesref}[$i];
113 my $component = $onefile->{'componentname'};
114
115 if ( $component eq $componentname )
116 {
117 my $cabinet = "";
118
119 if ( $onefile->{'cabinet'} ) { $cabinet = $onefile->{'cabinet'}; }
120
121 if ( $cabinet eq "" )
122 {
123 $onefile->{'cabinet'} = $cabinetfilename;
124 }
125 }
126 }
127}
128
129#################################################
130# Creating the cab file name dynamically
131#################################################
132
133sub generate_cab_filename_for_some_cabs
134
# spent 56µs (48+8) within installer::windows::media::generate_cab_filename_for_some_cabs which was called: # once (48µs+8µs) by installer::windows::media::create_media_table at line 290
{
135961µs my ( $allvariables, $id ) = @_;
136
137 my $name = $allvariables->{'PRODUCTNAME'};
138
139 $name = lc($name);
14015µs $name =~ s/\.//g;
# spent 5µs making 1 call to installer::windows::media::CORE:subst
14113µs $name =~ s/\s//g;
# spent 3µs making 1 call to installer::windows::media::CORE:subst
142
143 # possibility to overwrite the name with variable CABFILENAME
144 if ( $allvariables->{'CABFILENAME'} ) { $name = $allvariables->{'CABFILENAME'}; }
145
146 $name = $name . $id . ".cab";
147
148 if ( $installer::globals::include_cab_in_msi ) { $name = "\#" . $name; }
149
150 return $name;
151}
152
153#################################################
154# Creating the cab file name for cab files
155# defined in packages.
156#################################################
157
158sub get_cabfilename
159{
160 my ($name) = @_;
161
162 if ( $installer::globals::include_cab_in_msi ) { $name = "\#" . $name; }
163
164 return $name;
165}
166
167#################################################
168# Creating the cab file name dynamically
169#################################################
170
171sub generate_cab_filename
172{
173 my ( $allvariables ) = @_;
174
175 my $name = $allvariables->{'PRODUCTNAME'};
176
177 $name = lc($name);
178 $name =~ s/\.//g;
179 $name =~ s/\s//g;
180
181 # possibility to overwrite the name with variable CABFILENAME
182 if ( $allvariables->{'CABFILENAME'} ) { $name = $allvariables->{'CABFILENAME'}; }
183
184 $name = $name . ".cab";
185
186 if ( $installer::globals::include_cab_in_msi ) { $name = "\#" . $name; }
187
188 return $name;
189}
190
191sub get_maximum_filenumber
192
# spent 17µs within installer::windows::media::get_maximum_filenumber which was called: # once (17µs+0s) by installer::windows::media::create_media_table at line 254
{
193623µs my ($allfiles, $maxcabfilenumber) = @_;
194
195 my $maxfile = 0;
196
197 while ( ! ( $allfiles%$maxcabfilenumber == 0 ))
198 {
199 $allfiles++;
200 }
201
202 $maxfile = $allfiles / $maxcabfilenumber;
203
204 $maxfile++; # for securitry
205
206 return $maxfile;
207}
208
209#################################################################################
210# Setting the last sequence for the cabinet files
211#################################################################################
212
213sub get_last_sequence
214{
215 my ( $cabfilename, $alludpatelastsequences ) = @_;
216
217 my $sequence = 0;
218
219 if (( $installer::globals::updatedatabase ) && ( exists($alludpatelastsequences->{$cabfilename}) ))
220 {
221 $sequence = $alludpatelastsequences->{$cabfilename};
222 }
223 else
224 {
225 $sequence = $installer::globals::lastsequence{$cabfilename};
226 }
227
228 return $sequence;
229}
230
231#################################################################################
232# Creating the file Media.idt dynamically
233# Content:
234# DiskId LastSequence DiskPrompt Cabinet VolumeLabel Source
235# Idea: Every component is packed into each own cab file
236#################################################################################
237
238sub create_media_table
239
# spent 159ms (158+1.22) within installer::windows::media::create_media_table which was called: # once (158ms+1.22ms) by installer::run at line 1511 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer.pm
{
240954µs my ($filesref, $basedir, $allvariables, $alludpatelastsequences, $allupdatediskids) = @_;
241
242 my @mediatable = ();
243
244 my $diskid = 0;
245
246129µs installer::windows::idtglobal::write_idt_header(\@mediatable, "media");
# spent 29µs making 1 call to installer::windows::idtglobal::write_idt_header
247
248813.8ms if ( $installer::globals::fix_number_of_cab_files )
249 {
250 # number of cabfiles
251 my $maxcabfilenumber = $installer::globals::number_of_cabfiles;
252 if ( $allvariables->{'CABFILENUMBER'} ) { $maxcabfilenumber = $allvariables->{'CABFILENUMBER'}; }
253 my $allfiles = $#{$filesref} + 1;
254117µs my $maxfilenumber = get_maximum_filenumber($allfiles, $maxcabfilenumber);
255 my $cabfilenumber = 0;
256 my $cabfull = 0;
257 my $counter = 0;
258
259 # Sorting of files collector files required !
260 # Attention: The order in the cab file is not guaranteed (especially in udpate process)
261
26215239989.2ms for ( my $i = 0; $i <= $#{$filesref}; $i++ )
263 {
264 if (( $counter >= $maxfilenumber ) || ( $i == $#{$filesref} )) { $cabfull = 1; }
265
266 $counter++; # counting the files in the cab file
267
268 my $onefile = ${$filesref}[$i];
269 my $nextfile = ${$filesref}[$i+1];
270
271 my $filecomponent = "";
272 my $nextcomponent = "";
273
274 if ( $onefile->{'componentname'} ) { $filecomponent = $onefile->{'componentname'}; }
275 if ( $nextfile->{'componentname'} ) { $nextcomponent = $nextfile->{'componentname'}; }
276
27764813.93ms if ( $filecomponent eq $nextcomponent ) # all files of one component have to be in one cab file
278 {
279 next; # nothing to do, this is not the last file of a component
280 }
281
2821414.2ms if ( $cabfull )
283 {
284 my %media = ();
285 $cabfilenumber++;
286
287117µs $media{'DiskId'} = get_media_diskid($cabfilenumber);
# spent 17µs making 1 call to installer::windows::media::get_media_diskid
288 $media{'LastSequence'} = $i + 1; # This should be correct, also for unsorted files collectors
28914µs $media{'DiskPrompt'} = get_media_diskprompt();
290156µs $media{'Cabinet'} = generate_cab_filename_for_some_cabs($allvariables, $cabfilenumber);
29115µs $media{'VolumeLabel'} = get_media_volumelabel();
29214µs $media{'Source'} = get_media_source();
# spent 4µs making 1 call to installer::windows::media::get_media_source
293
294 my $oneline = $media{'DiskId'} . "\t" . $media{'LastSequence'} . "\t" . $media{'DiskPrompt'} . "\t"
295 . $media{'Cabinet'} . "\t" . $media{'VolumeLabel'} . "\t" . $media{'Source'} . "\n";
296
297 push(@mediatable, $oneline);
298
299 # Saving the cabinet file name in the file collector
300
301112µs $media{'Cabinet'} =~ s/^\s*\#//; # removing leading hash
# spent 12µs making 1 call to installer::windows::media::CORE:subst
302
3033177636.8ms for ( my $j = 0; $j <= $i; $j++ )
304 {
305 my $onefile = ${$filesref}[$j];
306 if ( ! $onefile->{'cabinet'} ) { $onefile->{'cabinet'} = $media{'Cabinet'}; }
307 }
308
309 $cabfull = 0;
310 $counter = 0;
311 }
312 }
313 }
314 else
315 {
316 installer::exiter::exit_program("ERROR: No cab file specification in globals.pm !", "create_media_table");
317 }
318
319 # Saving the file
320
321 my $mediatablename = $basedir . $installer::globals::separator . "Media.idt";
32211.07ms installer::files::save_file($mediatablename ,\@mediatable);
# spent 1.07ms making 1 call to installer::files::save_file
323 my $infoline = "Created idt file: $mediatablename\n";
324 push(@installer::globals::logfileinfo, $infoline);
325}
326
32717µs1;
 
# spent 20µs within installer::windows::media::CORE:subst which was called 3 times, avg 7µs/call: # once (12µs+0s) by installer::windows::media::create_media_table at line 301 # once (5µs+0s) by installer::windows::media::generate_cab_filename_for_some_cabs at line 140 # once (3µs+0s) by installer::windows::media::generate_cab_filename_for_some_cabs at line 141
sub installer::windows::media::CORE:subst; # opcode