| Filename | /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer/windows/createfolder.pm |
| Statements | Executed 9510 statements in 163ms |
| Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
|---|---|---|---|---|---|
| 14 | 1 | 1 | 148ms | 148ms | installer::windows::createfolder::get_createfolder_component |
| 1 | 1 | 1 | 12.8ms | 163ms | installer::windows::createfolder::create_createfolder_table |
| 1848 | 1 | 1 | 934µs | 934µs | installer::windows::createfolder::CORE:match (opcode) |
| 1 | 1 | 1 | 361µs | 364µs | installer::windows::createfolder::BEGIN@30 |
| 14 | 1 | 1 | 145µs | 145µs | installer::windows::createfolder::get_createfolder_directory |
| 1 | 1 | 1 | 15µs | 17µs | installer::windows::createfolder::BEGIN@32 |
| 1 | 1 | 1 | 14µs | 17µs | installer::windows::createfolder::BEGIN@31 |
| 1 | 1 | 1 | 14µs | 16µs | installer::windows::createfolder::BEGIN@33 |
| 0 | 0 | 0 | 0s | 0s | installer::windows::createfolder::get_languagepack_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 | |||||
| 28 | package installer::windows::createfolder; | ||||
| 29 | |||||
| 30 | 2 | 67µs | 2 | 368µs | # spent 364µs (361+4) within installer::windows::createfolder::BEGIN@30 which was called:
# once (361µs+4µs) by installer::BEGIN@64 at line 30 # spent 364µs making 1 call to installer::windows::createfolder::BEGIN@30
# spent 4µs making 1 call to UNIVERSAL::import |
| 31 | 2 | 56µs | 2 | 20µs | # spent 17µs (14+3) within installer::windows::createfolder::BEGIN@31 which was called:
# once (14µs+3µs) by installer::BEGIN@64 at line 31 # spent 17µs making 1 call to installer::windows::createfolder::BEGIN@31
# spent 3µs making 1 call to UNIVERSAL::import |
| 32 | 2 | 53µs | 2 | 19µs | # spent 17µs (15+2) within installer::windows::createfolder::BEGIN@32 which was called:
# once (15µs+2µs) by installer::BEGIN@64 at line 32 # spent 17µs making 1 call to installer::windows::createfolder::BEGIN@32
# spent 2µs making 1 call to UNIVERSAL::import |
| 33 | 2 | 1.14ms | 2 | 19µs | # spent 16µs (14+3) within installer::windows::createfolder::BEGIN@33 which was called:
# once (14µs+3µs) by installer::BEGIN@64 at line 33 # spent 16µs making 1 call to installer::windows::createfolder::BEGIN@33
# spent 3µs making 1 call to UNIVERSAL::import |
| 34 | |||||
| 35 | ############################################################## | ||||
| 36 | # Returning directory for createfolder table. | ||||
| 37 | ############################################################## | ||||
| 38 | |||||
| 39 | sub get_createfolder_directory | ||||
| 40 | # spent 145µs within installer::windows::createfolder::get_createfolder_directory which was called 14 times, avg 10µs/call:
# 14 times (145µs+0s) by installer::windows::createfolder::create_createfolder_table at line 139, avg 10µs/call | ||||
| 41 | 42 | 151µs | my ($onedir) = @_; | ||
| 42 | |||||
| 43 | my $uniquename = $onedir->{'uniquename'}; | ||||
| 44 | |||||
| 45 | return $uniquename; | ||||
| 46 | } | ||||
| 47 | |||||
| 48 | ############################################################## | ||||
| 49 | # Searching the correct file for language pack directories. | ||||
| 50 | ############################################################## | ||||
| 51 | |||||
| 52 | sub get_languagepack_file | ||||
| 53 | { | ||||
| 54 | my ($filesref, $onedir) = @_; | ||||
| 55 | |||||
| 56 | my $language = $onedir->{'specificlanguage'}; | ||||
| 57 | my $foundfile = 0; | ||||
| 58 | my $onefile = ""; | ||||
| 59 | |||||
| 60 | for ( my $i = 0; $i <= $#{$filesref}; $i++ ) | ||||
| 61 | { | ||||
| 62 | $onefile = ${$filesref}[$i]; | ||||
| 63 | |||||
| 64 | if ( $onefile->{'specificlanguage'} eq $onedir->{'specificlanguage'} ) | ||||
| 65 | { | ||||
| 66 | $foundfile = 1; | ||||
| 67 | last; | ||||
| 68 | } | ||||
| 69 | } | ||||
| 70 | |||||
| 71 | if ( ! $foundfile ) { installer::exiter::exit_program("ERROR: No file with correct language found (language pack build)!", "get_languagepack_file"); } | ||||
| 72 | |||||
| 73 | return $onefile; | ||||
| 74 | } | ||||
| 75 | |||||
| 76 | ############################################################## | ||||
| 77 | # Returning component for createfolder table. | ||||
| 78 | ############################################################## | ||||
| 79 | |||||
| 80 | sub get_createfolder_component | ||||
| 81 | # spent 148ms within installer::windows::createfolder::get_createfolder_component which was called 14 times, avg 10.6ms/call:
# 14 times (148ms+0s) by installer::windows::createfolder::create_createfolder_table at line 140, avg 10.6ms/call | ||||
| 82 | 126 | 467µs | my ($onedir, $filesref, $allvariableshashref) = @_; | ||
| 83 | |||||
| 84 | # Directories do not belong to a module. | ||||
| 85 | # Therefore they can only belong to the root module and | ||||
| 86 | # will be added to a component at the root module. | ||||
| 87 | # All directories will be added to the component | ||||
| 88 | # containing the file $allvariableshashref->{'GLOBALFILEGID'} | ||||
| 89 | |||||
| 90 | if ( ! $allvariableshashref->{'GLOBALFILEGID'} ) { installer::exiter::exit_program("ERROR: GLOBALFILEGID must be defined in list file!", "get_createfolder_component"); } | ||||
| 91 | if (( $installer::globals::patch ) && ( ! $allvariableshashref->{'GLOBALFILEGID'} )) { installer::exiter::exit_program("ERROR: GLOBALPATCHFILEGID must be defined in list file!", "get_createfolder_component"); } | ||||
| 92 | |||||
| 93 | my $globalfilegid = $allvariableshashref->{'GLOBALFILEGID'}; | ||||
| 94 | if ( $installer::globals::patch ) { $globalfilegid = $allvariableshashref->{'GLOBALPATCHFILEGID'}; } | ||||
| 95 | |||||
| 96 | my $onefile; | ||||
| 97 | 14 | 148ms | if ( $installer::globals::languagepack ) { $onefile = get_languagepack_file($filesref, $onedir); } | ||
| 98 | elsif ( $installer::globals::helppack ) { ($onefile) = grep {$_->{gid} eq 'gid_File_Help_Common_Zip'} @{$filesref} } | ||||
| 99 | else { ($onefile) = grep {$_->{gid} eq $globalfilegid} @{$filesref} } | ||||
| 100 | |||||
| 101 | if (! defined $onefile) { | ||||
| 102 | installer::exiter::exit_program("ERROR: Could not find file!", "get_createfolder_component"); | ||||
| 103 | } | ||||
| 104 | |||||
| 105 | return $onefile->{'componentname'}; | ||||
| 106 | } | ||||
| 107 | |||||
| 108 | #################################################################################### | ||||
| 109 | # Creating the file CreateFo.idt dynamically for creation of empty directories | ||||
| 110 | # Content: | ||||
| 111 | # Directory_ Component_ | ||||
| 112 | #################################################################################### | ||||
| 113 | |||||
| 114 | sub create_createfolder_table | ||||
| 115 | # spent 163ms (12.8+150) within installer::windows::createfolder::create_createfolder_table which was called:
# once (12.8ms+150ms) by installer::run at line 1525 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer.pm | ||||
| 116 | 9 | 2.24ms | my ($dirref, $filesref, $basedir, $allvariableshashref) = @_; | ||
| 117 | |||||
| 118 | my @createfoldertable = (); | ||||
| 119 | |||||
| 120 | my $infoline; | ||||
| 121 | |||||
| 122 | 1 | 18µs | installer::windows::idtglobal::write_idt_header(\@createfoldertable, "createfolder"); # spent 18µs making 1 call to installer::windows::idtglobal::write_idt_header | ||
| 123 | |||||
| 124 | 9240 | 10.9ms | for ( my $i = 0; $i <= $#{$dirref}; $i++ ) | ||
| 125 | { | ||||
| 126 | my $onedir = ${$dirref}[$i]; | ||||
| 127 | |||||
| 128 | # language packs and help packs get only language dependent directories | ||||
| 129 | if (( $installer::globals::languagepack ) || ( $installer::globals::languagepack ) && ( $onedir->{'specificlanguage'} eq "" )) { next }; | ||||
| 130 | |||||
| 131 | my $styles = ""; | ||||
| 132 | |||||
| 133 | if ( $onedir->{'Styles'} ) { $styles = $onedir->{'Styles'}; } | ||||
| 134 | |||||
| 135 | 70 | 371µs | 1848 | 934µs | if ( $styles =~ /\bCREATE\b/ ) # spent 934µs making 1848 calls to installer::windows::createfolder::CORE:match, avg 505ns/call |
| 136 | { | ||||
| 137 | my %directory = (); | ||||
| 138 | |||||
| 139 | 14 | 145µs | $directory{'Directory_'} = get_createfolder_directory($onedir); # spent 145µs making 14 calls to installer::windows::createfolder::get_createfolder_directory, avg 10µs/call | ||
| 140 | 14 | 148ms | $directory{'Component_'} = get_createfolder_component($onedir, $filesref, $allvariableshashref); # spent 148ms making 14 calls to installer::windows::createfolder::get_createfolder_component, avg 10.6ms/call | ||
| 141 | |||||
| 142 | my $oneline = $directory{'Directory_'} . "\t" . $directory{'Component_'} . "\n"; | ||||
| 143 | |||||
| 144 | push(@createfoldertable, $oneline); | ||||
| 145 | } | ||||
| 146 | } | ||||
| 147 | |||||
| 148 | # Saving the file | ||||
| 149 | |||||
| 150 | my $createfoldertablename = $basedir . $installer::globals::separator . "CreateFo.idt"; | ||||
| 151 | 1 | 1.17ms | installer::files::save_file($createfoldertablename ,\@createfoldertable); # spent 1.17ms making 1 call to installer::files::save_file | ||
| 152 | $infoline = "Created idt file: $createfoldertablename\n"; | ||||
| 153 | push(@installer::globals::logfileinfo, $infoline); | ||||
| 154 | |||||
| 155 | } | ||||
| 156 | |||||
| 157 | 1 | 7µs | 1; | ||
# spent 934µs within installer::windows::createfolder::CORE:match which was called 1848 times, avg 505ns/call:
# 1848 times (934µs+0s) by installer::windows::createfolder::create_createfolder_table at line 135, avg 505ns/call |