Filename | /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer/windows/inifile.pm |
Statements | Executed 429110 statements in 522ms |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
9 | 1 | 1 | 445ms | 445ms | file_is_part_of_product | installer::windows::inifile::
7 | 1 | 1 | 74.7ms | 74.7ms | get_profile_for_profileitem | installer::windows::inifile::
1 | 1 | 1 | 867µs | 521ms | create_inifile_table | installer::windows::inifile::
1 | 1 | 1 | 374µs | 377µs | BEGIN@30 | installer::windows::inifile::
1 | 1 | 1 | 14µs | 16µs | BEGIN@31 | installer::windows::inifile::
1 | 1 | 1 | 13µs | 16µs | BEGIN@32 | installer::windows::inifile::
1 | 1 | 1 | 13µs | 16µs | BEGIN@33 | installer::windows::inifile::
0 | 0 | 0 | 0s | 0s | profile_has_patch_flag | installer::windows::inifile::
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::inifile; | ||||
29 | |||||
30 | 2 | 62µs | 2 | 379µs | # spent 377µs (374+3) within installer::windows::inifile::BEGIN@30 which was called:
# once (374µs+3µs) by installer::BEGIN@72 at line 30 # spent 377µs making 1 call to installer::windows::inifile::BEGIN@30
# spent 3µs making 1 call to UNIVERSAL::import |
31 | 2 | 53µs | 2 | 18µs | # spent 16µs (14+2) within installer::windows::inifile::BEGIN@31 which was called:
# once (14µs+2µs) by installer::BEGIN@72 at line 31 # spent 16µs making 1 call to installer::windows::inifile::BEGIN@31
# spent 2µs making 1 call to UNIVERSAL::import |
32 | 2 | 51µs | 2 | 18µs | # spent 16µs (13+3) within installer::windows::inifile::BEGIN@32 which was called:
# once (13µs+3µs) by installer::BEGIN@72 at line 32 # spent 16µs making 1 call to installer::windows::inifile::BEGIN@32
# spent 2µs making 1 call to UNIVERSAL::import |
33 | 2 | 1.09ms | 2 | 18µs | # spent 16µs (13+3) within installer::windows::inifile::BEGIN@33 which was called:
# once (13µs+3µs) by installer::BEGIN@72 at line 33 # spent 16µs making 1 call to installer::windows::inifile::BEGIN@33
# spent 3µs making 1 call to UNIVERSAL::import |
34 | |||||
35 | #################################################### | ||||
36 | # Setting the profile for a special profileitem | ||||
37 | #################################################### | ||||
38 | |||||
39 | sub get_profile_for_profileitem | ||||
40 | # spent 74.7ms within installer::windows::inifile::get_profile_for_profileitem which was called 7 times, avg 10.7ms/call:
# 7 times (74.7ms+0s) by installer::windows::inifile::create_inifile_table at line 118, avg 10.7ms/call | ||||
41 | 28 | 74.7ms | my ($profileid, $filesref) = @_; | ||
42 | |||||
43 | my ($profile) = grep {$_->{gid} eq $profileid} @{$filesref}; | ||||
44 | if (! defined $profile) { | ||||
45 | installer::exiter::exit_program("ERROR: Could not find file $profileid in list of files!", "get_profile_for_profileitem"); | ||||
46 | } | ||||
47 | |||||
48 | return $profile; | ||||
49 | } | ||||
50 | |||||
51 | #################################################### | ||||
52 | # Checking whether profile is included in patch | ||||
53 | #################################################### | ||||
54 | |||||
55 | sub profile_has_patch_flag | ||||
56 | { | ||||
57 | my ($profile) = @_; | ||||
58 | |||||
59 | my $in_patch = 0; | ||||
60 | |||||
61 | my $styles = ""; | ||||
62 | if ( $profile->{'Styles'} ) { $styles = $profile->{'Styles'}; } | ||||
63 | if ( $styles =~ /\bPATCH\b/ ) { $in_patch = 1; } | ||||
64 | |||||
65 | return $in_patch; | ||||
66 | } | ||||
67 | |||||
68 | #################################################### | ||||
69 | # Checking whether profile is part of product | ||||
70 | #################################################### | ||||
71 | |||||
72 | sub file_is_part_of_product | ||||
73 | # spent 445ms within installer::windows::inifile::file_is_part_of_product which was called 9 times, avg 49.4ms/call:
# 9 times (445ms+0s) by installer::windows::inifile::create_inifile_table at line 116, avg 49.4ms/call | ||||
74 | 36 | 143ms | my ($profilegid, $filesref) = @_; | ||
75 | |||||
76 | my $part_of_product = 0; | ||||
77 | |||||
78 | 428895 | 302ms | for ( my $i = 0; $i <= $#{$filesref}; $i++ ) | ||
79 | { | ||||
80 | $onefile = ${$filesref}[$i]; | ||||
81 | my $filegid = $onefile->{'gid'}; | ||||
82 | |||||
83 | 14 | 21µs | if ( $filegid eq $profilegid ) | ||
84 | { | ||||
85 | $part_of_product = 1; | ||||
86 | last; | ||||
87 | } | ||||
88 | } | ||||
89 | |||||
90 | return $part_of_product; | ||||
91 | } | ||||
92 | |||||
93 | ########################################################################################################### | ||||
94 | # Creating the file IniFile.idt dynamically | ||||
95 | # Content: | ||||
96 | # IniFile\tFileName\tDirProperty\tSection\tKey\tValue\tAction\tComponent_ | ||||
97 | ########################################################################################################### | ||||
98 | |||||
99 | sub create_inifile_table | ||||
100 | # spent 521ms (867µs+521) within installer::windows::inifile::create_inifile_table which was called:
# once (867µs+521ms) by installer::run at line 1521 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer.pm | ||||
101 | 8 | 90µs | my ($inifiletableentries, $filesref, $basedir) = @_; | ||
102 | |||||
103 | my @inifiletable = (); | ||||
104 | |||||
105 | 1 | 21µs | installer::windows::idtglobal::write_idt_header(\@inifiletable, "inifile"); # spent 21µs making 1 call to installer::windows::idtglobal::write_idt_header | ||
106 | |||||
107 | 118 | 544µs | for ( my $i = 0; $i <= $#{$inifiletableentries}; $i++ ) | ||
108 | { | ||||
109 | my $profileitem = ${$inifiletableentries}[$i]; | ||||
110 | |||||
111 | my $profileid = $profileitem->{'ProfileID'}; | ||||
112 | |||||
113 | # Is this profile part of the product? This is not sure, for example in patch process. | ||||
114 | # If the profile is not part of the product, this ProfileItem must be ignored. | ||||
115 | |||||
116 | 2 | 6µs | 9 | 445ms | if ( ! file_is_part_of_product($profileid, $filesref) ) { next; } # spent 445ms making 9 calls to installer::windows::inifile::file_is_part_of_product, avg 49.4ms/call |
117 | |||||
118 | 7 | 74.7ms | my $profile = get_profile_for_profileitem($profileid, $filesref); # spent 74.7ms making 7 calls to installer::windows::inifile::get_profile_for_profileitem, avg 10.7ms/call | ||
119 | |||||
120 | if (( $installer::globals::patch ) && ( ! profile_has_patch_flag($profile) )) { next; } | ||||
121 | |||||
122 | my %inifile = (); | ||||
123 | |||||
124 | $inifile{'IniFile'} = $profileitem->{'Inifiletablekey'}; | ||||
125 | $inifile{'FileName'} = $profile->{'Name'}; | ||||
126 | $inifile{'DirProperty'} = $profile->{'uniquedirname'}; | ||||
127 | $inifile{'Section'} = $profileitem->{'Section'}; | ||||
128 | $inifile{'Key'} = $profileitem->{'Key'}; | ||||
129 | $inifile{'Value'} = $profileitem->{'Value'}; | ||||
130 | $inifile{'Action'} = $profileitem->{'Inifiletableaction'}; | ||||
131 | $inifile{'Component_'} = $profile->{'componentname'}; | ||||
132 | |||||
133 | my $oneline = $inifile{'IniFile'} . "\t" . $inifile{'FileName'} . "\t" . $inifile{'DirProperty'} . "\t" | ||||
134 | . $inifile{'Section'} . "\t" . $inifile{'Key'} . "\t" . $inifile{'Value'} . "\t" | ||||
135 | . $inifile{'Action'} . "\t" . $inifile{'Component_'} . "\n"; | ||||
136 | |||||
137 | push(@inifiletable, $oneline); | ||||
138 | } | ||||
139 | |||||
140 | # Saving the file | ||||
141 | |||||
142 | my $inifiletablename = $basedir . $installer::globals::separator . "IniFile.idt"; | ||||
143 | 1 | 1.18ms | installer::files::save_file($inifiletablename ,\@inifiletable); # spent 1.18ms making 1 call to installer::files::save_file | ||
144 | my $infoline = "Created idt file: $inifiletablename\n"; | ||||
145 | push(@installer::globals::logfileinfo, $infoline); | ||||
146 | |||||
147 | } | ||||
148 | |||||
149 | 1 | 6µs | 1; |