| Filename | /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer/converter.pm |
| Statements | Executed 42438 statements in 357ms |
| Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
|---|---|---|---|---|---|
| 20141 | 4 | 4 | 286ms | 310ms | installer::converter::convert_stringlist_into_array |
| 20713 | 3 | 1 | 24.9ms | 24.9ms | installer::converter::CORE:regcomp (opcode) |
| 354 | 7 | 3 | 6.06ms | 7.57ms | installer::converter::make_path_conform |
| 218 | 2 | 2 | 2.02ms | 2.20ms | installer::converter::convert_stringlist_into_hash |
| 3 | 3 | 2 | 787µs | 1.55ms | installer::converter::convert_array_to_hash |
| 132 | 1 | 1 | 765µs | 765µs | installer::converter::CORE:match (opcode) |
| 354 | 1 | 1 | 665µs | 665µs | installer::converter::CORE:subst (opcode) |
| 1 | 1 | 1 | 362µs | 371µs | installer::converter::BEGIN@30 |
| 8 | 1 | 1 | 352µs | 352µs | installer::converter::copy_item_object |
| 1 | 1 | 1 | 224µs | 1.05ms | installer::converter::combine_arrays_from_references_first_win |
| 1 | 1 | 1 | 18µs | 37µs | installer::converter::BEGIN@31 |
| 1 | 1 | 1 | 13µs | 16µs | installer::converter::BEGIN@33 |
| 0 | 0 | 0 | 0s | 0s | installer::converter::convert_array_to_space_separated_string |
| 0 | 0 | 0 | 0s | 0s | installer::converter::convert_slash_to_backslash |
| 0 | 0 | 0 | 0s | 0s | installer::converter::convert_whitespace_stringlist_into_array |
| 0 | 0 | 0 | 0s | 0s | installer::converter::copy_collector |
| 0 | 0 | 0 | 0s | 0s | installer::converter::replace_masked_separator |
| 0 | 0 | 0 | 0s | 0s | installer::converter::resolve_masked_separator |
| 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::converter; | ||||
| 29 | |||||
| 30 | 2 | 63µs | 2 | 379µs | # spent 371µs (362+8) within installer::converter::BEGIN@30 which was called:
# once (362µs+8µs) by installer::systemactions::BEGIN@32 at line 30 # spent 371µs making 1 call to installer::converter::BEGIN@30
# spent 8µs making 1 call to strict::import |
| 31 | 2 | 58µs | 2 | 56µs | # spent 37µs (18+19) within installer::converter::BEGIN@31 which was called:
# once (18µs+19µs) by installer::systemactions::BEGIN@32 at line 31 # spent 37µs making 1 call to installer::converter::BEGIN@31
# spent 19µs making 1 call to warnings::import |
| 32 | |||||
| 33 | 2 | 1.44ms | 2 | 20µs | # spent 16µs (13+3) within installer::converter::BEGIN@33 which was called:
# once (13µs+3µs) by installer::systemactions::BEGIN@32 at line 33 # spent 16µs making 1 call to installer::converter::BEGIN@33
# spent 3µs making 1 call to UNIVERSAL::import |
| 34 | |||||
| 35 | ############################# | ||||
| 36 | # Converter | ||||
| 37 | ############################# | ||||
| 38 | |||||
| 39 | sub convert_array_to_hash | ||||
| 40 | # spent 1.55ms (787µs+765µs) within installer::converter::convert_array_to_hash which was called 3 times, avg 517µs/call:
# once (369µs+356µs) by installer::run at line 222 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer.pm
# once (225µs+217µs) by installer::converter::combine_arrays_from_references_first_win at line 175
# once (193µs+191µs) by installer::converter::combine_arrays_from_references_first_win at line 176 | ||||
| 41 | 12 | 33µs | my ($arrayref) = @_; | ||
| 42 | |||||
| 43 | my %newhash = (); | ||||
| 44 | |||||
| 45 | for (@{$arrayref}) | ||||
| 46 | { | ||||
| 47 | 264 | 1.53ms | 132 | 765µs | next unless /^\s*([\w-]+?)\s+(.*?)\s*$/; # spent 765µs making 132 calls to installer::converter::CORE:match, avg 6µs/call |
| 48 | $newhash{$1} = $2; | ||||
| 49 | } | ||||
| 50 | |||||
| 51 | return \%newhash; | ||||
| 52 | } | ||||
| 53 | |||||
| 54 | ############################################################################# | ||||
| 55 | # Converting a string list with separator $listseparator | ||||
| 56 | # into an array | ||||
| 57 | ############################################################################# | ||||
| 58 | |||||
| 59 | sub convert_stringlist_into_array | ||||
| 60 | # spent 310ms (286+23.8) within installer::converter::convert_stringlist_into_array which was called 20141 times, avg 15µs/call:
# 15888 times (157ms+13.0ms) by installer::windows::featurecomponent::create_featurecomponent_table_from_files_collector at line 60 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer/windows/featurecomponent.pm, avg 11µs/call
# 4251 times (129ms+10.8ms) by installer::windows::idtglobal::addcustomactions at line 1763 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer/windows/idtglobal.pm, avg 33µs/call
# once (100µs+34µs) by installer::control::check_system_path at line 102 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer/control.pm
# once (50µs+14µs) by installer::run at line 273 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer.pm | ||||
| 61 | 40282 | 342ms | my ( $includestringref, $listseparator ) = @_; | ||
| 62 | |||||
| 63 | 20141 | 23.8ms | return [map "$_\n", split /\Q$listseparator\E\s*/, ${$includestringref}]; # spent 23.8ms making 20141 calls to installer::converter::CORE:regcomp, avg 1µs/call | ||
| 64 | } | ||||
| 65 | |||||
| 66 | ############################################################################# | ||||
| 67 | # Converting a string list with separator $listseparator | ||||
| 68 | # into a hash with values 1. | ||||
| 69 | ############################################################################# | ||||
| 70 | |||||
| 71 | sub convert_stringlist_into_hash | ||||
| 72 | # spent 2.20ms (2.02+184µs) within installer::converter::convert_stringlist_into_hash which was called 218 times, avg 10µs/call:
# 109 times (1.06ms+83µs) by installer::scriptitems::remove_not_required_spellcheckerlanguage_modules at line 379 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer/scriptitems.pm, avg 11µs/call
# 109 times (958µs+101µs) by installer::worker::set_spellcheckerlanguages at line 1478 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer/worker.pm, avg 10µs/call | ||||
| 73 | 436 | 2.61ms | my ( $includestringref, $listseparator ) = @_; | ||
| 74 | |||||
| 75 | 218 | 184µs | return {map {$_, 1} split /\Q$listseparator\E\s*/, ${$includestringref}}; # spent 184µs making 218 calls to installer::converter::CORE:regcomp, avg 845ns/call | ||
| 76 | } | ||||
| 77 | |||||
| 78 | ############################################################################# | ||||
| 79 | # Converting a string list with separator $listseparator | ||||
| 80 | # into an array | ||||
| 81 | ############################################################################# | ||||
| 82 | |||||
| 83 | sub convert_whitespace_stringlist_into_array | ||||
| 84 | { | ||||
| 85 | my ( $includestringref ) = @_; | ||||
| 86 | |||||
| 87 | my $tmp = ${$includestringref}; | ||||
| 88 | $tmp = s/^\s+//; | ||||
| 89 | $tmp = s/\s+$//; | ||||
| 90 | |||||
| 91 | return [map "$_\n", split /\s+/, $tmp]; | ||||
| 92 | } | ||||
| 93 | |||||
| 94 | ############################################################################# | ||||
| 95 | # Converting an array into a space separated string | ||||
| 96 | ############################################################################# | ||||
| 97 | |||||
| 98 | sub convert_array_to_space_separated_string | ||||
| 99 | { | ||||
| 100 | my ( $arrayref ) = @_; | ||||
| 101 | |||||
| 102 | my $newstring; | ||||
| 103 | for (@{$arrayref}) { | ||||
| 104 | my $tmp = $_; | ||||
| 105 | $tmp =~ s/\s+$//; | ||||
| 106 | $newstring .= "$tmp "; | ||||
| 107 | } | ||||
| 108 | $newstring =~ s/ $//; | ||||
| 109 | |||||
| 110 | return $newstring; | ||||
| 111 | } | ||||
| 112 | |||||
| 113 | ############################################################################# | ||||
| 114 | # The file name contains for some files "/". If this programs runs on | ||||
| 115 | # a windows platform, this has to be converted to "\". | ||||
| 116 | ############################################################################# | ||||
| 117 | |||||
| 118 | sub convert_slash_to_backslash | ||||
| 119 | { | ||||
| 120 | my ($filesarrayref) = @_; | ||||
| 121 | |||||
| 122 | for my $onefile (@{$filesarrayref}) | ||||
| 123 | { | ||||
| 124 | if ( $onefile->{'Name'} ) { $onefile->{'Name'} =~ s/\//\\/g; } | ||||
| 125 | } | ||||
| 126 | } | ||||
| 127 | |||||
| 128 | ############################################################################ | ||||
| 129 | # Creating a copy of an existing file object | ||||
| 130 | # No converter | ||||
| 131 | ############################################################################ | ||||
| 132 | |||||
| 133 | sub copy_item_object | ||||
| 134 | # spent 352µs within installer::converter::copy_item_object which was called 8 times, avg 44µs/call:
# 8 times (352µs+0s) by installer::profiles::add_profile_into_filelist at line 105 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer/profiles.pm, avg 44µs/call | ||||
| 135 | 16 | 404µs | my ($olditemhashref, $newitemhashref) = @_; | ||
| 136 | |||||
| 137 | $newitemhashref = {%{$olditemhashref}}; | ||||
| 138 | } | ||||
| 139 | |||||
| 140 | ################################################################# | ||||
| 141 | # Windows paths must not contain the following structure: | ||||
| 142 | # c:\dirA\dirB\..\dirC | ||||
| 143 | # This has to be exchanged to | ||||
| 144 | # c:\dirA\dirC | ||||
| 145 | ################################################################# | ||||
| 146 | |||||
| 147 | sub make_path_conform | ||||
| 148 | # spent 7.57ms (6.06+1.51) within installer::converter::make_path_conform which was called 354 times, avg 21µs/call:
# 109 times (2.26ms+534µs) by installer::windows::msiglobal::write_summary_into_msi_database at line 732 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer/windows/msiglobal.pm, avg 26µs/call
# 109 times (2.14ms+621µs) by installer::windows::msiglobal::create_msi_database at line 479 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer/windows/msiglobal.pm, avg 25µs/call
# 109 times (1.10ms+217µs) by installer::windows::msiglobal::create_msi_database at line 481 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer/windows/msiglobal.pm, avg 12µs/call
# 20 times (398µs+87µs) by installer::systemactions::create_directories at line 283 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer/systemactions.pm, avg 24µs/call
# 5 times (110µs+34µs) by installer::windows::mergemodule::merge_mergemodules_into_msi_database at line 352 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer/windows/mergemodule.pm, avg 29µs/call
# once (28µs+9µs) by installer::windows::msiglobal::include_cabs_into_msi at line 1247 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer/windows/msiglobal.pm
# once (18µs+6µs) by installer::windows::msiglobal::create_transforms at line 782 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer/windows/msiglobal.pm | ||||
| 149 | 1416 | 8.03ms | my ( $path ) = @_; | ||
| 150 | my $s = $installer::globals::separator; | ||||
| 151 | |||||
| 152 | 708 | 1.51ms | while ($path =~ s/[^\.\Q$s\E]+?\Q$s\E\.\.(?:\Q$s\E|$)//g) {} # spent 844µs making 354 calls to installer::converter::CORE:regcomp, avg 2µs/call
# spent 665µs making 354 calls to installer::converter::CORE:subst, avg 2µs/call | ||
| 153 | |||||
| 154 | return $path; | ||||
| 155 | } | ||||
| 156 | |||||
| 157 | ################################################################# | ||||
| 158 | # Copying an item collector | ||||
| 159 | # A reference to an array consisting of references to hashes. | ||||
| 160 | ################################################################# | ||||
| 161 | |||||
| 162 | sub copy_collector | ||||
| 163 | { | ||||
| 164 | return [map { {%{$_}} } @{$_[0]}]; | ||||
| 165 | } | ||||
| 166 | |||||
| 167 | ################################################################# | ||||
| 168 | # Combining two arrays, first wins | ||||
| 169 | ################################################################# | ||||
| 170 | |||||
| 171 | sub combine_arrays_from_references_first_win | ||||
| 172 | # spent 1.05ms (224µs+827µs) within installer::converter::combine_arrays_from_references_first_win which was called:
# once (224µs+827µs) by installer::run at line 213 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer.pm | ||||
| 173 | 5 | 216µs | my ( $arrayref1, $arrayref2 ) = @_; | ||
| 174 | |||||
| 175 | 1 | 442µs | my $hashref1 = convert_array_to_hash($arrayref1); # spent 442µs making 1 call to installer::converter::convert_array_to_hash | ||
| 176 | 1 | 384µs | my $hashref2 = convert_array_to_hash($arrayref2); # spent 384µs making 1 call to installer::converter::convert_array_to_hash | ||
| 177 | |||||
| 178 | # add key-value pairs from hash1 to hash2 (overwrites existing keys) | ||||
| 179 | @{$hashref2}{keys %{$hashref1}} = values %{$hashref1}; | ||||
| 180 | |||||
| 181 | return [map { "$_ $hashref2->{$_}\n" } keys %{$hashref2}]; | ||||
| 182 | } | ||||
| 183 | |||||
| 184 | ################################################################# | ||||
| 185 | # Replacing separators, that are included into quotes | ||||
| 186 | ################################################################# | ||||
| 187 | |||||
| 188 | sub replace_masked_separator | ||||
| 189 | { | ||||
| 190 | my ($string, $separator, $replacementstring) = @_; | ||||
| 191 | |||||
| 192 | $string =~ s/\\\Q$separator\E/$replacementstring/g; | ||||
| 193 | |||||
| 194 | return $string; | ||||
| 195 | } | ||||
| 196 | |||||
| 197 | ################################################################# | ||||
| 198 | # Resolving separators, that were replaced | ||||
| 199 | # in function mask_separator_in_quotes | ||||
| 200 | ################################################################# | ||||
| 201 | |||||
| 202 | sub resolve_masked_separator | ||||
| 203 | { | ||||
| 204 | my ($arrayref, $separator, $replacementstring) = @_; | ||||
| 205 | |||||
| 206 | for (@{$arrayref}) | ||||
| 207 | { | ||||
| 208 | s/$replacementstring/$separator/g; | ||||
| 209 | } | ||||
| 210 | } | ||||
| 211 | |||||
| 212 | 1 | 7µs | 1; | ||
# spent 765µs within installer::converter::CORE:match which was called 132 times, avg 6µs/call:
# 132 times (765µs+0s) by installer::converter::convert_array_to_hash at line 47, avg 6µs/call | |||||
# spent 24.9ms within installer::converter::CORE:regcomp which was called 20713 times, avg 1µs/call:
# 20141 times (23.8ms+0s) by installer::converter::convert_stringlist_into_array at line 63, avg 1µs/call
# 354 times (844µs+0s) by installer::converter::make_path_conform at line 152, avg 2µs/call
# 218 times (184µs+0s) by installer::converter::convert_stringlist_into_hash at line 75, avg 845ns/call | |||||
# spent 665µs within installer::converter::CORE:subst which was called 354 times, avg 2µs/call:
# 354 times (665µs+0s) by installer::converter::make_path_conform at line 152, avg 2µs/call |