| Filename | /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer/archivefiles.pm |
| Statements | Executed 294454 statements in 1.63s |
| Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
|---|---|---|---|---|---|
| 8654 | 2 | 1 | 813ms | 813ms | installer::archivefiles::CORE:ftfile (opcode) |
| 1 | 1 | 1 | 687ms | 50.0s | installer::archivefiles::resolving_archive_flag |
| 50066 | 14 | 1 | 95.6ms | 95.6ms | installer::archivefiles::CORE:match (opcode) |
| 1 | 1 | 1 | 48.3ms | 191ms | installer::archivefiles::BEGIN@30 |
| 16682 | 5 | 1 | 18.9ms | 18.9ms | installer::archivefiles::CORE:subst (opcode) |
| 10245 | 3 | 1 | 10.0ms | 10.0ms | installer::archivefiles::CORE:regcomp (opcode) |
| 53 | 1 | 1 | 5.71ms | 7.06ms | installer::archivefiles::get_all_executables_from_manifest |
| 53 | 1 | 1 | 2.28ms | 30.8ms | installer::archivefiles::collect_all_executable_files_in_extensions |
| 1 | 1 | 1 | 1.79ms | 111ms | installer::archivefiles::BEGIN@31 |
| 2 | 1 | 1 | 513µs | 513µs | installer::archivefiles::CORE:chmod (opcode) |
| 4 | 2 | 1 | 435µs | 435µs | installer::archivefiles::CORE:chdir (opcode) |
| 1 | 1 | 1 | 19µs | 99µs | installer::archivefiles::BEGIN@37 |
| 1 | 1 | 1 | 19µs | 21µs | installer::archivefiles::BEGIN@32 |
| 1 | 1 | 1 | 17µs | 19µs | installer::archivefiles::BEGIN@33 |
| 1 | 1 | 1 | 17µs | 76µs | installer::archivefiles::BEGIN@34 |
| 1 | 1 | 1 | 16µs | 18µs | installer::archivefiles::BEGIN@36 |
| 1 | 1 | 1 | 15µs | 18µs | installer::archivefiles::BEGIN@35 |
| 0 | 0 | 0 | 0s | 0s | installer::archivefiles::get_patch_file_list |
| 0 | 0 | 0 | 0s | 0s | installer::archivefiles::put_language_into_name |
| 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::archivefiles; | ||||
| 29 | |||||
| 30 | 2 | 1.37ms | 2 | 192ms | # spent 191ms (48.3+143) within installer::archivefiles::BEGIN@30 which was called:
# once (48.3ms+143ms) by installer::BEGIN@35 at line 30 # spent 191ms making 1 call to installer::archivefiles::BEGIN@30
# spent 367µs making 1 call to Exporter::import |
| 31 | 2 | 1.21ms | 2 | 111ms | # spent 111ms (1.79+110) within installer::archivefiles::BEGIN@31 which was called:
# once (1.79ms+110ms) by installer::BEGIN@35 at line 31 # spent 111ms making 1 call to installer::archivefiles::BEGIN@31
# spent 4µs making 1 call to UNIVERSAL::import |
| 32 | 2 | 56µs | 2 | 23µs | # spent 21µs (19+2) within installer::archivefiles::BEGIN@32 which was called:
# once (19µs+2µs) by installer::BEGIN@35 at line 32 # spent 21µs making 1 call to installer::archivefiles::BEGIN@32
# spent 2µs making 1 call to UNIVERSAL::import |
| 33 | 2 | 55µs | 2 | 21µs | # spent 19µs (17+2) within installer::archivefiles::BEGIN@33 which was called:
# once (17µs+2µs) by installer::BEGIN@35 at line 33 # spent 19µs making 1 call to installer::archivefiles::BEGIN@33
# spent 2µs making 1 call to UNIVERSAL::import |
| 34 | 2 | 57µs | 2 | 136µs | # spent 76µs (17+60) within installer::archivefiles::BEGIN@34 which was called:
# once (17µs+60µs) by installer::BEGIN@35 at line 34 # spent 76µs making 1 call to installer::archivefiles::BEGIN@34
# spent 60µs making 1 call to Exporter::import |
| 35 | 2 | 53µs | 2 | 20µs | # spent 18µs (15+2) within installer::archivefiles::BEGIN@35 which was called:
# once (15µs+2µs) by installer::BEGIN@35 at line 35 # spent 18µs making 1 call to installer::archivefiles::BEGIN@35
# spent 2µs making 1 call to UNIVERSAL::import |
| 36 | 2 | 52µs | 2 | 20µs | # spent 18µs (16+2) within installer::archivefiles::BEGIN@36 which was called:
# once (16µs+2µs) by installer::BEGIN@35 at line 36 # spent 18µs making 1 call to installer::archivefiles::BEGIN@36
# spent 2µs making 1 call to UNIVERSAL::import |
| 37 | 2 | 5.26ms | 2 | 178µs | # spent 99µs (19+80) within installer::archivefiles::BEGIN@37 which was called:
# once (19µs+80µs) by installer::BEGIN@35 at line 37 # spent 99µs making 1 call to installer::archivefiles::BEGIN@37
# spent 80µs making 1 call to Exporter::import |
| 38 | |||||
| 39 | ################################################################# | ||||
| 40 | # Changing the name for files with flag RENAME_TO_LANGUAGE | ||||
| 41 | ################################################################# | ||||
| 42 | |||||
| 43 | sub put_language_into_name | ||||
| 44 | { | ||||
| 45 | my ( $oldname, $onelanguage ) = @_; | ||||
| 46 | |||||
| 47 | my $newname = ""; | ||||
| 48 | |||||
| 49 | my $filename = ""; | ||||
| 50 | my $extension = ""; | ||||
| 51 | |||||
| 52 | if ( $oldname =~ /en-US/ ) # files, that contain the language in the file name | ||||
| 53 | { | ||||
| 54 | $newname = $oldname; | ||||
| 55 | $newname =~ s/en-US/$onelanguage/; | ||||
| 56 | } | ||||
| 57 | else # files, that do not contain the language in the file name | ||||
| 58 | { | ||||
| 59 | if ( $oldname =~ /^\s*(.*)(\..*?)\s*$/ ) # files with extension | ||||
| 60 | { | ||||
| 61 | $filename = $1; | ||||
| 62 | $extension = $2; | ||||
| 63 | } | ||||
| 64 | else | ||||
| 65 | { | ||||
| 66 | $filename = $oldname; | ||||
| 67 | $extension = ""; | ||||
| 68 | } | ||||
| 69 | |||||
| 70 | $newname = $1 . "_" . $onelanguage . $2; | ||||
| 71 | } | ||||
| 72 | |||||
| 73 | return $newname; | ||||
| 74 | } | ||||
| 75 | |||||
| 76 | ################################################################# | ||||
| 77 | # Converting patchfiles string into array | ||||
| 78 | ################################################################# | ||||
| 79 | |||||
| 80 | sub get_patch_file_list | ||||
| 81 | { | ||||
| 82 | my ( $patchfilestring ) = @_; | ||||
| 83 | |||||
| 84 | $patchfilestring =~ s/^\s*\(?//; | ||||
| 85 | $patchfilestring =~ s/\)?\s*$//; | ||||
| 86 | $patchfilestring =~ s/^\s*\///; | ||||
| 87 | $patchfilestring =~ s/^\s*\\//; | ||||
| 88 | |||||
| 89 | my @patchfilesarray = split /,\s*/, $patchfilestring; | ||||
| 90 | |||||
| 91 | return \@patchfilesarray; | ||||
| 92 | } | ||||
| 93 | |||||
| 94 | ################################################################# | ||||
| 95 | # Reading all executables in the "manifest.xml" | ||||
| 96 | ################################################################# | ||||
| 97 | |||||
| 98 | sub get_all_executables_from_manifest | ||||
| 99 | # spent 7.06ms (5.71+1.35) within installer::archivefiles::get_all_executables_from_manifest which was called 53 times, avg 133µs/call:
# 53 times (5.71ms+1.35ms) by installer::archivefiles::collect_all_executable_files_in_extensions at line 138, avg 133µs/call | ||||
| 100 | 159 | 1.13ms | my ($unzipdir, $manifestfile, $executable_files_in_extensions) = @_; | ||
| 101 | |||||
| 102 | my $is_executable = 0; | ||||
| 103 | |||||
| 104 | 1832 | 6.00ms | for ( my $i = 0; $i <= $#{$manifestfile}; $i++ ) | ||
| 105 | { | ||||
| 106 | my $line = ${$manifestfile}[$i]; | ||||
| 107 | |||||
| 108 | 458 | 305µs | if ( $line =~ /\"application\/vnd\.sun\.star\.executable\"/ ) { $is_executable = 1; } # spent 305µs making 458 calls to installer::archivefiles::CORE:match, avg 666ns/call | ||
| 109 | |||||
| 110 | 458 | 601µs | if (( $line =~ /manifest\:full\-path=\"(.*?)\"/ ) && ( $is_executable )) # spent 601µs making 458 calls to installer::archivefiles::CORE:match, avg 1µs/call | ||
| 111 | { | ||||
| 112 | my $filename = $unzipdir . $installer::globals::separator . $1; | ||||
| 113 | # making only slashes for comparison reasons | ||||
| 114 | $filename =~ s/\\/\//g; | ||||
| 115 | $executable_files_in_extensions->{$filename} = 1; | ||||
| 116 | } | ||||
| 117 | |||||
| 118 | 458 | 442µs | if ( $line =~ /\/\>/ ) { $is_executable = 0; } # spent 442µs making 458 calls to installer::archivefiles::CORE:match, avg 965ns/call | ||
| 119 | } | ||||
| 120 | } | ||||
| 121 | |||||
| 122 | ################################################################# | ||||
| 123 | # Reading the "manifest.xml" in extensions and determine, if | ||||
| 124 | # there are executable files | ||||
| 125 | ################################################################# | ||||
| 126 | |||||
| 127 | sub collect_all_executable_files_in_extensions | ||||
| 128 | # spent 30.8ms (2.28+28.5) within installer::archivefiles::collect_all_executable_files_in_extensions which was called 53 times, avg 580µs/call:
# 53 times (2.28ms+28.5ms) by installer::archivefiles::resolving_archive_flag at line 317, avg 580µs/call | ||||
| 129 | 212 | 7.40ms | my ($unzipdir, $executable_files_in_extensions) = @_; | ||
| 130 | |||||
| 131 | 106 | 650µs | $unzipdir =~ s/\Q$installer::globals::separator\E\s*$//; # spent 484µs making 53 calls to installer::archivefiles::CORE:subst, avg 9µs/call
# spent 167µs making 53 calls to installer::archivefiles::CORE:regcomp, avg 3µs/call | ||
| 132 | |||||
| 133 | my $manifestfilename = $unzipdir . $installer::globals::separator . "META-INF" . $installer::globals::separator . "manifest.xml"; | ||||
| 134 | |||||
| 135 | 106 | 744µs | 53 | 5.29ms | if ( -f $manifestfilename ) # spent 5.29ms making 53 calls to installer::archivefiles::CORE:ftfile, avg 100µs/call |
| 136 | { | ||||
| 137 | 53 | 15.5ms | my $manifestfile = installer::files::read_file($manifestfilename); # spent 15.5ms making 53 calls to installer::files::read_file, avg 292µs/call | ||
| 138 | 53 | 7.06ms | get_all_executables_from_manifest($unzipdir, $manifestfile, $executable_files_in_extensions); # spent 7.06ms making 53 calls to installer::archivefiles::get_all_executables_from_manifest, avg 133µs/call | ||
| 139 | } | ||||
| 140 | } | ||||
| 141 | |||||
| 142 | ################################################################# | ||||
| 143 | # Analyzing files with flag ARCHIVE | ||||
| 144 | ################################################################# | ||||
| 145 | |||||
| 146 | sub resolving_archive_flag | ||||
| 147 | # spent 50.0s (687ms+49.3) within installer::archivefiles::resolving_archive_flag which was called:
# once (687ms+49.3s) by installer::run at line 688 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer.pm | ||||
| 148 | 13 | 8.84ms | my ($filesarrayref, $additionalpathsref, $languagestringref, $loggingdir) = @_; | ||
| 149 | |||||
| 150 | my @newallfilesarray = (); | ||||
| 151 | |||||
| 152 | my ($systemcall, $returnvalue, $infoline); | ||||
| 153 | |||||
| 154 | my $unziplistfile = $loggingdir . "unziplist_" . $installer::globals::build . "_" . $installer::globals::compiler . "_" . $$languagestringref . ".txt"; | ||||
| 155 | |||||
| 156 | 1 | 481ms | my $platformunzipdirbase = installer::systemactions::create_directories("zip", $languagestringref); # spent 481ms making 1 call to installer::systemactions::create_directories | ||
| 157 | push(@installer::globals::removedirs, $platformunzipdirbase); | ||||
| 158 | |||||
| 159 | 1 | 205µs | installer::logger::include_header_into_logfile("Files with flag ARCHIVE:"); # spent 205µs making 1 call to installer::logger::include_header_into_logfile | ||
| 160 | |||||
| 161 | my $repeat_unzip = 0; | ||||
| 162 | my $maxcounter = 0; | ||||
| 163 | |||||
| 164 | 37520 | 51.6ms | for ( my $i = 0; $i <= $#{$filesarrayref}; $i++ ) | ||
| 165 | { | ||||
| 166 | if ( $repeat_unzip ) { $i--; } # decreasing the counter | ||||
| 167 | |||||
| 168 | my $onefile = ${$filesarrayref}[$i]; | ||||
| 169 | my $styles = ""; | ||||
| 170 | |||||
| 171 | if ( $onefile->{'Styles'} ) { $styles = $onefile->{'Styles'}; } | ||||
| 172 | |||||
| 173 | 15274 | 80.5ms | 7504 | 4.93ms | if ( $styles =~ /\bARCHIVE\b/ ) # copying, unzipping and changing the file list # spent 4.93ms making 7504 calls to installer::archivefiles::CORE:match, avg 657ns/call |
| 174 | { | ||||
| 175 | my $iscommonfile = 0; | ||||
| 176 | my $sourcepath = $onefile->{'sourcepath'}; | ||||
| 177 | |||||
| 178 | 420 | 643µs | if ( $sourcepath =~ /\Q$installer::globals::separator\E\bcommon$installer::globals::productextension\Q$installer::globals::separator\E/ ) # /common/ or /common.pro/ # spent 469µs making 210 calls to installer::archivefiles::CORE:regcomp, avg 2µs/call
# spent 175µs making 210 calls to installer::archivefiles::CORE:match, avg 831ns/call | ||
| 179 | { | ||||
| 180 | $iscommonfile = 1; | ||||
| 181 | } | ||||
| 182 | |||||
| 183 | my $use_internal_rights = 0; | ||||
| 184 | 210 | 125µs | if ( $styles =~ /\bUSE_INTERNAL_RIGHTS\b/ ) { $use_internal_rights = 1; } # using the rights used inside the zip file # spent 125µs making 210 calls to installer::archivefiles::CORE:match, avg 594ns/call | ||
| 185 | |||||
| 186 | my $rename_to_language = 0; | ||||
| 187 | 210 | 191µs | if ( $styles =~ /\bRENAME_TO_LANGUAGE\b/ ) { $rename_to_language = 1; } # special handling for renamed files (scriptitems.pm) # spent 191µs making 210 calls to installer::archivefiles::CORE:match, avg 910ns/call | ||
| 188 | |||||
| 189 | my %executable_files_in_extensions = (); | ||||
| 190 | my $set_executable_privileges = 0; # setting privileges for exectables is required for oxt files | ||||
| 191 | 210 | 347µs | if ( $onefile->{'Name'} =~ /\.oxt\s*$/ ) { $set_executable_privileges = 1; } # spent 347µs making 210 calls to installer::archivefiles::CORE:match, avg 2µs/call | ||
| 192 | |||||
| 193 | # mechanism to select files from an archive files | ||||
| 194 | my $select_files = 0; | ||||
| 195 | my $selectlistfiles = ""; | ||||
| 196 | my @keptfiles = (); | ||||
| 197 | if ( $onefile->{'Selectfiles'} ) | ||||
| 198 | { | ||||
| 199 | $select_files = 1; | ||||
| 200 | $selectlistfiles = get_patch_file_list( $onefile->{'Selectfiles'} ); | ||||
| 201 | $infoline = "Selected file list defined at file: $onefile->{'Name'} :\n"; | ||||
| 202 | push( @installer::globals::logfileinfo, $infoline); | ||||
| 203 | for ( my $k = 0; $k <= $#{$selectlistfiles}; $k++ ) | ||||
| 204 | { | ||||
| 205 | $infoline = "\"${$selectlistfiles}[$k]\"\n"; | ||||
| 206 | push( @installer::globals::logfileinfo, $infoline); | ||||
| 207 | } | ||||
| 208 | } | ||||
| 209 | |||||
| 210 | if ( $onefile->{'Selectfiles'} ) { $onefile->{'Selectfiles'} = ""; } # Selected files list no longer required | ||||
| 211 | |||||
| 212 | # mechanism to define patch files inside an archive files | ||||
| 213 | my $select_patch_files = 0; | ||||
| 214 | my $patchlistfiles = ""; | ||||
| 215 | my @keptpatchflags = (); | ||||
| 216 | 210 | 158µs | if (( $styles =~ /\bPATCH\b/ ) && ( $onefile->{'Patchfiles'} ) && ( $installer::globals::patch )) # spent 158µs making 210 calls to installer::archivefiles::CORE:match, avg 750ns/call | ||
| 217 | { | ||||
| 218 | $select_patch_files = 1; # special handling if a Patchlist is defined | ||||
| 219 | $patchlistfiles = get_patch_file_list( $onefile->{'Patchfiles'} ); | ||||
| 220 | $infoline = "Patch file list defined at file: $onefile->{'Name'} :\n"; | ||||
| 221 | push( @installer::globals::logfileinfo, $infoline); | ||||
| 222 | for ( my $k = 0; $k <= $#{$patchlistfiles}; $k++ ) | ||||
| 223 | { | ||||
| 224 | $infoline = "\"${$patchlistfiles}[$k]\"\n"; | ||||
| 225 | push( @installer::globals::logfileinfo, $infoline); | ||||
| 226 | } | ||||
| 227 | } | ||||
| 228 | |||||
| 229 | if ( $onefile->{'Patchfiles'} ) { $onefile->{'Patchfiles'} = ""; } # Patch file list no longer required | ||||
| 230 | |||||
| 231 | # creating directories | ||||
| 232 | |||||
| 233 | my $onelanguage = $onefile->{'specificlanguage'}; | ||||
| 234 | |||||
| 235 | # files without language into directory "00" | ||||
| 236 | |||||
| 237 | if ($onelanguage eq "") { $onelanguage = "00"; } | ||||
| 238 | |||||
| 239 | my $unzipdir; | ||||
| 240 | |||||
| 241 | $unzipdir = $platformunzipdirbase . $installer::globals::separator . $onelanguage . $installer::globals::separator; | ||||
| 242 | |||||
| 243 | 210 | 135ms | installer::systemactions::create_directory($unzipdir); # creating language specific subdirectories # spent 135ms making 210 calls to installer::systemactions::create_directory, avg 644µs/call | ||
| 244 | |||||
| 245 | my $onefilename = $onefile->{'Name'}; | ||||
| 246 | 210 | 1.49ms | $onefilename =~ s/\./\_/g; # creating new directory name # spent 1.49ms making 210 calls to installer::archivefiles::CORE:subst, avg 7µs/call | ||
| 247 | 210 | 132µs | $onefilename =~ s/\//\_/g; # only because of /letter/fontunxpsprint.zip, the only zip file with path # spent 132µs making 210 calls to installer::archivefiles::CORE:subst, avg 630ns/call | ||
| 248 | $unzipdir = $unzipdir . $onefilename . $installer::globals::separator; | ||||
| 249 | |||||
| 250 | 210 | 192ms | if ( $installer::globals::dounzip ) { installer::systemactions::create_directory($unzipdir); } # creating subdirectories with the names of the zipfiles # spent 192ms making 210 calls to installer::systemactions::create_directory, avg 913µs/call | ||
| 251 | |||||
| 252 | 210 | 9.52ms | my $zip = Archive::Zip->new(); # spent 9.52ms making 210 calls to Archive::Zip::new, avg 45µs/call | ||
| 253 | 210 | 3.88s | if ( $zip->read($sourcepath) != AZ_OK ) # spent 3.88s making 210 calls to Archive::Zip::Archive::read, avg 18.5ms/call | ||
| 254 | { | ||||
| 255 | $infoline = "ERROR: Could not unzip $sourcepath\n"; | ||||
| 256 | push( @installer::globals::logfileinfo, $infoline); | ||||
| 257 | } | ||||
| 258 | |||||
| 259 | my $counter = 0; | ||||
| 260 | my $contains_dll = 0; | ||||
| 261 | my @dllList = (); | ||||
| 262 | my @dirs = (); | ||||
| 263 | 210 | 103ms | foreach my $member ( $zip->memberNames() ) # spent 103ms making 210 calls to Archive::Zip::Archive::memberNames, avg 490µs/call | ||
| 264 | { | ||||
| 265 | 29946 | 113ms | $counter++; | ||
| 266 | 4 | 4µs | 9982 | 39.4ms | if ( $member =~ /.dll\s*$/i ) { $contains_dll = 1; push(@dllList, $member); } # spent 39.4ms making 9982 calls to installer::archivefiles::CORE:match, avg 4µs/call |
| 267 | 9982 | 7.45ms | if ( $member =~ m/\/$/ ) { push(@dirs, $member); } # spent 7.45ms making 9982 calls to installer::archivefiles::CORE:match, avg 746ns/call | ||
| 268 | } | ||||
| 269 | |||||
| 270 | 1470 | 7.41ms | if (! ( $counter > 0 )) # the zipfile is empty | ||
| 271 | { | ||||
| 272 | $infoline = "ERROR: Could not unzip $sourcepath\n"; | ||||
| 273 | push( @installer::globals::logfileinfo, $infoline); | ||||
| 274 | |||||
| 275 | } | ||||
| 276 | else | ||||
| 277 | { | ||||
| 278 | 840 | 4.12ms | if ( $installer::globals::dounzip ) # really unpacking the files | ||
| 279 | { | ||||
| 280 | 210 | 43.2s | if ( $zip->extractTree("", $unzipdir) != AZ_OK ) { installer::exiter::exit_program("ERROR: $infoline", "resolving_archive_flag"); } # spent 43.2s making 210 calls to Archive::Zip::Archive::extractTree, avg 206ms/call | ||
| 281 | |||||
| 282 | 14 | 1.03ms | 210 | 1.25ms | if (( $^O =~ /cygwin/i ) && ( $contains_dll )) # spent 1.25ms making 210 calls to installer::archivefiles::CORE:match, avg 6µs/call |
| 283 | { | ||||
| 284 | 2 | 24µs | my $dir = getcwd(); # spent 24µs making 2 calls to Cwd::__ANON__[Cwd.pm:406], avg 12µs/call | ||
| 285 | 2 | 239µs | chdir($unzipdir); # spent 239µs making 2 calls to installer::archivefiles::CORE:chdir, avg 120µs/call | ||
| 286 | 2 | 513µs | my $changed = chmod(0775, @dllList); # spent 513µs making 2 calls to installer::archivefiles::CORE:chmod, avg 257µs/call | ||
| 287 | $infoline = "Changed mode of $changed files (of ".scalar(@dllList).")\n"; | ||||
| 288 | push( @installer::globals::logfileinfo, $infoline); | ||||
| 289 | 2 | 196µs | chdir($dir); # spent 196µs making 2 calls to installer::archivefiles::CORE:chdir, avg 98µs/call | ||
| 290 | |||||
| 291 | if ($changed != scalar(@dllList)) | ||||
| 292 | { | ||||
| 293 | $infoline = "ERROR: Could not chmod all files!\n"; | ||||
| 294 | push( @installer::globals::logfileinfo, $infoline); | ||||
| 295 | } | ||||
| 296 | } | ||||
| 297 | |||||
| 298 | if ( ! $installer::globals::iswindowsbuild && scalar(@dirs) > 0 ) | ||||
| 299 | { | ||||
| 300 | my $dir = getcwd(); | ||||
| 301 | chdir($unzipdir); | ||||
| 302 | # Setting unix rights to "775" for all created directories inside the package | ||||
| 303 | my $changed = chmod(0775, @dirs); | ||||
| 304 | $infoline = "Changed mode of : $changed; should be: ".scalar(@dirs)."\n"; | ||||
| 305 | chdir($dir); | ||||
| 306 | |||||
| 307 | push( @installer::globals::logfileinfo, $infoline); | ||||
| 308 | |||||
| 309 | if ($changed != scalar(@dirs)) | ||||
| 310 | { | ||||
| 311 | $infoline = "ERROR: Could not chmod all files!\n"; | ||||
| 312 | push( @installer::globals::logfileinfo, $infoline); | ||||
| 313 | } | ||||
| 314 | } | ||||
| 315 | |||||
| 316 | # Selecting names of executable files in extensions | ||||
| 317 | 53 | 30.8ms | if ( $set_executable_privileges ) # spent 30.8ms making 53 calls to installer::archivefiles::collect_all_executable_files_in_extensions, avg 580µs/call | ||
| 318 | { | ||||
| 319 | collect_all_executable_files_in_extensions($unzipdir, \%executable_files_in_extensions); | ||||
| 320 | } | ||||
| 321 | } | ||||
| 322 | |||||
| 323 | my $zipfileref = \@zipfile; | ||||
| 324 | my $unziperror = 0; | ||||
| 325 | |||||
| 326 | 210 | 105ms | foreach my $zipname ( $zip->memberNames() ) # spent 105ms making 210 calls to Archive::Zip::Archive::memberNames, avg 500µs/call | ||
| 327 | { | ||||
| 328 | # Format from Archive:::Zip : | ||||
| 329 | # dir1/ | ||||
| 330 | # dir1/so7drawing.desktop | ||||
| 331 | |||||
| 332 | # some directories and files (from the help) start with "./simpress.idx" | ||||
| 333 | |||||
| 334 | 29946 | 196ms | 9982 | 11.0ms | $zipname =~ s/^\s*\.\///; # spent 11.0ms making 9982 calls to installer::archivefiles::CORE:subst, avg 1µs/call |
| 335 | |||||
| 336 | 9982 | 14.0ms | if ($installer::globals::iswin and $^O =~ /MSWin/i) { $zipname =~ s/\//\\/g; } # spent 14.0ms making 9982 calls to installer::archivefiles::CORE:match, avg 1µs/call | ||
| 337 | |||||
| 338 | 157580 | 1.10s | 19964 | 35.7ms | if ( $zipname =~ /\Q$installer::globals::separator\E\s*$/ ) # slash or backslash at the end characterizes a directory # spent 26.3ms making 9982 calls to installer::archivefiles::CORE:match, avg 3µs/call
# spent 9.41ms making 9982 calls to installer::archivefiles::CORE:regcomp, avg 942ns/call |
| 339 | { | ||||
| 340 | $zipname = $zipname . "\n"; | ||||
| 341 | push(@{$additionalpathsref}, $zipname); | ||||
| 342 | |||||
| 343 | # Also needed here: | ||||
| 344 | # Name | ||||
| 345 | # Language | ||||
| 346 | # ismultilingual | ||||
| 347 | # Basedirectory | ||||
| 348 | |||||
| 349 | # This is not needed, because the list of all directories for the | ||||
| 350 | # epm list file is generated from the destination directories of the | ||||
| 351 | # files included in the product! | ||||
| 352 | } | ||||
| 353 | else | ||||
| 354 | { | ||||
| 355 | my %newfile = (); | ||||
| 356 | %newfile = %{$onefile}; | ||||
| 357 | $newfile{'Name'} = $zipname; | ||||
| 358 | my $destination = $onefile->{'destination'}; | ||||
| 359 | 8601 | 209ms | installer::pathanalyzer::get_path_from_fullqualifiedname(\$destination); # spent 209ms making 8601 calls to installer::pathanalyzer::get_path_from_fullqualifiedname, avg 24µs/call | ||
| 360 | $newfile{'destination'} = $destination . $zipname; | ||||
| 361 | $newfile{'sourcepath'} = $unzipdir . $zipname; | ||||
| 362 | $newfile{'zipfilename'} = $onefile->{'Name'}; | ||||
| 363 | $newfile{'zipfilesource'} = $onefile->{'sourcepath'}; | ||||
| 364 | $newfile{'zipfiledestination'} = $onefile->{'destination'}; | ||||
| 365 | |||||
| 366 | if (( $use_internal_rights ) && ( ! $installer::globals::iswin )) | ||||
| 367 | { | ||||
| 368 | my $value = sprintf("%o", (stat($newfile{'sourcepath'}))[2]); | ||||
| 369 | $newfile{'UnixRights'} = substr($value, 3); | ||||
| 370 | $infoline = "Setting unix rights for \"$newfile{'sourcepath'}\" to \"$newfile{'UnixRights'}\"\n"; | ||||
| 371 | push( @installer::globals::logfileinfo, $infoline); | ||||
| 372 | } | ||||
| 373 | |||||
| 374 | 18681 | 34.9ms | if ( $set_executable_privileges ) | ||
| 375 | { | ||||
| 376 | # All paths to executables are saved in the hash %executable_files_in_extensions | ||||
| 377 | my $compare_path = $newfile{'sourcepath'}; | ||||
| 378 | 6227 | 5.78ms | $compare_path =~ s/\\/\//g; # contains only slashes for comparison reasons # spent 5.78ms making 6227 calls to installer::archivefiles::CORE:subst, avg 928ns/call | ||
| 379 | if ( exists($executable_files_in_extensions{$compare_path}) ) | ||||
| 380 | { | ||||
| 381 | $newfile{'UnixRights'} = "775"; | ||||
| 382 | $infoline = "Executable in Extension: Setting unix rights for \"$newfile{'sourcepath'}\" to \"$newfile{'UnixRights'}\"\n"; | ||||
| 383 | push( @installer::globals::logfileinfo, $infoline); | ||||
| 384 | } | ||||
| 385 | } | ||||
| 386 | |||||
| 387 | if ( $select_files ) | ||||
| 388 | { | ||||
| 389 | if ( ! grep {$_ eq $zipname} @{$selectlistfiles} ) | ||||
| 390 | { | ||||
| 391 | $infoline = "Removing from ARCHIVE file $onefilename: $zipname\n"; | ||||
| 392 | push( @installer::globals::logfileinfo, $infoline); | ||||
| 393 | next; # ignoring files, that are not included in $selectlistfiles | ||||
| 394 | } | ||||
| 395 | else | ||||
| 396 | { | ||||
| 397 | $infoline = "Keeping from ARCHIVE file $onefilename: $zipname\n"; | ||||
| 398 | push( @installer::globals::logfileinfo, $infoline); | ||||
| 399 | push( @keptfiles, $zipname); # collecting all kept files | ||||
| 400 | } | ||||
| 401 | } | ||||
| 402 | |||||
| 403 | if ( $select_patch_files ) | ||||
| 404 | { | ||||
| 405 | # Is this file listed in the Patchfile list? | ||||
| 406 | # $zipname (filename including path in zip file has to be listed in patchfile list | ||||
| 407 | |||||
| 408 | if ( ! grep {$_ eq $zipname} @{$patchlistfiles} ) | ||||
| 409 | { | ||||
| 410 | $newfile{'Styles'} =~ s/\bPATCH\b//; # removing the flag PATCH | ||||
| 411 | $newfile{'Styles'} =~ s/\,\s*\,/\,/; | ||||
| 412 | $newfile{'Styles'} =~ s/\(\s*\,/\(/; | ||||
| 413 | $newfile{'Styles'} =~ s/\,\s*\)/\)/; | ||||
| 414 | } | ||||
| 415 | else | ||||
| 416 | { | ||||
| 417 | push( @keptpatchflags, $zipname); # collecting all PATCH flags | ||||
| 418 | } | ||||
| 419 | } | ||||
| 420 | |||||
| 421 | if ( $rename_to_language ) | ||||
| 422 | { | ||||
| 423 | my $newzipname = put_language_into_name($zipname, $onelanguage); | ||||
| 424 | my $oldfilename = $unzipdir . $zipname; | ||||
| 425 | my $newfilename = $unzipdir . $newzipname; | ||||
| 426 | |||||
| 427 | installer::systemactions::copy_one_file($oldfilename, $newfilename); | ||||
| 428 | |||||
| 429 | $newfile{'Name'} = $newzipname; | ||||
| 430 | $newfile{'destination'} = $destination . $newzipname; | ||||
| 431 | $newfile{'sourcepath'} = $unzipdir . $newzipname; | ||||
| 432 | |||||
| 433 | $infoline = "RENAME_TO_LANGUAGE: Using $newzipname instead of $zipname!\n"; | ||||
| 434 | push( @installer::globals::logfileinfo, $infoline); | ||||
| 435 | } | ||||
| 436 | |||||
| 437 | my $sourcefiletest = $unzipdir . $zipname; | ||||
| 438 | 8601 | 807ms | if ( ! -f $sourcefiletest ) # spent 807ms making 8601 calls to installer::archivefiles::CORE:ftfile, avg 94µs/call | ||
| 439 | { | ||||
| 440 | $infoline = "ATTENTION: Unzip failed for $sourcefiletest!\n"; | ||||
| 441 | push( @installer::globals::logfileinfo, $infoline); | ||||
| 442 | $unziperror = 1; | ||||
| 443 | } | ||||
| 444 | |||||
| 445 | # only adding the new line into the files array, if not in repeat modus | ||||
| 446 | |||||
| 447 | if ( ! $repeat_unzip ) { push(@newallfilesarray, \%newfile); } | ||||
| 448 | } | ||||
| 449 | } | ||||
| 450 | |||||
| 451 | # Comparing the content of @keptfiles and $selectlistfiles | ||||
| 452 | # Do all files from the list of selected files are stored in @keptfiles ? | ||||
| 453 | # @keptfiles contains only files included in $selectlistfiles. But are all | ||||
| 454 | # files from $selectlistfiles included in @keptfiles? | ||||
| 455 | |||||
| 456 | if ( $select_files ) | ||||
| 457 | { | ||||
| 458 | my $number = $#{$selectlistfiles} + 1; | ||||
| 459 | $infoline = "SELECTLIST: Number of files in file selection list: $number\n"; | ||||
| 460 | push( @installer::globals::logfileinfo, $infoline); | ||||
| 461 | $number = $#keptfiles + 1; | ||||
| 462 | $infoline = "SELECTLIST: Number of kept files: $number\n"; | ||||
| 463 | push( @installer::globals::logfileinfo, $infoline); | ||||
| 464 | |||||
| 465 | for ( my $k = 0; $k <= $#keptfiles; $k++ ) | ||||
| 466 | { | ||||
| 467 | $infoline = "KEPT FILES: $keptfiles[$k]\n"; | ||||
| 468 | push( @installer::globals::logfileinfo, $infoline); | ||||
| 469 | } | ||||
| 470 | |||||
| 471 | my @warningfiles = (); | ||||
| 472 | |||||
| 473 | for ( my $k = 0; $k <= $#{$selectlistfiles}; $k++ ) | ||||
| 474 | { | ||||
| 475 | if ( ! grep {$_ eq ${$selectlistfiles}[$k]} @keptfiles ) | ||||
| 476 | { | ||||
| 477 | push(@warningfiles, ${$selectlistfiles}[$k]); | ||||
| 478 | } | ||||
| 479 | } | ||||
| 480 | |||||
| 481 | for ( my $k = 0; $k <= $#warningfiles; $k++ ) | ||||
| 482 | { | ||||
| 483 | $infoline = "WARNING: $warningfiles[$k] not included in install set (does not exist in zip file)!\n"; | ||||
| 484 | push( @installer::globals::logfileinfo, $infoline); | ||||
| 485 | } | ||||
| 486 | |||||
| 487 | } | ||||
| 488 | |||||
| 489 | # Comparing the content of @keptpatchflags and $patchlistfiles | ||||
| 490 | # Do all files from the patch list have a PATCH flag ? | ||||
| 491 | # @keptpatchflags contains only files included in $patchlistfiles. But are all | ||||
| 492 | # files from $patchlistfiles included in @keptpatchflags? | ||||
| 493 | |||||
| 494 | if ( $select_patch_files ) | ||||
| 495 | { | ||||
| 496 | my $number = $#{$patchlistfiles} + 1; | ||||
| 497 | $infoline = "PATCHLIST: Number of files in patch list: $number\n"; | ||||
| 498 | push( @installer::globals::logfileinfo, $infoline); | ||||
| 499 | $number = $#keptpatchflags + 1; | ||||
| 500 | $infoline = "PATCHLIST: Number of kept PATCH flags: $number\n"; | ||||
| 501 | push( @installer::globals::logfileinfo, $infoline); | ||||
| 502 | |||||
| 503 | for ( my $k = 0; $k <= $#keptpatchflags; $k++ ) | ||||
| 504 | { | ||||
| 505 | $infoline = "KEPT PATCH FLAGS: $keptpatchflags[$k]\n"; | ||||
| 506 | push( @installer::globals::logfileinfo, $infoline); | ||||
| 507 | } | ||||
| 508 | |||||
| 509 | my @warningfiles = (); | ||||
| 510 | |||||
| 511 | for ( my $k = 0; $k <= $#{$patchlistfiles}; $k++ ) | ||||
| 512 | { | ||||
| 513 | if ( ! grep {$_ eq ${$patchlistfiles}[$k]} @keptpatchflags ) | ||||
| 514 | { | ||||
| 515 | push(@warningfiles, ${$patchlistfiles}[$k]); | ||||
| 516 | } | ||||
| 517 | } | ||||
| 518 | |||||
| 519 | for ( my $k = 0; $k <= $#warningfiles; $k++ ) | ||||
| 520 | { | ||||
| 521 | $infoline = "WARNING: $warningfiles[$k] did not keep PATCH flag (does not exist in zip file)!\n"; | ||||
| 522 | push( @installer::globals::logfileinfo, $infoline); | ||||
| 523 | } | ||||
| 524 | } | ||||
| 525 | |||||
| 526 | 840 | 1.02ms | if ( $unziperror ) | ||
| 527 | { | ||||
| 528 | installer::logger::print_warning( "Repeating to unpack $sourcepath! \n" ); | ||||
| 529 | $infoline = "ATTENTION: Repeating to unpack $sourcepath !\n"; | ||||
| 530 | push( @installer::globals::logfileinfo, $infoline); | ||||
| 531 | $repeat_unzip = 1; | ||||
| 532 | $maxcounter++; | ||||
| 533 | |||||
| 534 | if ( $maxcounter == 5 ) # exiting the program | ||||
| 535 | { | ||||
| 536 | installer::exiter::exit_program("ERROR: Failed to unzip $sourcepath !", "resolving_archive_flag"); | ||||
| 537 | } | ||||
| 538 | } | ||||
| 539 | else | ||||
| 540 | { | ||||
| 541 | $infoline = "Info: $sourcepath unpacked without problems !\n"; | ||||
| 542 | push( @installer::globals::logfileinfo, $infoline); | ||||
| 543 | $repeat_unzip = 0; | ||||
| 544 | $maxcounter = 0; | ||||
| 545 | } | ||||
| 546 | } | ||||
| 547 | } | ||||
| 548 | else # nothing to do here, no zipped file (no ARCHIVE flag) | ||||
| 549 | { | ||||
| 550 | push(@newallfilesarray, $onefile); | ||||
| 551 | } | ||||
| 552 | } | ||||
| 553 | |||||
| 554 | $infoline = "\n"; | ||||
| 555 | push( @installer::globals::logfileinfo, $infoline); | ||||
| 556 | |||||
| 557 | return \@newallfilesarray; | ||||
| 558 | } | ||||
| 559 | |||||
| 560 | |||||
| 561 | 1 | 8µs | 1; | ||
sub installer::archivefiles::CORE:chdir; # opcode | |||||
# spent 513µs within installer::archivefiles::CORE:chmod which was called 2 times, avg 257µs/call:
# 2 times (513µs+0s) by installer::archivefiles::resolving_archive_flag at line 286, avg 257µs/call | |||||
# spent 813ms within installer::archivefiles::CORE:ftfile which was called 8654 times, avg 94µs/call:
# 8601 times (807ms+0s) by installer::archivefiles::resolving_archive_flag at line 438, avg 94µs/call
# 53 times (5.29ms+0s) by installer::archivefiles::collect_all_executable_files_in_extensions at line 135, avg 100µs/call | |||||
# spent 95.6ms within installer::archivefiles::CORE:match which was called 50066 times, avg 2µs/call:
# 9982 times (39.4ms+0s) by installer::archivefiles::resolving_archive_flag at line 266, avg 4µs/call
# 9982 times (26.3ms+0s) by installer::archivefiles::resolving_archive_flag at line 338, avg 3µs/call
# 9982 times (14.0ms+0s) by installer::archivefiles::resolving_archive_flag at line 336, avg 1µs/call
# 9982 times (7.45ms+0s) by installer::archivefiles::resolving_archive_flag at line 267, avg 746ns/call
# 7504 times (4.93ms+0s) by installer::archivefiles::resolving_archive_flag at line 173, avg 657ns/call
# 458 times (601µs+0s) by installer::archivefiles::get_all_executables_from_manifest at line 110, avg 1µs/call
# 458 times (442µs+0s) by installer::archivefiles::get_all_executables_from_manifest at line 118, avg 965ns/call
# 458 times (305µs+0s) by installer::archivefiles::get_all_executables_from_manifest at line 108, avg 666ns/call
# 210 times (1.25ms+0s) by installer::archivefiles::resolving_archive_flag at line 282, avg 6µs/call
# 210 times (347µs+0s) by installer::archivefiles::resolving_archive_flag at line 191, avg 2µs/call
# 210 times (191µs+0s) by installer::archivefiles::resolving_archive_flag at line 187, avg 910ns/call
# 210 times (175µs+0s) by installer::archivefiles::resolving_archive_flag at line 178, avg 831ns/call
# 210 times (158µs+0s) by installer::archivefiles::resolving_archive_flag at line 216, avg 750ns/call
# 210 times (125µs+0s) by installer::archivefiles::resolving_archive_flag at line 184, avg 594ns/call | |||||
# spent 10.0ms within installer::archivefiles::CORE:regcomp which was called 10245 times, avg 980ns/call:
# 9982 times (9.41ms+0s) by installer::archivefiles::resolving_archive_flag at line 338, avg 942ns/call
# 210 times (469µs+0s) by installer::archivefiles::resolving_archive_flag at line 178, avg 2µs/call
# 53 times (167µs+0s) by installer::archivefiles::collect_all_executable_files_in_extensions at line 131, avg 3µs/call | |||||
# spent 18.9ms within installer::archivefiles::CORE:subst which was called 16682 times, avg 1µs/call:
# 9982 times (11.0ms+0s) by installer::archivefiles::resolving_archive_flag at line 334, avg 1µs/call
# 6227 times (5.78ms+0s) by installer::archivefiles::resolving_archive_flag at line 378, avg 928ns/call
# 210 times (1.49ms+0s) by installer::archivefiles::resolving_archive_flag at line 246, avg 7µs/call
# 210 times (132µs+0s) by installer::archivefiles::resolving_archive_flag at line 247, avg 630ns/call
# 53 times (484µs+0s) by installer::archivefiles::collect_all_executable_files_in_extensions at line 131, avg 9µs/call |