Filename | /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer/systemactions.pm |
Statements | Executed 578543 statements in 26.8s |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
25568 | 5 | 1 | 6.80s | 6.80s | CORE:ftfile (opcode) | installer::systemactions::
29363 | 8 | 1 | 4.72s | 4.72s | CORE:ftdir (opcode) | installer::systemactions::
13 | 1 | 1 | 4.54s | 4.54s | CORE:backtick (opcode) | installer::systemactions::
8669 | 1 | 1 | 1.85s | 1.85s | CORE:unlink (opcode) | installer::systemactions::
7903 | 1 | 1 | 1.57s | 1.57s | CORE:fteexec (opcode) | installer::systemactions::
8868 | 3 | 1 | 1.33s | 1.33s | CORE:chmod (opcode) | installer::systemactions::
1914 | 1 | 1 | 1.28s | 1.28s | CORE:rmdir (opcode) | installer::systemactions::
529 | 1 | 1 | 823ms | 823ms | CORE:rename (opcode) | installer::systemactions::
218 | 2 | 1 | 809ms | 11.6s | copy_directory_with_fileextension | installer::systemactions::
17561 | 7 | 1 | 763ms | 763ms | CORE:readdir (opcode) | installer::systemactions::
7903 | 12 | 6 | 360ms | 21.8s | copy_one_file | installer::systemactions::
816 | 1 | 1 | 333ms | 333ms | CORE:mkdir (opcode) | installer::systemactions::
1914 | 4 | 3 | 320ms | 7.38s | remove_complete_directory (recurses: max depth 13, inclusive time 64.6s) | installer::systemactions::
3066 | 6 | 1 | 284ms | 284ms | CORE:open_dir (opcode) | installer::systemactions::
497 | 2 | 2 | 236ms | 2.64s | read_full_directory (recurses: max depth 7, inclusive time 1.64s) | installer::systemactions::
1911 | 1 | 1 | 151ms | 151ms | CORE:ftlink (opcode) | installer::systemactions::
109690 | 7 | 1 | 130ms | 130ms | CORE:match (opcode) | installer::systemactions::
111164 | 15 | 1 | 95.5ms | 95.5ms | CORE:regcomp (opcode) | installer::systemactions::
218 | 2 | 1 | 86.8ms | 11.5s | copy_directory | installer::systemactions::
3066 | 6 | 1 | 66.7ms | 66.7ms | CORE:closedir (opcode) | installer::systemactions::
110 | 2 | 2 | 55.8ms | 111ms | find_file_with_file_extension | installer::systemactions::
109 | 1 | 1 | 51.0ms | 777ms | rename_files_with_fileextension | installer::systemactions::
965 | 2 | 2 | 29.2ms | 693ms | create_directory_with_privileges | installer::systemactions::
3034 | 12 | 1 | 20.5ms | 20.5ms | CORE:subst (opcode) | installer::systemactions::
529 | 24 | 4 | 10.7ms | 834ms | rename_one_file | installer::systemactions::
964 | 21 | 10 | 10.4ms | 703ms | create_directory | installer::systemactions::
14 | 2 | 2 | 6.92ms | 11.9ms | get_number_of_langs | installer::systemactions::
20 | 14 | 8 | 2.81ms | 4.60s | create_directories | installer::systemactions::
110 | 1 | 1 | 2.55ms | 2.55ms | CORE:sort (opcode) | installer::systemactions::
1 | 1 | 1 | 2.19ms | 2.61ms | BEGIN@32 | installer::systemactions::
1 | 1 | 1 | 1.04ms | 1.36ms | BEGIN@36 | installer::systemactions::
1 | 1 | 1 | 1.03ms | 1.35ms | BEGIN@35 | installer::systemactions::
1 | 1 | 1 | 373µs | 456µs | BEGIN@30 | installer::systemactions::
1 | 1 | 1 | 72µs | 90.5ms | rename_string_in_directory | installer::systemactions::
1 | 1 | 1 | 51µs | 1.62ms | create_pid_directory | installer::systemactions::
1 | 1 | 1 | 41µs | 1.11ms | create_directory_next_to_directory | installer::systemactions::
1 | 1 | 1 | 27µs | 136ms | rename_directory | installer::systemactions::
1 | 1 | 1 | 21µs | 72µs | BEGIN@31 | installer::systemactions::
1 | 1 | 1 | 16µs | 20µs | BEGIN@33 | installer::systemactions::
1 | 1 | 1 | 13µs | 15µs | BEGIN@34 | installer::systemactions::
0 | 0 | 0 | 0s | 0s | copy_complete_directory | installer::systemactions::
0 | 0 | 0 | 0s | 0s | create_directory_structure | installer::systemactions::
0 | 0 | 0 | 0s | 0s | create_unique_directory | installer::systemactions::
0 | 0 | 0 | 0s | 0s | find_new_content_in_directory | installer::systemactions::
0 | 0 | 0 | 0s | 0s | get_all_directories | installer::systemactions::
0 | 0 | 0 | 0s | 0s | get_all_directories_without_path | installer::systemactions::
0 | 0 | 0 | 0s | 0s | get_directoryname | installer::systemactions::
0 | 0 | 0 | 0s | 0s | hardlink_complete_directory | installer::systemactions::
0 | 0 | 0 | 0s | 0s | hardlink_one_file | installer::systemactions::
0 | 0 | 0 | 0s | 0s | is_empty_dir | installer::systemactions::
0 | 0 | 0 | 0s | 0s | make_numbered_dir | installer::systemactions::
0 | 0 | 0 | 0s | 0s | read_complete_directory | installer::systemactions::
0 | 0 | 0 | 0s | 0s | read_directory | installer::systemactions::
0 | 0 | 0 | 0s | 0s | remove_empty_dirs_in_folder | installer::systemactions::
0 | 0 | 0 | 0s | 0s | softlink_complete_directory | installer::systemactions::
0 | 0 | 0 | 0s | 0s | softlink_one_file | installer::systemactions::
0 | 0 | 0 | 0s | 0s | try_to_create_directory | installer::systemactions::
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::systemactions; | ||||
29 | |||||
30 | 2 | 63µs | 2 | 540µs | # spent 456µs (373+84) within installer::systemactions::BEGIN@30 which was called:
# once (373µs+84µs) by installer::exiter::BEGIN@36 at line 30 # spent 456µs making 1 call to installer::systemactions::BEGIN@30
# spent 84µs making 1 call to Exporter::import |
31 | 2 | 62µs | 2 | 123µs | # spent 72µs (21+51) within installer::systemactions::BEGIN@31 which was called:
# once (21µs+51µs) by installer::exiter::BEGIN@36 at line 31 # spent 72µs making 1 call to installer::systemactions::BEGIN@31
# spent 51µs making 1 call to Exporter::import |
32 | 2 | 1.04ms | 2 | 2.62ms | # spent 2.61ms (2.19+427µs) within installer::systemactions::BEGIN@32 which was called:
# once (2.19ms+427µs) by installer::exiter::BEGIN@36 at line 32 # spent 2.61ms making 1 call to installer::systemactions::BEGIN@32
# spent 3µs making 1 call to UNIVERSAL::import |
33 | 2 | 57µs | 2 | 24µs | # spent 20µs (16+4) within installer::systemactions::BEGIN@33 which was called:
# once (16µs+4µs) by installer::exiter::BEGIN@36 at line 33 # spent 20µs making 1 call to installer::systemactions::BEGIN@33
# spent 4µs making 1 call to UNIVERSAL::import |
34 | 2 | 51µs | 2 | 17µs | # spent 15µs (13+2) within installer::systemactions::BEGIN@34 which was called:
# once (13µs+2µs) by installer::exiter::BEGIN@36 at line 34 # spent 15µs making 1 call to installer::systemactions::BEGIN@34
# spent 2µs making 1 call to UNIVERSAL::import |
35 | 2 | 998µs | 2 | 1.36ms | # spent 1.35ms (1.03+324µs) within installer::systemactions::BEGIN@35 which was called:
# once (1.03ms+324µs) by installer::exiter::BEGIN@36 at line 35 # spent 1.35ms making 1 call to installer::systemactions::BEGIN@35
# spent 3µs making 1 call to UNIVERSAL::import |
36 | 2 | 10.9ms | 2 | 1.37ms | # spent 1.36ms (1.04+324µs) within installer::systemactions::BEGIN@36 which was called:
# once (1.04ms+324µs) by installer::exiter::BEGIN@36 at line 36 # spent 1.36ms making 1 call to installer::systemactions::BEGIN@36
# spent 3µs making 1 call to UNIVERSAL::import |
37 | |||||
38 | ###################################################### | ||||
39 | # Creating a new direcotory | ||||
40 | ###################################################### | ||||
41 | |||||
42 | sub create_directory | ||||
43 | # spent 703ms (10.4+693) within installer::systemactions::create_directory which was called 964 times, avg 729µs/call:
# 210 times (1.60ms+190ms) by installer::archivefiles::resolving_archive_flag at line 250 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer/archivefiles.pm, avg 913µs/call
# 210 times (2.27ms+133ms) by installer::archivefiles::resolving_archive_flag at line 243 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer/archivefiles.pm, avg 644µs/call
# 110 times (951µs+75.1ms) by installer::scpzipfiles::resolving_scpzip_replace_flag at line 102 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer/scpzipfiles.pm, avg 691µs/call
# 109 times (1.73ms+80.1ms) by installer::run at line 1557 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer.pm, avg 751µs/call
# 109 times (1.37ms+73.0ms) by installer::windows::idtglobal::prepare_language_idt_directory at line 761 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer/windows/idtglobal.pm, avg 682µs/call
# 109 times (1.25ms+72.4ms) by installer::windows::idtglobal::prepare_language_idt_directory at line 782 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer/windows/idtglobal.pm, avg 676µs/call
# 20 times (156µs+13.8ms) by installer::systemactions::create_directories at line 248, avg 699µs/call
# 20 times (225µs+9.34ms) by installer::systemactions::create_directories at line 236, avg 479µs/call
# 20 times (152µs+5.74ms) by installer::systemactions::create_directories at line 245, avg 294µs/call
# 13 times (322µs+14.1ms) by installer::systemactions::create_directories at line 276, avg 1.11ms/call
# 9 times (96µs+2.79ms) by installer::scppatchsoname::resolving_patchsoname_flag at line 169 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer/scppatchsoname.pm, avg 321µs/call
# 8 times (107µs+6.60ms) by installer::profiles::create_profiles at line 168 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer/profiles.pm, avg 839µs/call
# 5 times (81µs+4.97ms) by installer::windows::mergemodule::merge_mergemodules_into_msi_database at line 94 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer/windows/mergemodule.pm, avg 1.01ms/call
# 5 times (40µs+4.62ms) by installer::windows::mergemodule::change_file_table at line 1120 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer/windows/mergemodule.pm, avg 933µs/call
# once (19µs+1.30ms) by installer::run at line 553 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer.pm
# once (13µs+1.30ms) by installer::systemactions::create_pid_directory at line 1234
# once (9µs+975µs) by installer::parameter::setglobalvariables at line 395 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer/parameter.pm
# once (8µs+967µs) by installer::systemactions::create_directory_next_to_directory at line 908
# once (11µs+936µs) by installer::run at line 1467 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer.pm
# once (14µs+911µs) by installer::run at line 1708 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer.pm
# once (10µs+654µs) by installer::worker::remove_old_installation_sets at line 149 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer/worker.pm | ||||
44 | 964 | 1.57ms | my ($directory) = @_; | ||
45 | |||||
46 | 964 | 7.01ms | 964 | 693ms | create_directory_with_privileges( $directory, "755" ); # spent 693ms making 964 calls to installer::systemactions::create_directory_with_privileges, avg 718µs/call |
47 | } | ||||
48 | |||||
49 | ###################################################### | ||||
50 | # Creating a new direcotory with defined privileges | ||||
51 | ###################################################### | ||||
52 | |||||
53 | sub create_directory_with_privileges | ||||
54 | # spent 693ms (29.2+664) within installer::systemactions::create_directory_with_privileges which was called 965 times, avg 718µs/call:
# 964 times (29.2ms+663ms) by installer::systemactions::create_directory at line 46, avg 718µs/call
# once (51µs+520µs) by installer::parameter::setglobalvariables at line 380 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer/parameter.pm | ||||
55 | 965 | 1.26ms | my ($directory, $privileges) = @_; | ||
56 | |||||
57 | 965 | 541µs | my $returnvalue = 1; | ||
58 | 965 | 673µs | my $infoline = ""; | ||
59 | 965 | 1.70ms | my $localprivileges = oct("0".$privileges); # changes "777" to 0777 | ||
60 | |||||
61 | 965 | 175ms | 965 | 163ms | if (!(-d $directory)) # spent 163ms making 965 calls to installer::systemactions::CORE:ftdir, avg 169µs/call |
62 | { | ||||
63 | 816 | 338ms | 816 | 333ms | $returnvalue = mkdir($directory, $localprivileges); # spent 333ms making 816 calls to installer::systemactions::CORE:mkdir, avg 408µs/call |
64 | |||||
65 | 816 | 1.13ms | if ($returnvalue) | ||
66 | { | ||||
67 | 816 | 1.57ms | $infoline = "\nCreated directory: $directory\n"; | ||
68 | 816 | 1.63ms | push(@installer::globals::logfileinfo, $infoline); | ||
69 | |||||
70 | 816 | 141ms | 816 | 136ms | chmod $localprivileges, $directory; # spent 136ms making 816 calls to installer::systemactions::CORE:chmod, avg 167µs/call |
71 | } | ||||
72 | else | ||||
73 | { | ||||
74 | # New solution in parallel packing: It is possible, that the directory now exists, although it | ||||
75 | # was not created in this process. There is only an important error, if the directory does not | ||||
76 | # exist now. | ||||
77 | |||||
78 | $infoline = "\nDid not succeed in creating directory: \"$directory\". Further attempts will follow.\n"; | ||||
79 | push(@installer::globals::logfileinfo, $infoline); | ||||
80 | |||||
81 | if (!(-d $directory)) | ||||
82 | { | ||||
83 | # Problem with parallel packaging? -> Try a little harder, before exiting. | ||||
84 | # Did someone else remove the parent directory in the meantime? | ||||
85 | my $parentdir = $directory; | ||||
86 | installer::pathanalyzer::get_path_from_fullqualifiedname(\$parentdir); | ||||
87 | if (!(-d $parentdir)) | ||||
88 | { | ||||
89 | $returnvalue = mkdir($directory, $localprivileges); | ||||
90 | |||||
91 | if ($returnvalue) | ||||
92 | { | ||||
93 | $infoline = "\nAttention: Successfully created parent directory (should already be created before): $parentdir\n"; | ||||
94 | push(@installer::globals::logfileinfo, $infoline); | ||||
95 | |||||
96 | chmod $localprivileges, $parentdir; | ||||
97 | } | ||||
98 | else | ||||
99 | { | ||||
100 | $infoline = "\nError: \"$directory\" could not be created. Even the parent directory \"$parentdir\" does not exist and could not be created.\n"; | ||||
101 | push(@installer::globals::logfileinfo, $infoline); | ||||
102 | if ( -d $parentdir ) | ||||
103 | { | ||||
104 | $infoline = "\nAttention: Finally the parent directory \"$parentdir\" exists, but I could not create it.\n"; | ||||
105 | push(@installer::globals::logfileinfo, $infoline); | ||||
106 | } | ||||
107 | else | ||||
108 | { | ||||
109 | # Now it is time to exit, even the parent could not be created. | ||||
110 | installer::exiter::exit_program("ERROR: Could not create parent directory \"$parentdir\"", "create_directory_with_privileges"); | ||||
111 | } | ||||
112 | } | ||||
113 | } | ||||
114 | |||||
115 | # At this point we have to assume, that the parent directory exist. | ||||
116 | # Trying once more to create the desired directory | ||||
117 | |||||
118 | $returnvalue = mkdir($directory, $localprivileges); | ||||
119 | |||||
120 | if ($returnvalue) | ||||
121 | { | ||||
122 | $infoline = "\nAttention: Created directory \"$directory\" in the second try.\n"; | ||||
123 | push(@installer::globals::logfileinfo, $infoline); | ||||
124 | |||||
125 | chmod $localprivileges, $directory; | ||||
126 | } | ||||
127 | else | ||||
128 | { | ||||
129 | if ( -d $directory ) | ||||
130 | { | ||||
131 | $infoline = "\nAttention: Finally the directory \"$directory\" exists, but I could not create it.\n"; | ||||
132 | push(@installer::globals::logfileinfo, $infoline); | ||||
133 | } | ||||
134 | else | ||||
135 | { | ||||
136 | # It is time to exit, even the second try failed. | ||||
137 | installer::exiter::exit_program("ERROR: Failed to create the directory: $directory", "create_directory_with_privileges"); | ||||
138 | } | ||||
139 | } | ||||
140 | } | ||||
141 | else | ||||
142 | { | ||||
143 | $infoline = "\nAnother process created this directory in exactly this moment :-) : $directory\n"; | ||||
144 | push(@installer::globals::logfileinfo, $infoline); | ||||
145 | } | ||||
146 | } | ||||
147 | } | ||||
148 | else | ||||
149 | { | ||||
150 | 149 | 279µs | $infoline = "\nAlready existing directory, did not create: $directory\n"; | ||
151 | 149 | 284µs | push(@installer::globals::logfileinfo, $infoline); | ||
152 | |||||
153 | 149 | 32.4ms | 149 | 31.5ms | chmod $localprivileges, $directory; # spent 31.5ms making 149 calls to installer::systemactions::CORE:chmod, avg 211µs/call |
154 | } | ||||
155 | } | ||||
156 | |||||
157 | ####################################################################### | ||||
158 | # Calculating the number of languages in the string | ||||
159 | ####################################################################### | ||||
160 | |||||
161 | sub get_number_of_langs | ||||
162 | # spent 11.9ms (6.92+4.94) within installer::systemactions::get_number_of_langs which was called 14 times, avg 847µs/call:
# 13 times (6.44ms+4.60ms) by installer::systemactions::create_directories at line 269, avg 849µs/call
# once (484µs+343µs) by installer::run at line 542 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer.pm | ||||
163 | 14 | 28µs | my ($languagestring) = @_; | ||
164 | |||||
165 | 14 | 7µs | my $number = 1; | ||
166 | |||||
167 | 14 | 17µs | my $workstring = $languagestring; | ||
168 | |||||
169 | 14 | 217µs | 14 | 130µs | while ( $workstring =~ /^\s*(.*)_(.*?)\s*$/ ) # spent 130µs making 14 calls to installer::systemactions::CORE:match, avg 9µs/call |
170 | { | ||||
171 | 1512 | 1.28ms | $workstring = $1; | ||
172 | 1512 | 10.2ms | 1512 | 4.81ms | $number++; # spent 4.81ms making 1512 calls to installer::systemactions::CORE:match, avg 3µs/call |
173 | } | ||||
174 | |||||
175 | 14 | 88µs | return $number; | ||
176 | } | ||||
177 | |||||
178 | ####################################################################### | ||||
179 | # Creating the directories, in which files are generated or unzipped | ||||
180 | ####################################################################### | ||||
181 | |||||
182 | sub create_directories | ||||
183 | # spent 4.60s (2.81ms+4.60) within installer::systemactions::create_directories which was called 20 times, avg 230ms/call:
# 5 times (481µs+6.85ms) by installer::windows::mergemodule::change_file_table at line 1113 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer/windows/mergemodule.pm, avg 1.47ms/call
# 2 times (306µs+573ms) by installer::scppatchsoname::resolving_patchsoname_flag at line 145 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer/scppatchsoname.pm, avg 287ms/call
# 2 times (291µs+558ms) by installer::scpzipfiles::resolving_scpzip_replace_flag at line 79 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer/scpzipfiles.pm, avg 279ms/call
# once (159µs+502ms) by installer::run at line 1731 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer.pm
# once (345µs+481ms) by installer::archivefiles::resolving_archive_flag at line 156 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer/archivefiles.pm
# once (152µs+465ms) by installer::windows::mergemodule::merge_mergemodules_into_msi_database at line 81 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer/windows/mergemodule.pm
# once (164µs+410ms) by installer::worker::create_installation_directory at line 164 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer/worker.pm
# once (155µs+367ms) by installer::run at line 1446 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer.pm
# once (147µs+361ms) by installer::run at line 1447 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer.pm
# once (148µs+297ms) by installer::substfilenamefiles::resolving_subst_filename_flag at line 44 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer/substfilenamefiles.pm
# once (150µs+291ms) by installer::worker::resolving_hidden_flag at line 1311 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer/worker.pm
# once (139µs+280ms) by installer::profiles::create_profiles at line 148 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer/profiles.pm
# once (102µs+2.12ms) by installer::run at line 133 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer.pm
# once (72µs+1.16ms) by installer::run at line 249 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer.pm | ||||
184 | 20 | 50µs | my ($newdirectory, $languagesref) =@_; | ||
185 | |||||
186 | 20 | 479µs | 40 | 262µs | $installer::globals::unpackpath =~ s/\Q$installer::globals::separator\E\s*$//; # removing ending slashes and backslashes # spent 180µs making 20 calls to installer::systemactions::CORE:subst, avg 9µs/call
# spent 82µs making 20 calls to installer::systemactions::CORE:regcomp, avg 4µs/call |
187 | |||||
188 | 20 | 22µs | my $path = ""; | ||
189 | |||||
190 | 20 | 152µs | 14 | 45µs | if (( $newdirectory eq "uno" ) || ( $newdirectory eq "zip" ) || ( $newdirectory eq "cab" ) || ( $newdirectory =~ /rdb\s*$/i )) # special handling for zip files, cab files and services file because of performance reasons # spent 45µs making 14 calls to installer::systemactions::CORE:match, avg 3µs/call |
191 | { | ||||
192 | 6 | 13µs | if ( $installer::globals::temppathdefined ) { $path = $installer::globals::temppath; } | ||
193 | else { $path = $installer::globals::unpackpath; } | ||||
194 | 6 | 103µs | 12 | 53µs | $path =~ s/\Q$installer::globals::separator\E\s*$//; # removing ending slashes and backslashes # spent 35µs making 6 calls to installer::systemactions::CORE:regcomp, avg 6µs/call
# spent 18µs making 6 calls to installer::systemactions::CORE:subst, avg 3µs/call |
195 | 6 | 9µs | $path = $path . $installer::globals::separator; | ||
196 | } | ||||
197 | else | ||||
198 | { | ||||
199 | 14 | 15µs | $path = $installer::globals::unpackpath . $installer::globals::separator; | ||
200 | |||||
201 | # special handling, if LOCALINSTALLDIR is set | ||||
202 | 14 | 13µs | if (( $installer::globals::localinstalldirset ) && ( $newdirectory eq "install" )) | ||
203 | { | ||||
204 | $installer::globals::localinstalldir =~ s/\Q$installer::globals::separator\E\s*$//; | ||||
205 | $path = $installer::globals::localinstalldir . $installer::globals::separator; | ||||
206 | } | ||||
207 | } | ||||
208 | |||||
209 | 20 | 50µs | $infoline = "create_directories: Using $path for $newdirectory !\n"; | ||
210 | 20 | 36µs | push( @installer::globals::logfileinfo, $infoline); | ||
211 | |||||
212 | 20 | 26µs | if ($newdirectory eq "unzip" ) # special handling for common directory | ||
213 | { | ||||
214 | $path = $path . ".." . $installer::globals::separator . "common" . $installer::globals::productextension . $installer::globals::separator; | ||||
215 | create_directory($path); | ||||
216 | |||||
217 | $path = $path . $newdirectory . $installer::globals::separator; | ||||
218 | create_directory($path); | ||||
219 | } | ||||
220 | else | ||||
221 | { | ||||
222 | 20 | 28µs | my $localproductname = $installer::globals::product; | ||
223 | 20 | 18µs | my $localproductsubdir = ""; | ||
224 | |||||
225 | 20 | 108µs | 20 | 29µs | if ( $installer::globals::product =~ /^\s*(.+?)\_\_(.+?)\s*$/ ) # spent 29µs making 20 calls to installer::systemactions::CORE:match, avg 1µs/call |
226 | { | ||||
227 | $localproductname = $1; | ||||
228 | $localproductsubdir = $2; | ||||
229 | } | ||||
230 | |||||
231 | 20 | 38µs | if ( $installer::globals::languagepack ) { $path = $path . $localproductname . "_languagepack" . $installer::globals::separator; } | ||
232 | elsif ( $installer::globals::helppack ) { $path = $path . $localproductname . "_helppack" . $installer::globals::separator; } | ||||
233 | elsif ( $installer::globals::patch ) { $path = $path . $localproductname . "_patch" . $installer::globals::separator; } | ||||
234 | 20 | 30µs | else { $path = $path . $localproductname . $installer::globals::separator; } | ||
235 | |||||
236 | 20 | 85µs | 20 | 9.57ms | create_directory($path); # spent 9.57ms making 20 calls to installer::systemactions::create_directory, avg 479µs/call |
237 | |||||
238 | 20 | 8µs | if ( $localproductsubdir ) | ||
239 | { | ||||
240 | $path = $path . $localproductsubdir . $installer::globals::separator; | ||||
241 | create_directory($path); | ||||
242 | } | ||||
243 | |||||
244 | 20 | 42µs | $path = $path . $installer::globals::installertypedir . $installer::globals::separator; | ||
245 | 20 | 69µs | 20 | 5.89ms | create_directory($path); # spent 5.89ms making 20 calls to installer::systemactions::create_directory, avg 294µs/call |
246 | |||||
247 | 20 | 50µs | $path = $path . $newdirectory . $installer::globals::separator; | ||
248 | 20 | 61µs | 20 | 14.0ms | create_directory($path); # spent 14.0ms making 20 calls to installer::systemactions::create_directory, avg 699µs/call |
249 | |||||
250 | 20 | 27µs | my $locallanguagesref = ""; | ||
251 | |||||
252 | 20 | 53µs | if ( $$languagesref ) { $locallanguagesref = $$languagesref; } | ||
253 | |||||
254 | 20 | 49µs | if ($newdirectory eq "install" && $installer::globals::ooodownloadfilename ne "" ) | ||
255 | { | ||||
256 | # put packages into versioned path; needed only on linux (fdo#30837) | ||||
257 | $path = $path . "$installer::globals::ooodownloadfilename" . $installer::globals::separator; | ||||
258 | create_directory($path); | ||||
259 | } | ||||
260 | else | ||||
261 | { | ||||
262 | 20 | 30µs | if ($locallanguagesref ne "") # this will be a path like "01_49", for Profiles and ConfigurationFiles, idt-Files | ||
263 | { | ||||
264 | |||||
265 | 13 | 13µs | my $languagestring = $$languagesref; | ||
266 | |||||
267 | 13 | 37µs | if (length($languagestring) > $installer::globals::max_lang_length ) | ||
268 | { | ||||
269 | 13 | 67µs | 13 | 11.0ms | my $number_of_languages = get_number_of_langs($languagestring); # spent 11.0ms making 13 calls to installer::systemactions::get_number_of_langs, avg 849µs/call |
270 | 13 | 4.54s | 13 | 4.54s | chomp(my $shorter = `echo $languagestring | md5sum | sed -e "s/ .*//g"`); # spent 4.54s making 13 calls to installer::systemactions::CORE:backtick, avg 349ms/call |
271 | 13 | 187µs | my $id = substr($shorter, 0, 8); # taking only the first 8 digits | ||
272 | 13 | 131µs | $languagestring = "lang_" . $number_of_languages . "_id_" . $id; | ||
273 | } | ||||
274 | |||||
275 | 13 | 57µs | $path = $path . $languagestring . $installer::globals::separator; | ||
276 | 13 | 188µs | 13 | 14.4ms | create_directory($path); # spent 14.4ms making 13 calls to installer::systemactions::create_directory, avg 1.11ms/call |
277 | } | ||||
278 | } | ||||
279 | } | ||||
280 | |||||
281 | 20 | 187µs | 20 | 776µs | installer::remover::remove_ending_pathseparator(\$path); # spent 776µs making 20 calls to installer::remover::remove_ending_pathseparator, avg 39µs/call |
282 | |||||
283 | 20 | 114µs | 20 | 485µs | $path = installer::converter::make_path_conform($path); # spent 485µs making 20 calls to installer::converter::make_path_conform, avg 24µs/call |
284 | |||||
285 | 20 | 206µs | return $path; | ||
286 | } | ||||
287 | |||||
288 | ######################## | ||||
289 | # Copying one file | ||||
290 | ######################## | ||||
291 | |||||
292 | sub copy_one_file | ||||
293 | # spent 21.8s (360ms+21.4) within installer::systemactions::copy_one_file which was called 7903 times, avg 2.75ms/call:
# 4687 times (209ms+10.3s) by installer::systemactions::copy_directory at line 454, avg 2.24ms/call
# 1853 times (90.9ms+6.69s) by installer::systemactions::copy_directory_with_fileextension at line 665, avg 3.66ms/call
# 981 times (40.5ms+2.29s) by installer::windows::idtglobal::prepare_language_idt_directory at line 806 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer/windows/idtglobal.pm, avg 2.37ms/call
# 110 times (4.60ms+248ms) by installer::scpzipfiles::resolving_scpzip_replace_flag at line 127 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer/scpzipfiles.pm, avg 2.29ms/call
# 109 times (8.21ms+1.30s) by installer::run at line 1689 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer.pm, avg 12.0ms/call
# 109 times (4.38ms+240ms) by installer::windows::idtglobal::prepare_language_idt_directory at line 795 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer/windows/idtglobal.pm, avg 2.24ms/call
# 33 times (1.56ms+87.4ms) by installer::windows::mergemodule::change_file_table at line 1237 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer/windows/mergemodule.pm, avg 2.69ms/call
# 9 times (424µs+20.3ms) by installer::scppatchsoname::resolving_patchsoname_flag at line 178 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer/scppatchsoname.pm, avg 2.31ms/call
# 5 times (361µs+111ms) by installer::windows::mergemodule::merge_mergemodules_into_msi_database at line 362 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer/windows/mergemodule.pm, avg 22.3ms/call
# 5 times (361µs+70.8ms) by installer::windows::mergemodule::merge_mergemodules_into_msi_database at line 101 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer/windows/mergemodule.pm, avg 14.2ms/call
# once (71µs+24.1ms) by installer::run at line 1711 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer.pm
# once (73µs+21.9ms) by installer::run at line 1709 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer.pm | ||||
294 | 7903 | 13.7ms | my ($source, $dest) = @_; | ||
295 | |||||
296 | 7903 | 3.69ms | my ($returnvalue, $infoline); | ||
297 | |||||
298 | 7903 | 34.3ms | 7903 | 17.2s | my $copyreturn = copy($source, $dest); # spent 17.2s making 7903 calls to File::Copy::copy, avg 2.17ms/call |
299 | |||||
300 | 7903 | 15.3ms | if ($copyreturn) | ||
301 | { | ||||
302 | 7903 | 16.3ms | $infoline = "Copy: $source to $dest\n"; | ||
303 | 7903 | 4.15ms | $returnvalue = 1; | ||
304 | } | ||||
305 | else | ||||
306 | { | ||||
307 | $infoline = "ERROR: Could not copy $source to $dest $!\n"; | ||||
308 | $returnvalue = 0; | ||||
309 | } | ||||
310 | |||||
311 | 7903 | 20.1ms | push(@installer::globals::logfileinfo, $infoline); | ||
312 | |||||
313 | 7903 | 2.93ms | if ( !$returnvalue ) { | ||
314 | return $returnvalue; | ||||
315 | } | ||||
316 | |||||
317 | # taking care of file attributes | ||||
318 | 7903 | 1.55s | 7903 | 1.50s | if ($installer::globals::iswin && -f $dest) { # spent 1.50s making 7903 calls to installer::systemactions::CORE:ftfile, avg 190µs/call |
319 | 7903 | 1.61s | 7903 | 1.57s | my $mode = -x $source ? 0775 : 0664; # spent 1.57s making 7903 calls to installer::systemactions::CORE:fteexec, avg 198µs/call |
320 | 7903 | 21.5ms | my $mode_str = sprintf("%o", $mode); | ||
321 | 7903 | 1.21s | 7903 | 1.16s | my $chmodreturn = chmod($mode, $dest); # spent 1.16s making 7903 calls to installer::systemactions::CORE:chmod, avg 147µs/call |
322 | 7903 | 7.81ms | if ($chmodreturn) | ||
323 | { | ||||
324 | 7903 | 12.1ms | $infoline = "chmod $mode_str, $dest\n"; | ||
325 | 7903 | 5.34ms | $returnvalue = 1; | ||
326 | } | ||||
327 | else | ||||
328 | { | ||||
329 | $infoline = "WARNING: Could not chmod $dest: $!\n"; | ||||
330 | $returnvalue = 0; | ||||
331 | } | ||||
332 | |||||
333 | 7903 | 19.4ms | push(@installer::globals::logfileinfo, $infoline); | ||
334 | } | ||||
335 | |||||
336 | 7903 | 41.1ms | return $returnvalue; | ||
337 | } | ||||
338 | |||||
339 | ########################## | ||||
340 | # Hard linking one file | ||||
341 | ########################## | ||||
342 | |||||
343 | sub hardlink_one_file | ||||
344 | { | ||||
345 | my ($source, $dest) = @_; | ||||
346 | |||||
347 | my ($returnvalue, $infoline); | ||||
348 | |||||
349 | my $copyreturn = link($source, $dest); | ||||
350 | |||||
351 | if ($copyreturn) | ||||
352 | { | ||||
353 | $infoline = "Link: $source to $dest\n"; | ||||
354 | $returnvalue = 1; | ||||
355 | } | ||||
356 | else | ||||
357 | { | ||||
358 | $infoline = "ERROR: Could not link $source to $dest\n"; | ||||
359 | $returnvalue = 0; | ||||
360 | } | ||||
361 | |||||
362 | push(@installer::globals::logfileinfo, $infoline); | ||||
363 | |||||
364 | return $returnvalue; | ||||
365 | } | ||||
366 | |||||
367 | ########################## | ||||
368 | # Soft linking one file | ||||
369 | ########################## | ||||
370 | |||||
371 | sub softlink_one_file | ||||
372 | { | ||||
373 | my ($source, $dest) = @_; | ||||
374 | |||||
375 | my ($returnvalue, $infoline); | ||||
376 | |||||
377 | my $linkreturn = symlink($source, $dest); | ||||
378 | |||||
379 | if ($linkreturn) | ||||
380 | { | ||||
381 | $infoline = "Symlink: $source to $dest\n"; | ||||
382 | $returnvalue = 1; | ||||
383 | } | ||||
384 | else | ||||
385 | { | ||||
386 | $infoline = "ERROR: Could not symlink $source to $dest\n"; | ||||
387 | $returnvalue = 0; | ||||
388 | } | ||||
389 | |||||
390 | push(@installer::globals::logfileinfo, $infoline); | ||||
391 | |||||
392 | return $returnvalue; | ||||
393 | } | ||||
394 | |||||
395 | ######################## | ||||
396 | # Renaming one file | ||||
397 | ######################## | ||||
398 | |||||
399 | sub rename_one_file | ||||
400 | # spent 834ms (10.7+823) within installer::systemactions::rename_one_file which was called 529 times, avg 1.58ms/call:
# 436 times (8.34ms+593ms) by installer::systemactions::rename_files_with_fileextension at line 708, avg 1.38ms/call
# 5 times (85µs+31.6ms) by installer::windows::mergemodule::merge_mergemodules_into_msi_database at line 457 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer/windows/mergemodule.pm, avg 6.35ms/call
# 5 times (107µs+20.9ms) by installer::windows::mergemodule::merge_mergemodules_into_msi_database at line 455 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer/windows/mergemodule.pm, avg 4.20ms/call
# 5 times (231µs+9.09ms) by installer::windows::mergemodule::merge_mergemodules_into_msi_database at line 454 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer/windows/mergemodule.pm, avg 1.86ms/call
# 5 times (288µs+6.35ms) by installer::windows::mergemodule::merge_mergemodules_into_msi_database at line 529 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer/windows/mergemodule.pm, avg 1.33ms/call
# 5 times (153µs+5.21ms) by installer::windows::mergemodule::merge_mergemodules_into_msi_database at line 530 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer/windows/mergemodule.pm, avg 1.07ms/call
# 5 times (91µs+3.74ms) by installer::windows::mergemodule::merge_mergemodules_into_msi_database at line 531 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer/windows/mergemodule.pm, avg 766µs/call
# 5 times (80µs+3.19ms) by installer::windows::mergemodule::merge_mergemodules_into_msi_database at line 532 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer/windows/mergemodule.pm, avg 655µs/call
# 4 times (113µs+16.3ms) by installer::windows::mergemodule::merge_mergemodules_into_msi_database at line 408 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer/windows/mergemodule.pm, avg 4.12ms/call
# 4 times (170µs+13.7ms) by installer::windows::mergemodule::merge_mergemodules_into_msi_database at line 400 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer/windows/mergemodule.pm, avg 3.46ms/call
# 4 times (69µs+9.62ms) by installer::windows::mergemodule::merge_mergemodules_into_msi_database at line 405 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer/windows/mergemodule.pm, avg 2.42ms/call
# 4 times (141µs+3.68ms) by installer::windows::mergemodule::merge_mergemodules_into_msi_database at line 485 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer/windows/mergemodule.pm, avg 955µs/call
# 4 times (64µs+3.14ms) by installer::windows::mergemodule::merge_mergemodules_into_msi_database at line 407 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer/windows/mergemodule.pm, avg 801µs/call
# 4 times (66µs+3.10ms) by installer::windows::mergemodule::merge_mergemodules_into_msi_database at line 456 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer/windows/mergemodule.pm, avg 791µs/call
# 4 times (65µs+2.78ms) by installer::windows::mergemodule::merge_mergemodules_into_msi_database at line 491 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer/windows/mergemodule.pm, avg 711µs/call
# 4 times (65µs+2.69ms) by installer::windows::mergemodule::merge_mergemodules_into_msi_database at line 487 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer/windows/mergemodule.pm, avg 688µs/call
# 4 times (80µs+2.60ms) by installer::windows::mergemodule::merge_mergemodules_into_msi_database at line 401 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer/windows/mergemodule.pm, avg 671µs/call
# 4 times (72µs+2.59ms) by installer::windows::mergemodule::merge_mergemodules_into_msi_database at line 486 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer/windows/mergemodule.pm, avg 666µs/call
# 4 times (65µs+2.57ms) by installer::windows::mergemodule::merge_mergemodules_into_msi_database at line 490 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer/windows/mergemodule.pm, avg 660µs/call
# 4 times (66µs+2.54ms) by installer::windows::mergemodule::merge_mergemodules_into_msi_database at line 489 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer/windows/mergemodule.pm, avg 650µs/call
# 4 times (67µs+2.49ms) by installer::windows::mergemodule::merge_mergemodules_into_msi_database at line 403 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer/windows/mergemodule.pm, avg 640µs/call
# 4 times (64µs+2.48ms) by installer::windows::mergemodule::merge_mergemodules_into_msi_database at line 488 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer/windows/mergemodule.pm, avg 635µs/call
# once (60µs+71.4ms) by installer::windows::msiglobal::rename_msi_database_in_installset at line 968 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer/windows/msiglobal.pm
# once (48µs+8.22ms) by installer::run at line 1810 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer.pm | ||||
401 | 529 | 931µs | my ($source, $dest) = @_; | ||
402 | |||||
403 | 529 | 274µs | my ($returnvalue, $infoline); | ||
404 | |||||
405 | 529 | 827ms | 529 | 823ms | my $renamereturn = rename($source, $dest); # spent 823ms making 529 calls to installer::systemactions::CORE:rename, avg 1.56ms/call |
406 | |||||
407 | 529 | 595µs | if ($renamereturn) | ||
408 | { | ||||
409 | 529 | 1.04ms | $infoline = "Rename: $source to $dest\n"; | ||
410 | 529 | 409µs | $returnvalue = 1; | ||
411 | } | ||||
412 | else | ||||
413 | { | ||||
414 | $infoline = "ERROR: Could not rename $source to $dest\n"; | ||||
415 | $returnvalue = 0; | ||||
416 | } | ||||
417 | |||||
418 | 529 | 1.37ms | push(@installer::globals::logfileinfo, $infoline); | ||
419 | |||||
420 | 529 | 3.14ms | return $returnvalue; | ||
421 | } | ||||
422 | |||||
423 | ########################################## | ||||
424 | # Copying all files from one directory | ||||
425 | # to another directory | ||||
426 | ########################################## | ||||
427 | |||||
428 | sub copy_directory | ||||
429 | # spent 11.5s (86.8ms+11.4) within installer::systemactions::copy_directory which was called 218 times, avg 52.7ms/call:
# 109 times (55.4ms+7.34s) by installer::windows::idtglobal::prepare_language_idt_directory at line 757 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer/windows/idtglobal.pm, avg 67.8ms/call
# 109 times (31.5ms+4.05s) by installer::windows::idtglobal::prepare_language_idt_directory at line 762 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer/windows/idtglobal.pm, avg 37.5ms/call | ||||
430 | 218 | 433µs | my ($sourcedir, $destdir) = @_; | ||
431 | |||||
432 | 218 | 182µs | my @sourcefiles = (); | ||
433 | |||||
434 | 218 | 5.54ms | 436 | 3.20ms | $sourcedir =~ s/\Q$installer::globals::separator\E\s*$//; # spent 2.45ms making 218 calls to installer::systemactions::CORE:subst, avg 11µs/call
# spent 750µs making 218 calls to installer::systemactions::CORE:regcomp, avg 3µs/call |
435 | 218 | 2.92ms | 436 | 1.16ms | $destdir =~ s/\Q$installer::globals::separator\E\s*$//; # spent 859µs making 218 calls to installer::systemactions::CORE:subst, avg 4µs/call
# spent 297µs making 218 calls to installer::systemactions::CORE:regcomp, avg 1µs/call |
436 | |||||
437 | 218 | 167µs | my $infoline = "\n"; | ||
438 | 218 | 295µs | push(@installer::globals::logfileinfo, $infoline); | ||
439 | 218 | 362µs | $infoline = "Copying files from directory $sourcedir to directory $destdir\n"; | ||
440 | 218 | 291µs | push(@installer::globals::logfileinfo, $infoline); | ||
441 | |||||
442 | 218 | 24.2ms | 218 | 22.7ms | opendir(DIR, $sourcedir); # spent 22.7ms making 218 calls to installer::systemactions::CORE:open_dir, avg 104µs/call |
443 | 218 | 30.8ms | 218 | 27.9ms | @sourcefiles = readdir(DIR); # spent 27.9ms making 218 calls to installer::systemactions::CORE:readdir, avg 128µs/call |
444 | 218 | 6.18ms | 218 | 4.98ms | closedir(DIR); # spent 4.98ms making 218 calls to installer::systemactions::CORE:closedir, avg 23µs/call |
445 | |||||
446 | 218 | 128µs | my $onefile; | ||
447 | |||||
448 | 218 | 5.30ms | foreach $onefile (@sourcefiles) | ||
449 | { | ||||
450 | 5232 | 10.6ms | if ((!($onefile eq ".")) && (!($onefile eq ".."))) | ||
451 | { | ||||
452 | 4796 | 6.90ms | my $sourcefile = $sourcedir . $installer::globals::separator . $onefile; | ||
453 | 4796 | 4.04ms | my $destfile = $destdir . $installer::globals::separator . $onefile; | ||
454 | 4796 | 859ms | 9483 | 11.3s | if ( -f $sourcefile ) # only files, no directories # spent 10.5s making 4687 calls to installer::systemactions::copy_one_file, avg 2.24ms/call
# spent 816ms making 4796 calls to installer::systemactions::CORE:ftfile, avg 170µs/call |
455 | { | ||||
456 | copy_one_file($sourcefile, $destfile); | ||||
457 | } | ||||
458 | } | ||||
459 | } | ||||
460 | } | ||||
461 | |||||
462 | ########################################## | ||||
463 | # Copying all files from one directory | ||||
464 | # to another directory | ||||
465 | ########################################## | ||||
466 | |||||
467 | sub is_empty_dir | ||||
468 | { | ||||
469 | my ($dir) = @_; | ||||
470 | |||||
471 | my $directory_is_empty = 1; | ||||
472 | my @sourcefiles = (); | ||||
473 | |||||
474 | opendir(DIR, $dir); | ||||
475 | @sourcefiles = readdir(DIR); | ||||
476 | closedir(DIR); | ||||
477 | |||||
478 | my $onefile; | ||||
479 | my @realcontent = (); | ||||
480 | |||||
481 | foreach $onefile (@sourcefiles) | ||||
482 | { | ||||
483 | if ((!($onefile eq ".")) && (!($onefile eq ".."))) | ||||
484 | { | ||||
485 | push(@realcontent, $onefile); | ||||
486 | } | ||||
487 | } | ||||
488 | |||||
489 | if ( $#realcontent > -1 ) { $directory_is_empty = 0; } | ||||
490 | |||||
491 | return $directory_is_empty; | ||||
492 | } | ||||
493 | |||||
494 | ##################################################################### | ||||
495 | # Creating hard links to a complete directory with sub directories. | ||||
496 | ##################################################################### | ||||
497 | |||||
498 | sub hardlink_complete_directory | ||||
499 | { | ||||
500 | my ($sourcedir, $destdir) = @_; | ||||
501 | |||||
502 | my @sourcefiles = (); | ||||
503 | |||||
504 | $sourcedir =~ s/\Q$installer::globals::separator\E\s*$//; | ||||
505 | $destdir =~ s/\Q$installer::globals::separator\E\s*$//; | ||||
506 | |||||
507 | if ( ! -d $destdir ) { create_directory($destdir); } | ||||
508 | |||||
509 | my $infoline = "\n"; | ||||
510 | push(@installer::globals::logfileinfo, $infoline); | ||||
511 | $infoline = "Creating hard links for all files from directory $sourcedir to directory $destdir\n"; | ||||
512 | push(@installer::globals::logfileinfo, $infoline); | ||||
513 | |||||
514 | opendir(DIR, $sourcedir); | ||||
515 | @sourcefiles = readdir(DIR); | ||||
516 | closedir(DIR); | ||||
517 | |||||
518 | my $onefile; | ||||
519 | |||||
520 | foreach $onefile (@sourcefiles) | ||||
521 | { | ||||
522 | if ((!($onefile eq ".")) && (!($onefile eq ".."))) | ||||
523 | { | ||||
524 | my $source = $sourcedir . $installer::globals::separator . $onefile; | ||||
525 | my $dest = $destdir . $installer::globals::separator . $onefile; | ||||
526 | if ( -f $source ) # only files, no directories | ||||
527 | { | ||||
528 | hardlink_one_file($source, $dest); | ||||
529 | } | ||||
530 | if ( -d $source ) # recursive | ||||
531 | { | ||||
532 | hardlink_complete_directory($source, $dest); | ||||
533 | } | ||||
534 | } | ||||
535 | } | ||||
536 | } | ||||
537 | |||||
538 | ##################################################################### | ||||
539 | # Creating hard links to a complete directory with sub directories. | ||||
540 | ##################################################################### | ||||
541 | |||||
542 | sub softlink_complete_directory | ||||
543 | { | ||||
544 | my ($sourcedir, $destdir, $depth) = @_; | ||||
545 | |||||
546 | my @sourcefiles = (); | ||||
547 | |||||
548 | $sourcedir =~ s/\Q$installer::globals::separator\E\s*$//; | ||||
549 | $destdir =~ s/\Q$installer::globals::separator\E\s*$//; | ||||
550 | |||||
551 | if ( ! -d $destdir ) { create_directory($destdir); } | ||||
552 | |||||
553 | my $infoline = "\n"; | ||||
554 | push(@installer::globals::logfileinfo, $infoline); | ||||
555 | $infoline = "Creating soft links for all files from directory $sourcedir to directory $destdir\n"; | ||||
556 | push(@installer::globals::logfileinfo, $infoline); | ||||
557 | |||||
558 | opendir(DIR, $sourcedir); | ||||
559 | @sourcefiles = readdir(DIR); | ||||
560 | closedir(DIR); | ||||
561 | |||||
562 | my $onefile; | ||||
563 | |||||
564 | foreach $onefile (@sourcefiles) | ||||
565 | { | ||||
566 | if ((!($onefile eq ".")) && (!($onefile eq ".."))) | ||||
567 | { | ||||
568 | my $source = $sourcedir . $installer::globals::separator . $onefile; | ||||
569 | my $dest = $destdir . $installer::globals::separator . $onefile; | ||||
570 | if ( -f $source ) # only files, no directories | ||||
571 | { | ||||
572 | my $localsource = $source; | ||||
573 | if ( $depth > 0 ) { for ( my $i = 1; $i <= $depth; $i++ ) { $localsource = "../" . $localsource; } } | ||||
574 | softlink_one_file($localsource, $dest); | ||||
575 | } | ||||
576 | if ( -d $source ) # recursive | ||||
577 | { | ||||
578 | my $newdepth = $depth + 1; | ||||
579 | softlink_complete_directory($source, $dest, $newdepth); | ||||
580 | } | ||||
581 | } | ||||
582 | } | ||||
583 | } | ||||
584 | |||||
585 | ##################################################### | ||||
586 | # Copying a complete directory with sub directories. | ||||
587 | ##################################################### | ||||
588 | |||||
589 | sub copy_complete_directory | ||||
590 | { | ||||
591 | my ($sourcedir, $destdir) = @_; | ||||
592 | |||||
593 | my @sourcefiles = (); | ||||
594 | |||||
595 | $sourcedir =~ s/\Q$installer::globals::separator\E\s*$//; | ||||
596 | $destdir =~ s/\Q$installer::globals::separator\E\s*$//; | ||||
597 | |||||
598 | if ( ! -d $destdir ) { create_directory($destdir); } | ||||
599 | |||||
600 | my $infoline = "\n"; | ||||
601 | push(@installer::globals::logfileinfo, $infoline); | ||||
602 | $infoline = "Copying files from directory $sourcedir to directory $destdir\n"; | ||||
603 | push(@installer::globals::logfileinfo, $infoline); | ||||
604 | |||||
605 | opendir(DIR, $sourcedir); | ||||
606 | @sourcefiles = readdir(DIR); | ||||
607 | closedir(DIR); | ||||
608 | |||||
609 | my $onefile; | ||||
610 | |||||
611 | foreach $onefile (@sourcefiles) | ||||
612 | { | ||||
613 | if ((!($onefile eq ".")) && (!($onefile eq ".."))) | ||||
614 | { | ||||
615 | my $source = $sourcedir . $installer::globals::separator . $onefile; | ||||
616 | my $dest = $destdir . $installer::globals::separator . $onefile; | ||||
617 | if ( -f $source ) # only files, no directories | ||||
618 | { | ||||
619 | copy_one_file($source, $dest); | ||||
620 | } | ||||
621 | if ( -d $source ) # recursive | ||||
622 | { | ||||
623 | if ((!( $source =~ /packages\/SUNW/ )) && (!( $source =~ /packages\/OOO/ ))) # do not copy complete Solaris packages! | ||||
624 | { | ||||
625 | copy_complete_directory($source, $dest); | ||||
626 | } | ||||
627 | } | ||||
628 | } | ||||
629 | } | ||||
630 | } | ||||
631 | |||||
632 | ##################################################### | ||||
633 | # Copying all files with a specified file extension | ||||
634 | # from one directory to another directory. | ||||
635 | ##################################################### | ||||
636 | |||||
637 | sub copy_directory_with_fileextension | ||||
638 | # spent 11.6s (809ms+10.8) within installer::systemactions::copy_directory_with_fileextension which was called 218 times, avg 53.1ms/call:
# 109 times (385ms+5.73s) by installer::windows::idtglobal::prepare_language_idt_directory at line 817 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer/windows/idtglobal.pm, avg 56.1ms/call
# 109 times (424ms+5.04s) by installer::windows::idtglobal::prepare_language_idt_directory at line 812 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer/windows/idtglobal.pm, avg 50.1ms/call | ||||
639 | 218 | 695µs | my ($sourcedir, $destdir, $extension) = @_; | ||
640 | |||||
641 | 218 | 157µs | my @sourcefiles = (); | ||
642 | |||||
643 | 218 | 5.15ms | 436 | 2.77ms | $sourcedir =~ s/\Q$installer::globals::separator\E\s*$//; # spent 2.16ms making 218 calls to installer::systemactions::CORE:subst, avg 10µs/call
# spent 610µs making 218 calls to installer::systemactions::CORE:regcomp, avg 3µs/call |
644 | 218 | 2.76ms | 436 | 1.11ms | $destdir =~ s/\Q$installer::globals::separator\E\s*$//; # spent 824µs making 218 calls to installer::systemactions::CORE:subst, avg 4µs/call
# spent 289µs making 218 calls to installer::systemactions::CORE:regcomp, avg 1µs/call |
645 | |||||
646 | 218 | 241µs | $infoline = "\n"; | ||
647 | 218 | 319µs | push(@installer::globals::logfileinfo, $infoline); | ||
648 | 218 | 491µs | $infoline = "Copying files with extension $extension from directory $sourcedir to directory $destdir\n"; | ||
649 | 218 | 516µs | push(@installer::globals::logfileinfo, $infoline); | ||
650 | |||||
651 | 218 | 24.0ms | 218 | 22.5ms | opendir(DIR, $sourcedir); # spent 22.5ms making 218 calls to installer::systemactions::CORE:open_dir, avg 103µs/call |
652 | 218 | 407ms | 218 | 373ms | @sourcefiles = readdir(DIR); # spent 373ms making 218 calls to installer::systemactions::CORE:readdir, avg 1.71ms/call |
653 | 218 | 7.41ms | 218 | 6.05ms | closedir(DIR); # spent 6.05ms making 218 calls to installer::systemactions::CORE:closedir, avg 28µs/call |
654 | |||||
655 | 218 | 140µs | my $onefile; | ||
656 | |||||
657 | 218 | 48.1ms | foreach $onefile (@sourcefiles) | ||
658 | { | ||||
659 | 98318 | 147ms | if ((!($onefile eq ".")) && (!($onefile eq ".."))) | ||
660 | { | ||||
661 | 97882 | 729ms | 195764 | 186ms | if ( $onefile =~ /\.$extension\s*$/ ) # only copying specified files # spent 108ms making 97882 calls to installer::systemactions::CORE:match, avg 1µs/call
# spent 77.5ms making 97882 calls to installer::systemactions::CORE:regcomp, avg 792ns/call |
662 | { | ||||
663 | 1853 | 3.42ms | my $sourcefile = $sourcedir . $installer::globals::separator . $onefile; | ||
664 | 1853 | 1.98ms | my $destfile = $destdir . $installer::globals::separator . $onefile; | ||
665 | 1853 | 3.41s | 3706 | 10.2s | if ( -f $sourcefile ) # only files, no directories # spent 6.79s making 1853 calls to installer::systemactions::copy_one_file, avg 3.66ms/call
# spent 3.39s making 1853 calls to installer::systemactions::CORE:ftfile, avg 1.83ms/call |
666 | { | ||||
667 | copy_one_file($sourcefile, $destfile); | ||||
668 | } | ||||
669 | } | ||||
670 | } | ||||
671 | } | ||||
672 | } | ||||
673 | |||||
674 | ######################################################## | ||||
675 | # Renaming all files with a specified file extension | ||||
676 | # in a specified directory. | ||||
677 | # Example: "Feature.idt.01" -> "Feature.idt" | ||||
678 | ######################################################## | ||||
679 | |||||
680 | sub rename_files_with_fileextension | ||||
681 | # spent 777ms (51.0+726) within installer::systemactions::rename_files_with_fileextension which was called 109 times, avg 7.13ms/call:
# 109 times (51.0ms+726ms) by installer::windows::idtglobal::prepare_language_idt_directory at line 818 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer/windows/idtglobal.pm, avg 7.13ms/call | ||||
682 | 109 | 371µs | my ($dir, $extension) = @_; | ||
683 | |||||
684 | 109 | 109µs | my @sourcefiles = (); | ||
685 | |||||
686 | 109 | 2.06ms | 218 | 1.05ms | $dir =~ s/\Q$installer::globals::separator\E\s*$//; # spent 852µs making 109 calls to installer::systemactions::CORE:subst, avg 8µs/call
# spent 196µs making 109 calls to installer::systemactions::CORE:regcomp, avg 2µs/call |
687 | |||||
688 | 109 | 106µs | my $infoline = "\n"; | ||
689 | 109 | 150µs | push(@installer::globals::logfileinfo, $infoline); | ||
690 | 109 | 167µs | $infoline = "Renaming files with extension \"$extension\" in the directory $dir\n"; | ||
691 | 109 | 127µs | push(@installer::globals::logfileinfo, $infoline); | ||
692 | |||||
693 | 109 | 11.7ms | 109 | 11.0ms | opendir(DIR, $dir); # spent 11.0ms making 109 calls to installer::systemactions::CORE:open_dir, avg 101µs/call |
694 | 109 | 19.1ms | 109 | 17.2ms | @sourcefiles = readdir(DIR); # spent 17.2ms making 109 calls to installer::systemactions::CORE:readdir, avg 158µs/call |
695 | 109 | 3.13ms | 109 | 2.51ms | closedir(DIR); # spent 2.51ms making 109 calls to installer::systemactions::CORE:closedir, avg 23µs/call |
696 | |||||
697 | 109 | 84µs | my $onefile; | ||
698 | |||||
699 | 109 | 2.77ms | foreach $onefile (@sourcefiles) | ||
700 | { | ||||
701 | 5341 | 7.54ms | if ((!($onefile eq ".")) && (!($onefile eq ".."))) | ||
702 | { | ||||
703 | 5123 | 42.8ms | 10246 | 13.9ms | if ( $onefile =~ /^\s*(\S.*?)\.$extension\s*$/ ) # only renaming specified files # spent 8.49ms making 5123 calls to installer::systemactions::CORE:regcomp, avg 2µs/call
# spent 5.44ms making 5123 calls to installer::systemactions::CORE:match, avg 1µs/call |
704 | { | ||||
705 | 436 | 968µs | my $destfile = $1; | ||
706 | 436 | 582µs | my $sourcefile = $dir . $installer::globals::separator . $onefile; | ||
707 | 436 | 353µs | $destfile = $dir . $installer::globals::separator . $destfile; | ||
708 | 436 | 83.1ms | 872 | 681ms | if ( -f $sourcefile ) # only files, no directories # spent 602ms making 436 calls to installer::systemactions::rename_one_file, avg 1.38ms/call
# spent 78.9ms making 436 calls to installer::systemactions::CORE:ftfile, avg 181µs/call |
709 | { | ||||
710 | rename_one_file($sourcefile, $destfile); | ||||
711 | } | ||||
712 | } | ||||
713 | } | ||||
714 | } | ||||
715 | } | ||||
716 | |||||
717 | ######################################################## | ||||
718 | # Finding all files with a specified file extension | ||||
719 | # in a specified directory. | ||||
720 | ######################################################## | ||||
721 | |||||
722 | sub find_file_with_file_extension | ||||
723 | # spent 111ms (55.8+55.2) within installer::systemactions::find_file_with_file_extension which was called 110 times, avg 1.01ms/call:
# 109 times (55.6ms+54.8ms) by installer::windows::idtglobal::setencoding at line 1372 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer/windows/idtglobal.pm, avg 1.01ms/call
# once (162µs+369µs) by installer::windows::msiglobal::include_cabs_into_msi at line 1253 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer/windows/msiglobal.pm | ||||
724 | 110 | 244µs | my ($extension, $dir) = @_; | ||
725 | |||||
726 | 110 | 125µs | my @allfiles = (); | ||
727 | |||||
728 | 110 | 2.48ms | 220 | 1.22ms | $dir =~ s/\Q$installer::globals::separator\E\s*$//; # spent 878µs making 110 calls to installer::systemactions::CORE:subst, avg 8µs/call
# spent 347µs making 110 calls to installer::systemactions::CORE:regcomp, avg 3µs/call |
729 | |||||
730 | 110 | 121µs | my $infoline = "\n"; | ||
731 | 110 | 159µs | push(@installer::globals::logfileinfo, $infoline); | ||
732 | 110 | 211µs | $infoline = "Searching files with extension \"$extension\" in the directory $dir\n"; | ||
733 | 110 | 127µs | push(@installer::globals::logfileinfo, $infoline); | ||
734 | |||||
735 | 110 | 15.8ms | 110 | 14.9ms | opendir(DIR, $dir); # spent 14.9ms making 110 calls to installer::systemactions::CORE:open_dir, avg 136µs/call |
736 | 110 | 31.2ms | 220 | 20.8ms | @sourcefiles = sort readdir(DIR); # spent 18.3ms making 110 calls to installer::systemactions::CORE:readdir, avg 166µs/call
# spent 2.55ms making 110 calls to installer::systemactions::CORE:sort, avg 23µs/call |
737 | 110 | 3.36ms | 110 | 2.73ms | closedir(DIR); # spent 2.73ms making 110 calls to installer::systemactions::CORE:closedir, avg 25µs/call |
738 | |||||
739 | 110 | 64µs | my $onefile; | ||
740 | |||||
741 | 110 | 305µs | foreach $onefile (@sourcefiles) | ||
742 | { | ||||
743 | 5345 | 7.47ms | if ((!($onefile eq ".")) && (!($onefile eq ".."))) | ||
744 | { | ||||
745 | 5125 | 48.6ms | 10250 | 15.4ms | if ( $onefile =~ /^\s*(\S.*?)\.$extension\s*$/ ) # spent 11.1ms making 5125 calls to installer::systemactions::CORE:match, avg 2µs/call
# spent 4.36ms making 5125 calls to installer::systemactions::CORE:regcomp, avg 850ns/call |
746 | { | ||||
747 | push(@allfiles, $onefile) | ||||
748 | } | ||||
749 | } | ||||
750 | } | ||||
751 | |||||
752 | 110 | 891µs | return \@allfiles; | ||
753 | } | ||||
754 | |||||
755 | ############################################################## | ||||
756 | # Creating a unique directory, for example "01_inprogress_7" | ||||
757 | # in the install directory. | ||||
758 | ############################################################## | ||||
759 | |||||
760 | sub make_numbered_dir | ||||
761 | { | ||||
762 | my ($newstring, $olddir) = @_; | ||||
763 | |||||
764 | my $basedir = $olddir; | ||||
765 | installer::pathanalyzer::get_path_from_fullqualifiedname(\$basedir); | ||||
766 | |||||
767 | my $alldirs = get_all_directories($basedir); | ||||
768 | |||||
769 | # searching for the highest number extension | ||||
770 | |||||
771 | my $maxnumber = 0; | ||||
772 | |||||
773 | for ( my $i = 0; $i <= $#{$alldirs}; $i++ ) | ||||
774 | { | ||||
775 | if ( ${$alldirs}[$i] =~ /\_(\d+)\s*$/ ) | ||||
776 | { | ||||
777 | my $number = $1; | ||||
778 | if ( $number > $maxnumber ) { $maxnumber = $number; } | ||||
779 | } | ||||
780 | } | ||||
781 | |||||
782 | my $newnumber = $maxnumber + 1; | ||||
783 | |||||
784 | my $newdir = $olddir . "_" . $newstring . "_" . $newnumber; | ||||
785 | |||||
786 | my $returndir = ""; | ||||
787 | |||||
788 | if ( move($olddir, $newdir) ) | ||||
789 | { | ||||
790 | $infoline = "\nMoved directory from $olddir to $newdir\n"; | ||||
791 | push(@installer::globals::logfileinfo, $infoline); | ||||
792 | $returndir = $newdir; | ||||
793 | } | ||||
794 | else | ||||
795 | { | ||||
796 | $infoline = "\nATTENTION: Could not move directory from $olddir to $newdir, \"make_numbered_dir\"\n"; | ||||
797 | push(@installer::globals::logfileinfo, $infoline); | ||||
798 | $returndir = $olddir; | ||||
799 | } | ||||
800 | |||||
801 | return $returndir; | ||||
802 | } | ||||
803 | |||||
804 | ##################################################################################### | ||||
805 | # Renaming a directory by exchanging a string, for example from "01_inprogress_7" | ||||
806 | # to "01_witherror_7". | ||||
807 | ##################################################################################### | ||||
808 | |||||
809 | sub rename_string_in_directory | ||||
810 | # spent 90.5ms (72µs+90.5) within installer::systemactions::rename_string_in_directory which was called:
# once (72µs+90.5ms) by installer::worker::analyze_and_save_logfile at line 211 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer/worker.pm | ||||
811 | 1 | 4µs | my ($olddir, $oldstring, $newstring) = @_; | ||
812 | |||||
813 | 1 | 2µs | my $newdir = $olddir; | ||
814 | 1 | 2µs | my $infoline = ""; | ||
815 | |||||
816 | 1 | 49µs | 2 | 31µs | $newdir =~ s/$oldstring/$newstring/g; # spent 26µs making 1 call to installer::systemactions::CORE:regcomp
# spent 5µs making 1 call to installer::systemactions::CORE:subst |
817 | |||||
818 | 1 | 328µs | 1 | 318µs | if (( -d $newdir ) && ( $olddir ne $newdir )) { remove_complete_directory($newdir, 1); } # spent 318µs making 1 call to installer::systemactions::CORE:ftdir |
819 | |||||
820 | 1 | 8µs | 1 | 90.1ms | if ( move($olddir, $newdir) ) # spent 90.1ms making 1 call to File::Copy::move |
821 | { | ||||
822 | 1 | 11µs | $infoline = "\nMoved directory from $olddir to $newdir\n"; | ||
823 | 1 | 4µs | push(@installer::globals::logfileinfo, $infoline); | ||
824 | } | ||||
825 | else | ||||
826 | { | ||||
827 | $infoline = "\nATTENTION: Could not move directory from $olddir to $newdir, \"rename_string_in_directory\"\n"; | ||||
828 | push(@installer::globals::logfileinfo, $infoline); | ||||
829 | } | ||||
830 | |||||
831 | 1 | 17µs | return $newdir; | ||
832 | } | ||||
833 | |||||
834 | ###################################################### | ||||
835 | # Returning the complete directory name, | ||||
836 | # input is the first part of the directory name. | ||||
837 | ###################################################### | ||||
838 | |||||
839 | sub get_directoryname | ||||
840 | { | ||||
841 | my ($searchdir, $startstring) = @_; | ||||
842 | |||||
843 | my $dirname = ""; | ||||
844 | my $founddir = 0; | ||||
845 | my $direntry; | ||||
846 | |||||
847 | opendir(DIR, $searchdir); | ||||
848 | |||||
849 | foreach $direntry (readdir (DIR)) | ||||
850 | { | ||||
851 | next if $direntry eq "."; | ||||
852 | next if $direntry eq ".."; | ||||
853 | |||||
854 | if (( -d $direntry ) && ( $direntry =~ /^\s*\Q$startstring\E/ )) | ||||
855 | { | ||||
856 | $dirname = $direntry; | ||||
857 | $founddir = 1; | ||||
858 | last; | ||||
859 | } | ||||
860 | } | ||||
861 | |||||
862 | closedir(DIR); | ||||
863 | |||||
864 | if ( ! $founddir ) { installer::exiter::exit_program("ERROR: Did not find directory beginning with $startstring in directory $searchdir", "get_directoryname"); } | ||||
865 | |||||
866 | return $dirname; | ||||
867 | } | ||||
868 | |||||
869 | |||||
870 | ################################### | ||||
871 | # Renaming a directory | ||||
872 | ################################### | ||||
873 | |||||
874 | sub rename_directory | ||||
875 | # spent 136ms (27µs+136) within installer::systemactions::rename_directory which was called:
# once (27µs+136ms) by installer::worker::create_installation_directory at line 168 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer/worker.pm | ||||
876 | 1 | 2µs | my ($olddir, $newdir) = @_; | ||
877 | |||||
878 | 1 | 2µs | my $infoline = ""; | ||
879 | |||||
880 | 1 | 7µs | 1 | 136ms | if ( move($olddir, $newdir) ) # spent 136ms making 1 call to File::Copy::move |
881 | { | ||||
882 | 1 | 6µs | $infoline = "\nMoved directory from $olddir to $newdir\n"; | ||
883 | 1 | 4µs | push(@installer::globals::logfileinfo, $infoline); | ||
884 | } | ||||
885 | else | ||||
886 | { | ||||
887 | installer::exiter::exit_program("ERROR: Could not move directory from $olddir to $newdir $!", "rename_directory"); | ||||
888 | } | ||||
889 | |||||
890 | 1 | 8µs | return $newdir; | ||
891 | } | ||||
892 | |||||
893 | ############################################################## | ||||
894 | # Creating a directory next to an existing directory | ||||
895 | ############################################################## | ||||
896 | |||||
897 | sub create_directory_next_to_directory | ||||
898 | # spent 1.11ms (41µs+1.07) within installer::systemactions::create_directory_next_to_directory which was called:
# once (41µs+1.07ms) by installer::run at line 1448 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer.pm | ||||
899 | 1 | 2µs | my ($topdir, $dirname) = @_; | ||
900 | |||||
901 | 1 | 2µs | my $basedir = $topdir; | ||
902 | 1 | 4µs | 1 | 48µs | installer::pathanalyzer::get_path_from_fullqualifiedname(\$basedir); # spent 48µs making 1 call to installer::pathanalyzer::get_path_from_fullqualifiedname |
903 | |||||
904 | 1 | 58µs | 2 | 45µs | $basedir =~ s/\Q$installer::globals::separator\E\s*$//; # spent 39µs making 1 call to installer::systemactions::CORE:regcomp
# spent 6µs making 1 call to installer::systemactions::CORE:subst |
905 | |||||
906 | 1 | 4µs | my $newdir = $basedir . $installer::globals::separator . $dirname; | ||
907 | |||||
908 | 1 | 3µs | 1 | 975µs | create_directory($newdir); # spent 975µs making 1 call to installer::systemactions::create_directory |
909 | |||||
910 | 1 | 8µs | return $newdir; | ||
911 | } | ||||
912 | |||||
913 | ############################################################## | ||||
914 | # Collecting all directories inside a directory | ||||
915 | ############################################################## | ||||
916 | |||||
917 | sub get_all_directories | ||||
918 | { | ||||
919 | my ($basedir) = @_; | ||||
920 | |||||
921 | my @alldirs = (); | ||||
922 | my $direntry; | ||||
923 | |||||
924 | $basedir =~ s/\Q$installer::globals::separator\E\s*$//; | ||||
925 | |||||
926 | opendir(DIR, $basedir); | ||||
927 | |||||
928 | foreach $direntry (readdir (DIR)) | ||||
929 | { | ||||
930 | next if $direntry eq "."; | ||||
931 | next if $direntry eq ".."; | ||||
932 | |||||
933 | my $completeentry = $basedir . $installer::globals::separator . $direntry; | ||||
934 | |||||
935 | if ( -d $completeentry ) { push(@alldirs, $completeentry); } | ||||
936 | } | ||||
937 | |||||
938 | closedir(DIR); | ||||
939 | |||||
940 | return \@alldirs; | ||||
941 | } | ||||
942 | |||||
943 | ############################################################## | ||||
944 | # Collecting all directories inside a directory | ||||
945 | # Returning without path | ||||
946 | ############################################################## | ||||
947 | |||||
948 | sub get_all_directories_without_path | ||||
949 | { | ||||
950 | my ($basedir) = @_; | ||||
951 | |||||
952 | my @alldirs = (); | ||||
953 | my $direntry; | ||||
954 | |||||
955 | $basedir =~ s/\Q$installer::globals::separator\E\s*$//; | ||||
956 | |||||
957 | opendir(DIR, $basedir); | ||||
958 | |||||
959 | foreach $direntry (readdir (DIR)) | ||||
960 | { | ||||
961 | next if $direntry eq "."; | ||||
962 | next if $direntry eq ".."; | ||||
963 | |||||
964 | my $completeentry = $basedir . $installer::globals::separator . $direntry; | ||||
965 | |||||
966 | if ( -d $completeentry ) { push(@alldirs, $direntry); } | ||||
967 | } | ||||
968 | |||||
969 | closedir(DIR); | ||||
970 | |||||
971 | return \@alldirs; | ||||
972 | } | ||||
973 | |||||
974 | ############################################################## | ||||
975 | # Collecting all files and directories inside one directory | ||||
976 | ############################################################## | ||||
977 | |||||
978 | sub read_directory | ||||
979 | { | ||||
980 | my ($basedir) = @_; | ||||
981 | |||||
982 | my @allcontent = (); | ||||
983 | my $direntry; | ||||
984 | |||||
985 | $basedir =~ s/\Q$installer::globals::separator\E\s*$//; | ||||
986 | |||||
987 | opendir(DIR, $basedir); | ||||
988 | |||||
989 | foreach $direntry (readdir (DIR)) | ||||
990 | { | ||||
991 | next if $direntry eq "."; | ||||
992 | next if $direntry eq ".."; | ||||
993 | |||||
994 | my $completeentry = $basedir . $installer::globals::separator . $direntry; | ||||
995 | |||||
996 | if (( -f $completeentry ) || ( -d $completeentry )) { push(@allcontent, $completeentry); } | ||||
997 | } | ||||
998 | |||||
999 | closedir(DIR); | ||||
1000 | |||||
1001 | return \@allcontent; | ||||
1002 | } | ||||
1003 | |||||
1004 | ############################################################## | ||||
1005 | # Finding the new content in a directory | ||||
1006 | ############################################################## | ||||
1007 | |||||
1008 | sub find_new_content_in_directory | ||||
1009 | { | ||||
1010 | my ( $basedir, $oldcontent ) = @_; | ||||
1011 | |||||
1012 | my @newcontent = (); | ||||
1013 | my @allcontent = (); | ||||
1014 | |||||
1015 | my $direntry; | ||||
1016 | |||||
1017 | $basedir =~ s/\Q$installer::globals::separator\E\s*$//; | ||||
1018 | |||||
1019 | opendir(DIR, $basedir); | ||||
1020 | |||||
1021 | foreach $direntry (readdir (DIR)) | ||||
1022 | { | ||||
1023 | next if $direntry eq "."; | ||||
1024 | next if $direntry eq ".."; | ||||
1025 | |||||
1026 | my $completeentry = $basedir . $installer::globals::separator . $direntry; | ||||
1027 | |||||
1028 | if (( -f $completeentry ) || ( -d $completeentry )) | ||||
1029 | { | ||||
1030 | push(@allcontent, $completeentry); | ||||
1031 | if (! grep {$_ eq $completeentry} @{$oldcontent}) | ||||
1032 | { | ||||
1033 | push(@newcontent, $completeentry); | ||||
1034 | } | ||||
1035 | } | ||||
1036 | } | ||||
1037 | |||||
1038 | closedir(DIR); | ||||
1039 | |||||
1040 | return (\@newcontent, \@allcontent); | ||||
1041 | } | ||||
1042 | |||||
1043 | ############################################################## | ||||
1044 | # Trying to create a directory, no error if this fails | ||||
1045 | ############################################################## | ||||
1046 | |||||
1047 | sub try_to_create_directory | ||||
1048 | { | ||||
1049 | my ($directory) = @_; | ||||
1050 | |||||
1051 | my $returnvalue = 1; | ||||
1052 | my $created_directory = 0; | ||||
1053 | |||||
1054 | if (!(-d $directory)) | ||||
1055 | { | ||||
1056 | $returnvalue = mkdir($directory, 0775); | ||||
1057 | |||||
1058 | if ($returnvalue) | ||||
1059 | { | ||||
1060 | $created_directory = 1; | ||||
1061 | $infoline = "\nCreated directory: $directory\n"; | ||||
1062 | push(@installer::globals::logfileinfo, $infoline); | ||||
1063 | |||||
1064 | chmod 0775, $directory; | ||||
1065 | } | ||||
1066 | else | ||||
1067 | { | ||||
1068 | $created_directory = 0; | ||||
1069 | } | ||||
1070 | } | ||||
1071 | else | ||||
1072 | { | ||||
1073 | $created_directory = 1; | ||||
1074 | } | ||||
1075 | |||||
1076 | return $created_directory; | ||||
1077 | } | ||||
1078 | |||||
1079 | ############################################################## | ||||
1080 | # Creating a complete directory structure | ||||
1081 | ############################################################## | ||||
1082 | |||||
1083 | sub create_directory_structure | ||||
1084 | { | ||||
1085 | my ($directory) = @_; | ||||
1086 | |||||
1087 | if ( ! try_to_create_directory($directory) ) | ||||
1088 | { | ||||
1089 | my $parentdir = $directory; | ||||
1090 | installer::pathanalyzer::get_path_from_fullqualifiedname(\$parentdir); | ||||
1091 | |||||
1092 | my $infoline = "INFO: Did not create directory $directory\n"; | ||||
1093 | push(@installer::globals::logfileinfo, $infoline); | ||||
1094 | $infoline = "Now trying to create parent directory $parentdir\n"; | ||||
1095 | push(@installer::globals::logfileinfo, $infoline); | ||||
1096 | |||||
1097 | create_directory_structure($parentdir); # recursive | ||||
1098 | } | ||||
1099 | |||||
1100 | create_directory($directory); # now it has to succeed | ||||
1101 | } | ||||
1102 | |||||
1103 | ###################################################### | ||||
1104 | # Removing a complete directory with subdirectories | ||||
1105 | ###################################################### | ||||
1106 | |||||
1107 | sub remove_complete_directory | ||||
1108 | # spent 7.38s (320ms+7.06) within installer::systemactions::remove_complete_directory which was called 1914 times, avg 3.86ms/call:
# 1911 times (320ms+-320ms) by installer::systemactions::remove_complete_directory at line 1143, avg 0s/call
# once (133µs+7.38s) by installer::worker::clean_output_tree at line 251 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer/worker.pm
# once (92µs+850µs) by installer::run at line 248 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer.pm
# once (76µs+697µs) by installer::worker::remove_old_installation_sets at line 135 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer/worker.pm | ||||
1109 | 1914 | 2.96ms | my ($directory, $start) = @_; | ||
1110 | |||||
1111 | 1914 | 1.32ms | my @content = (); | ||
1112 | 1914 | 1.15ms | my $infoline = ""; | ||
1113 | |||||
1114 | 1914 | 28.0ms | 3828 | 14.8ms | $directory =~ s/\Q$installer::globals::separator\E\s*$//; # spent 12.3ms making 1914 calls to installer::systemactions::CORE:subst, avg 6µs/call
# spent 2.52ms making 1914 calls to installer::systemactions::CORE:regcomp, avg 1µs/call |
1115 | |||||
1116 | 1914 | 169ms | 1914 | 145ms | if ( -d $directory ) # spent 145ms making 1914 calls to installer::systemactions::CORE:ftdir, avg 76µs/call |
1117 | { | ||||
1118 | 1914 | 836µs | if ( $start ) | ||
1119 | { | ||||
1120 | 2 | 2µs | $infoline = "\n"; | ||
1121 | 2 | 4µs | push(@installer::globals::logfileinfo, $infoline); | ||
1122 | 2 | 6µs | $infoline = "Removing directory $directory\n"; | ||
1123 | 2 | 3µs | push(@installer::globals::logfileinfo, $infoline); | ||
1124 | } | ||||
1125 | |||||
1126 | 1914 | 180ms | 1914 | 171ms | opendir(DIR, $directory); # spent 171ms making 1914 calls to installer::systemactions::CORE:open_dir, avg 89µs/call |
1127 | 1914 | 239ms | 1914 | 224ms | @content = readdir(DIR); # spent 224ms making 1914 calls to installer::systemactions::CORE:readdir, avg 117µs/call |
1128 | 1914 | 48.7ms | 1914 | 40.6ms | closedir(DIR); # spent 40.6ms making 1914 calls to installer::systemactions::CORE:closedir, avg 21µs/call |
1129 | |||||
1130 | 1914 | 976µs | my $oneitem; | ||
1131 | |||||
1132 | 1914 | 3.85ms | foreach $oneitem (@content) | ||
1133 | { | ||||
1134 | 14408 | 26.4ms | if ((!($oneitem eq ".")) && (!($oneitem eq ".."))) | ||
1135 | { | ||||
1136 | 10580 | 15.8ms | my $item = $directory . $installer::globals::separator . $oneitem; | ||
1137 | |||||
1138 | 10580 | 3.13s | 21160 | 3.02s | if ( -f $item || -l $item ) # deleting files or links # spent 1.85s making 8669 calls to installer::systemactions::CORE:unlink, avg 214µs/call
# spent 1.02s making 10580 calls to installer::systemactions::CORE:ftfile, avg 96µs/call
# spent 151ms making 1911 calls to installer::systemactions::CORE:ftlink, avg 79µs/call |
1139 | { | ||||
1140 | unlink($item); | ||||
1141 | } | ||||
1142 | |||||
1143 | 10580 | 1.86s | 12491 | 1.79s | if ( -d $item ) # recursive # spent 1.79s making 10580 calls to installer::systemactions::CORE:ftdir, avg 170µs/call
# spent 64.6s making 1911 calls to installer::systemactions::remove_complete_directory, avg 33.8ms/call, recursion: max depth 13, sum of overlapping time 64.6s |
1144 | { | ||||
1145 | remove_complete_directory($item, 0); | ||||
1146 | } | ||||
1147 | } | ||||
1148 | } | ||||
1149 | |||||
1150 | # try to remove empty directory | ||||
1151 | |||||
1152 | 1914 | 1.29s | 1914 | 1.28s | my $returnvalue = rmdir $directory; # spent 1.28s making 1914 calls to installer::systemactions::CORE:rmdir, avg 669µs/call |
1153 | |||||
1154 | 1914 | 847µs | if ( ! $returnvalue ) | ||
1155 | { | ||||
1156 | $infoline = "Warning: Problem with removing empty dir $directory\n"; | ||||
1157 | push(@installer::globals::logfileinfo, $infoline); | ||||
1158 | } | ||||
1159 | |||||
1160 | # try a little bit harder (sometimes there is a performance problem) | ||||
1161 | 1914 | 379ms | 1914 | 368ms | if ( -d $directory ) # spent 368ms making 1914 calls to installer::systemactions::CORE:ftdir, avg 192µs/call |
1162 | { | ||||
1163 | for ( my $j = 1; $j <= 3; $j++ ) | ||||
1164 | { | ||||
1165 | if ( -d $directory ) | ||||
1166 | { | ||||
1167 | $infoline = "\n"; | ||||
1168 | push(@installer::globals::logfileinfo, $infoline); | ||||
1169 | $infoline = "Warning (Try $j): Problems with removing directory $directory\n"; | ||||
1170 | push(@installer::globals::logfileinfo, $infoline); | ||||
1171 | |||||
1172 | $returnvalue = rmdir $directory; | ||||
1173 | |||||
1174 | if ( $returnvalue ) | ||||
1175 | { | ||||
1176 | $infoline = "Successfully removed empty dir $directory\n"; | ||||
1177 | push(@installer::globals::logfileinfo, $infoline); | ||||
1178 | } else { | ||||
1179 | $infoline = "Warning: rmdir $directory failed.\n"; | ||||
1180 | push(@installer::globals::logfileinfo, $infoline); | ||||
1181 | } | ||||
1182 | } | ||||
1183 | } | ||||
1184 | } | ||||
1185 | } | ||||
1186 | } | ||||
1187 | |||||
1188 | ###################################################### | ||||
1189 | # Creating a unique directory with number extension | ||||
1190 | ###################################################### | ||||
1191 | |||||
1192 | sub create_unique_directory | ||||
1193 | { | ||||
1194 | my ($directory) = @_; | ||||
1195 | |||||
1196 | $directory =~ s/\Q$installer::globals::separator\E\s*$//; | ||||
1197 | $directory = $directory . "_INCREASINGNUMBER"; | ||||
1198 | |||||
1199 | my $counter = 1; | ||||
1200 | my $created = 0; | ||||
1201 | my $localdirectory = ""; | ||||
1202 | |||||
1203 | do | ||||
1204 | { | ||||
1205 | $localdirectory = $directory; | ||||
1206 | $localdirectory =~ s/INCREASINGNUMBER/$counter/; | ||||
1207 | $counter++; | ||||
1208 | |||||
1209 | if ( ! -d $localdirectory ) | ||||
1210 | { | ||||
1211 | create_directory($localdirectory); | ||||
1212 | $created = 1; | ||||
1213 | } | ||||
1214 | } | ||||
1215 | while ( ! $created ); | ||||
1216 | |||||
1217 | return $localdirectory; | ||||
1218 | } | ||||
1219 | |||||
1220 | ###################################################### | ||||
1221 | # Creating a unique directory with pid extension | ||||
1222 | ###################################################### | ||||
1223 | |||||
1224 | sub create_pid_directory | ||||
1225 | # spent 1.62ms (51µs+1.57) within installer::systemactions::create_pid_directory which was called:
# once (51µs+1.57ms) by installer::parameter::setglobalvariables at line 389 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer/parameter.pm | ||||
1226 | 1 | 2µs | my ($directory) = @_; | ||
1227 | |||||
1228 | 1 | 38µs | 2 | 18µs | $directory =~ s/\Q$installer::globals::separator\E\s*$//; # spent 14µs making 1 call to installer::systemactions::CORE:regcomp
# spent 4µs making 1 call to installer::systemactions::CORE:subst |
1229 | 1 | 1µs | my $pid = $$; # process id | ||
1230 | 1 | 1µs | my $time = time(); # time | ||
1231 | |||||
1232 | 1 | 7µs | $directory = $directory . "_" . $pid . $time; | ||
1233 | |||||
1234 | 1 | 254µs | 2 | 1.55ms | if ( ! -d $directory ) { create_directory($directory); } # spent 1.31ms making 1 call to installer::systemactions::create_directory
# spent 241µs making 1 call to installer::systemactions::CORE:ftdir |
1235 | else { installer::exiter::exit_program("ERROR: Directory $directory already exists!", "create_pid_directory"); } | ||||
1236 | |||||
1237 | 1 | 8µs | return $directory; | ||
1238 | } | ||||
1239 | |||||
1240 | ############################################################## | ||||
1241 | # Reading all files from a directory and its subdirectories | ||||
1242 | ############################################################## | ||||
1243 | |||||
1244 | sub read_complete_directory | ||||
1245 | { | ||||
1246 | my ($directory, $pathstring, $filecollector) = @_; | ||||
1247 | |||||
1248 | my @content = (); | ||||
1249 | opendir(DIR, $directory); | ||||
1250 | @content = readdir(DIR); | ||||
1251 | closedir(DIR); | ||||
1252 | |||||
1253 | my $onefile; | ||||
1254 | |||||
1255 | foreach $onefile (@content) | ||||
1256 | { | ||||
1257 | if ((!($onefile eq ".")) && (!($onefile eq ".."))) | ||||
1258 | { | ||||
1259 | my $completefilename = $directory . $installer::globals::separator . $onefile; | ||||
1260 | my $sep = ""; | ||||
1261 | if ( $pathstring ne "" ) { $sep = $installer::globals::separator; } | ||||
1262 | |||||
1263 | if ( ! -d $completefilename ) # only files, no directories | ||||
1264 | { | ||||
1265 | my $content = $pathstring . $sep . $onefile; | ||||
1266 | push(@{$filecollector}, $content); | ||||
1267 | } | ||||
1268 | else # recursive for directories | ||||
1269 | { | ||||
1270 | my $newpathstring = $pathstring . $sep . $onefile; | ||||
1271 | read_complete_directory($completefilename, $newpathstring, $filecollector); | ||||
1272 | } | ||||
1273 | } | ||||
1274 | } | ||||
1275 | } | ||||
1276 | |||||
1277 | ############################################################## | ||||
1278 | # Reading all files from a directory and its subdirectories | ||||
1279 | # Version 2 | ||||
1280 | ############################################################## | ||||
1281 | |||||
1282 | # spent 2.64s (236ms+2.40) within installer::systemactions::read_full_directory which was called 497 times, avg 5.31ms/call:
# 487 times (58.5ms+-58.5ms) by installer::systemactions::read_full_directory at line 1302, avg 0s/call
# 10 times (178ms+2.46s) by installer::worker::collect_all_files_from_includepaths at line 1038 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer/worker.pm, avg 264ms/call | ||||
1283 | 497 | 771µs | my ( $currentdir, $pathstring, $collector ) = @_; | ||
1284 | 497 | 185µs | my $item; | ||
1285 | 497 | 175µs | my $fullname; | ||
1286 | 497 | 880µs | local *DH; | ||
1287 | |||||
1288 | 497 | 44.8ms | 497 | 42.4ms | unless (opendir(DH, $currentdir)) # spent 42.4ms making 497 calls to installer::systemactions::CORE:open_dir, avg 85µs/call |
1289 | { | ||||
1290 | return; | ||||
1291 | } | ||||
1292 | 497 | 61.9ms | 1491 | 54.4ms | while (defined ($item = readdir(DH))) # spent 54.4ms making 1491 calls to installer::systemactions::CORE:readdir, avg 36µs/call |
1293 | { | ||||
1294 | 14495 | 10.3ms | next if($item eq "." or $item eq ".."); | ||
1295 | 13501 | 11.7ms | $fullname = $currentdir . $installer::globals::separator . $item; | ||
1296 | 13501 | 6.23ms | my $sep = ""; | ||
1297 | 13501 | 6.38ms | if ( $pathstring ne "" ) { $sep = $installer::globals::separator; } | ||
1298 | |||||
1299 | 13501 | 2.40s | 27002 | 2.26s | if( -d $fullname) # spent 2.22s making 13501 calls to installer::systemactions::CORE:ftdir, avg 164µs/call
# spent 48.7ms making 13501 calls to installer::systemactions::CORE:readdir, avg 4µs/call |
1300 | { | ||||
1301 | 487 | 597µs | my $newpathstring = $pathstring . $sep . $item; | ||
1302 | 487 | 36.1ms | 974 | 32.2ms | read_full_directory($fullname, $newpathstring, $collector) if(-d $fullname); # spent 32.2ms making 487 calls to installer::systemactions::CORE:ftdir, avg 66µs/call
# spent 1.64s making 487 calls to installer::systemactions::read_full_directory, avg 3.36ms/call, recursion: max depth 7, sum of overlapping time 1.64s |
1303 | } | ||||
1304 | else | ||||
1305 | { | ||||
1306 | 13014 | 15.8ms | my $content = $pathstring . $sep . $item; | ||
1307 | 13014 | 26.1ms | push(@{$collector}, $content); | ||
1308 | } | ||||
1309 | } | ||||
1310 | 497 | 11.9ms | 497 | 9.90ms | closedir(DH); # spent 9.90ms making 497 calls to installer::systemactions::CORE:closedir, avg 20µs/call |
1311 | return | ||||
1312 | 497 | 2.81ms | } | ||
1313 | |||||
1314 | ############################################################## | ||||
1315 | # Removing all empty directories below a specified directory | ||||
1316 | ############################################################## | ||||
1317 | |||||
1318 | sub remove_empty_dirs_in_folder | ||||
1319 | { | ||||
1320 | my ( $dir ) = @_; | ||||
1321 | |||||
1322 | my @content = (); | ||||
1323 | my $infoline = ""; | ||||
1324 | |||||
1325 | $dir =~ s/\Q$installer::globals::separator\E\s*$//; | ||||
1326 | |||||
1327 | if ( -d $dir ) | ||||
1328 | { | ||||
1329 | opendir(DIR, $dir); | ||||
1330 | @content = readdir(DIR); | ||||
1331 | closedir(DIR); | ||||
1332 | |||||
1333 | my $oneitem; | ||||
1334 | |||||
1335 | foreach $oneitem (@content) | ||||
1336 | { | ||||
1337 | if ((!($oneitem eq ".")) && (!($oneitem eq ".."))) | ||||
1338 | { | ||||
1339 | my $item = $dir . $installer::globals::separator . $oneitem; | ||||
1340 | |||||
1341 | if ( -d $item ) # recursive | ||||
1342 | { | ||||
1343 | remove_empty_dirs_in_folder($item); | ||||
1344 | } | ||||
1345 | } | ||||
1346 | } | ||||
1347 | |||||
1348 | # try to remove empty directory | ||||
1349 | my $returnvalue = rmdir $dir; | ||||
1350 | |||||
1351 | if ( $returnvalue ) | ||||
1352 | { | ||||
1353 | $infoline = "Successfully removed empty dir $dir\n"; | ||||
1354 | push(@installer::globals::logfileinfo, $infoline); | ||||
1355 | } | ||||
1356 | |||||
1357 | } | ||||
1358 | |||||
1359 | } | ||||
1360 | |||||
1361 | 1 | 7µs | 1; | ||
# spent 4.54s within installer::systemactions::CORE:backtick which was called 13 times, avg 349ms/call:
# 13 times (4.54s+0s) by installer::systemactions::create_directories at line 270, avg 349ms/call | |||||
# spent 1.33s within installer::systemactions::CORE:chmod which was called 8868 times, avg 150µs/call:
# 7903 times (1.16s+0s) by installer::systemactions::copy_one_file at line 321, avg 147µs/call
# 816 times (136ms+0s) by installer::systemactions::create_directory_with_privileges at line 70, avg 167µs/call
# 149 times (31.5ms+0s) by installer::systemactions::create_directory_with_privileges at line 153, avg 211µs/call | |||||
# spent 66.7ms within installer::systemactions::CORE:closedir which was called 3066 times, avg 22µs/call:
# 1914 times (40.6ms+0s) by installer::systemactions::remove_complete_directory at line 1128, avg 21µs/call
# 497 times (9.90ms+0s) by installer::systemactions::read_full_directory at line 1310, avg 20µs/call
# 218 times (6.05ms+0s) by installer::systemactions::copy_directory_with_fileextension at line 653, avg 28µs/call
# 218 times (4.98ms+0s) by installer::systemactions::copy_directory at line 444, avg 23µs/call
# 110 times (2.73ms+0s) by installer::systemactions::find_file_with_file_extension at line 737, avg 25µs/call
# 109 times (2.51ms+0s) by installer::systemactions::rename_files_with_fileextension at line 695, avg 23µs/call | |||||
# spent 4.72s within installer::systemactions::CORE:ftdir which was called 29363 times, avg 161µs/call:
# 13501 times (2.22s+0s) by installer::systemactions::read_full_directory at line 1299, avg 164µs/call
# 10580 times (1.79s+0s) by installer::systemactions::remove_complete_directory at line 1143, avg 170µs/call
# 1914 times (368ms+0s) by installer::systemactions::remove_complete_directory at line 1161, avg 192µs/call
# 1914 times (145ms+0s) by installer::systemactions::remove_complete_directory at line 1116, avg 76µs/call
# 965 times (163ms+0s) by installer::systemactions::create_directory_with_privileges at line 61, avg 169µs/call
# 487 times (32.2ms+0s) by installer::systemactions::read_full_directory at line 1302, avg 66µs/call
# once (318µs+0s) by installer::systemactions::rename_string_in_directory at line 818
# once (241µs+0s) by installer::systemactions::create_pid_directory at line 1234 | |||||
# spent 1.57s within installer::systemactions::CORE:fteexec which was called 7903 times, avg 198µs/call:
# 7903 times (1.57s+0s) by installer::systemactions::copy_one_file at line 319, avg 198µs/call | |||||
# spent 6.80s within installer::systemactions::CORE:ftfile which was called 25568 times, avg 266µs/call:
# 10580 times (1.02s+0s) by installer::systemactions::remove_complete_directory at line 1138, avg 96µs/call
# 7903 times (1.50s+0s) by installer::systemactions::copy_one_file at line 318, avg 190µs/call
# 4796 times (816ms+0s) by installer::systemactions::copy_directory at line 454, avg 170µs/call
# 1853 times (3.39s+0s) by installer::systemactions::copy_directory_with_fileextension at line 665, avg 1.83ms/call
# 436 times (78.9ms+0s) by installer::systemactions::rename_files_with_fileextension at line 708, avg 181µs/call | |||||
# spent 151ms within installer::systemactions::CORE:ftlink which was called 1911 times, avg 79µs/call:
# 1911 times (151ms+0s) by installer::systemactions::remove_complete_directory at line 1138, avg 79µs/call | |||||
# spent 130ms within installer::systemactions::CORE:match which was called 109690 times, avg 1µs/call:
# 97882 times (108ms+0s) by installer::systemactions::copy_directory_with_fileextension at line 661, avg 1µs/call
# 5125 times (11.1ms+0s) by installer::systemactions::find_file_with_file_extension at line 745, avg 2µs/call
# 5123 times (5.44ms+0s) by installer::systemactions::rename_files_with_fileextension at line 703, avg 1µs/call
# 1512 times (4.81ms+0s) by installer::systemactions::get_number_of_langs at line 172, avg 3µs/call
# 20 times (29µs+0s) by installer::systemactions::create_directories at line 225, avg 1µs/call
# 14 times (130µs+0s) by installer::systemactions::get_number_of_langs at line 169, avg 9µs/call
# 14 times (45µs+0s) by installer::systemactions::create_directories at line 190, avg 3µs/call | |||||
# spent 333ms within installer::systemactions::CORE:mkdir which was called 816 times, avg 408µs/call:
# 816 times (333ms+0s) by installer::systemactions::create_directory_with_privileges at line 63, avg 408µs/call | |||||
# spent 284ms within installer::systemactions::CORE:open_dir which was called 3066 times, avg 93µs/call:
# 1914 times (171ms+0s) by installer::systemactions::remove_complete_directory at line 1126, avg 89µs/call
# 497 times (42.4ms+0s) by installer::systemactions::read_full_directory at line 1288, avg 85µs/call
# 218 times (22.7ms+0s) by installer::systemactions::copy_directory at line 442, avg 104µs/call
# 218 times (22.5ms+0s) by installer::systemactions::copy_directory_with_fileextension at line 651, avg 103µs/call
# 110 times (14.9ms+0s) by installer::systemactions::find_file_with_file_extension at line 735, avg 136µs/call
# 109 times (11.0ms+0s) by installer::systemactions::rename_files_with_fileextension at line 693, avg 101µs/call | |||||
# spent 763ms within installer::systemactions::CORE:readdir which was called 17561 times, avg 43µs/call:
# 13501 times (48.7ms+0s) by installer::systemactions::read_full_directory at line 1299, avg 4µs/call
# 1914 times (224ms+0s) by installer::systemactions::remove_complete_directory at line 1127, avg 117µs/call
# 1491 times (54.4ms+0s) by installer::systemactions::read_full_directory at line 1292, avg 36µs/call
# 218 times (373ms+0s) by installer::systemactions::copy_directory_with_fileextension at line 652, avg 1.71ms/call
# 218 times (27.9ms+0s) by installer::systemactions::copy_directory at line 443, avg 128µs/call
# 110 times (18.3ms+0s) by installer::systemactions::find_file_with_file_extension at line 736, avg 166µs/call
# 109 times (17.2ms+0s) by installer::systemactions::rename_files_with_fileextension at line 694, avg 158µs/call | |||||
# spent 95.5ms within installer::systemactions::CORE:regcomp which was called 111164 times, avg 859ns/call:
# 97882 times (77.5ms+0s) by installer::systemactions::copy_directory_with_fileextension at line 661, avg 792ns/call
# 5125 times (4.36ms+0s) by installer::systemactions::find_file_with_file_extension at line 745, avg 850ns/call
# 5123 times (8.49ms+0s) by installer::systemactions::rename_files_with_fileextension at line 703, avg 2µs/call
# 1914 times (2.52ms+0s) by installer::systemactions::remove_complete_directory at line 1114, avg 1µs/call
# 218 times (750µs+0s) by installer::systemactions::copy_directory at line 434, avg 3µs/call
# 218 times (610µs+0s) by installer::systemactions::copy_directory_with_fileextension at line 643, avg 3µs/call
# 218 times (297µs+0s) by installer::systemactions::copy_directory at line 435, avg 1µs/call
# 218 times (289µs+0s) by installer::systemactions::copy_directory_with_fileextension at line 644, avg 1µs/call
# 110 times (347µs+0s) by installer::systemactions::find_file_with_file_extension at line 728, avg 3µs/call
# 109 times (196µs+0s) by installer::systemactions::rename_files_with_fileextension at line 686, avg 2µs/call
# 20 times (82µs+0s) by installer::systemactions::create_directories at line 186, avg 4µs/call
# 6 times (35µs+0s) by installer::systemactions::create_directories at line 194, avg 6µs/call
# once (39µs+0s) by installer::systemactions::create_directory_next_to_directory at line 904
# once (26µs+0s) by installer::systemactions::rename_string_in_directory at line 816
# once (14µs+0s) by installer::systemactions::create_pid_directory at line 1228 | |||||
# spent 823ms within installer::systemactions::CORE:rename which was called 529 times, avg 1.56ms/call:
# 529 times (823ms+0s) by installer::systemactions::rename_one_file at line 405, avg 1.56ms/call | |||||
# spent 1.28s within installer::systemactions::CORE:rmdir which was called 1914 times, avg 669µs/call:
# 1914 times (1.28s+0s) by installer::systemactions::remove_complete_directory at line 1152, avg 669µs/call | |||||
# spent 2.55ms within installer::systemactions::CORE:sort which was called 110 times, avg 23µs/call:
# 110 times (2.55ms+0s) by installer::systemactions::find_file_with_file_extension at line 736, avg 23µs/call | |||||
# spent 20.5ms within installer::systemactions::CORE:subst which was called 3034 times, avg 7µs/call:
# 1914 times (12.3ms+0s) by installer::systemactions::remove_complete_directory at line 1114, avg 6µs/call
# 218 times (2.45ms+0s) by installer::systemactions::copy_directory at line 434, avg 11µs/call
# 218 times (2.16ms+0s) by installer::systemactions::copy_directory_with_fileextension at line 643, avg 10µs/call
# 218 times (859µs+0s) by installer::systemactions::copy_directory at line 435, avg 4µs/call
# 218 times (824µs+0s) by installer::systemactions::copy_directory_with_fileextension at line 644, avg 4µs/call
# 110 times (878µs+0s) by installer::systemactions::find_file_with_file_extension at line 728, avg 8µs/call
# 109 times (852µs+0s) by installer::systemactions::rename_files_with_fileextension at line 686, avg 8µs/call
# 20 times (180µs+0s) by installer::systemactions::create_directories at line 186, avg 9µs/call
# 6 times (18µs+0s) by installer::systemactions::create_directories at line 194, avg 3µs/call
# once (6µs+0s) by installer::systemactions::create_directory_next_to_directory at line 904
# once (5µs+0s) by installer::systemactions::rename_string_in_directory at line 816
# once (4µs+0s) by installer::systemactions::create_pid_directory at line 1228 | |||||
# spent 1.85s within installer::systemactions::CORE:unlink which was called 8669 times, avg 214µs/call:
# 8669 times (1.85s+0s) by installer::systemactions::remove_complete_directory at line 1138, avg 214µs/call |