← Index
NYTProf Performance Profile   « block view • line view • sub view »
For C:/lo/libo-master/solenv/bin/make_installer.pl
  Run on Mon Sep 24 00:52:54 2012
Reported on Mon Sep 24 07:34:32 2012

Filename/cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer/systemactions.pm
StatementsExecuted 578543 statements in 26.8s
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
25568516.80s6.80sinstaller::systemactions::::CORE:ftfileinstaller::systemactions::CORE:ftfile (opcode)
29363814.72s4.72sinstaller::systemactions::::CORE:ftdirinstaller::systemactions::CORE:ftdir (opcode)
13114.54s4.54sinstaller::systemactions::::CORE:backtickinstaller::systemactions::CORE:backtick (opcode)
8669111.85s1.85sinstaller::systemactions::::CORE:unlinkinstaller::systemactions::CORE:unlink (opcode)
7903111.57s1.57sinstaller::systemactions::::CORE:fteexecinstaller::systemactions::CORE:fteexec (opcode)
8868311.33s1.33sinstaller::systemactions::::CORE:chmodinstaller::systemactions::CORE:chmod (opcode)
1914111.28s1.28sinstaller::systemactions::::CORE:rmdirinstaller::systemactions::CORE:rmdir (opcode)
52911823ms823msinstaller::systemactions::::CORE:renameinstaller::systemactions::CORE:rename (opcode)
21821809ms11.6sinstaller::systemactions::::copy_directory_with_fileextensioninstaller::systemactions::copy_directory_with_fileextension
1756171763ms763msinstaller::systemactions::::CORE:readdirinstaller::systemactions::CORE:readdir (opcode)
7903126360ms21.8sinstaller::systemactions::::copy_one_fileinstaller::systemactions::copy_one_file
81611333ms333msinstaller::systemactions::::CORE:mkdirinstaller::systemactions::CORE:mkdir (opcode)
191443320ms7.38sinstaller::systemactions::::remove_complete_directoryinstaller::systemactions::remove_complete_directory (recurses: max depth 13, inclusive time 64.6s)
306661284ms284msinstaller::systemactions::::CORE:open_dirinstaller::systemactions::CORE:open_dir (opcode)
49722236ms2.64sinstaller::systemactions::::read_full_directoryinstaller::systemactions::read_full_directory (recurses: max depth 7, inclusive time 1.64s)
191111151ms151msinstaller::systemactions::::CORE:ftlinkinstaller::systemactions::CORE:ftlink (opcode)
10969071130ms130msinstaller::systemactions::::CORE:matchinstaller::systemactions::CORE:match (opcode)
11116415195.5ms95.5msinstaller::systemactions::::CORE:regcompinstaller::systemactions::CORE:regcomp (opcode)
2182186.8ms11.5sinstaller::systemactions::::copy_directoryinstaller::systemactions::copy_directory
30666166.7ms66.7msinstaller::systemactions::::CORE:closedirinstaller::systemactions::CORE:closedir (opcode)
1102255.8ms111msinstaller::systemactions::::find_file_with_file_extensioninstaller::systemactions::find_file_with_file_extension
1091151.0ms777msinstaller::systemactions::::rename_files_with_fileextensioninstaller::systemactions::rename_files_with_fileextension
9652229.2ms693msinstaller::systemactions::::create_directory_with_privilegesinstaller::systemactions::create_directory_with_privileges
303412120.5ms20.5msinstaller::systemactions::::CORE:substinstaller::systemactions::CORE:subst (opcode)
52924410.7ms834msinstaller::systemactions::::rename_one_fileinstaller::systemactions::rename_one_file
964211010.4ms703msinstaller::systemactions::::create_directoryinstaller::systemactions::create_directory
14226.92ms11.9msinstaller::systemactions::::get_number_of_langsinstaller::systemactions::get_number_of_langs
201482.81ms4.60sinstaller::systemactions::::create_directoriesinstaller::systemactions::create_directories
110112.55ms2.55msinstaller::systemactions::::CORE:sortinstaller::systemactions::CORE:sort (opcode)
1112.19ms2.61msinstaller::systemactions::::BEGIN@32installer::systemactions::BEGIN@32
1111.04ms1.36msinstaller::systemactions::::BEGIN@36installer::systemactions::BEGIN@36
1111.03ms1.35msinstaller::systemactions::::BEGIN@35installer::systemactions::BEGIN@35
111373µs456µsinstaller::systemactions::::BEGIN@30installer::systemactions::BEGIN@30
11172µs90.5msinstaller::systemactions::::rename_string_in_directoryinstaller::systemactions::rename_string_in_directory
11151µs1.62msinstaller::systemactions::::create_pid_directoryinstaller::systemactions::create_pid_directory
11141µs1.11msinstaller::systemactions::::create_directory_next_to_directoryinstaller::systemactions::create_directory_next_to_directory
11127µs136msinstaller::systemactions::::rename_directoryinstaller::systemactions::rename_directory
11121µs72µsinstaller::systemactions::::BEGIN@31installer::systemactions::BEGIN@31
11116µs20µsinstaller::systemactions::::BEGIN@33installer::systemactions::BEGIN@33
11113µs15µsinstaller::systemactions::::BEGIN@34installer::systemactions::BEGIN@34
0000s0sinstaller::systemactions::::copy_complete_directoryinstaller::systemactions::copy_complete_directory
0000s0sinstaller::systemactions::::create_directory_structureinstaller::systemactions::create_directory_structure
0000s0sinstaller::systemactions::::create_unique_directoryinstaller::systemactions::create_unique_directory
0000s0sinstaller::systemactions::::find_new_content_in_directoryinstaller::systemactions::find_new_content_in_directory
0000s0sinstaller::systemactions::::get_all_directoriesinstaller::systemactions::get_all_directories
0000s0sinstaller::systemactions::::get_all_directories_without_pathinstaller::systemactions::get_all_directories_without_path
0000s0sinstaller::systemactions::::get_directorynameinstaller::systemactions::get_directoryname
0000s0sinstaller::systemactions::::hardlink_complete_directoryinstaller::systemactions::hardlink_complete_directory
0000s0sinstaller::systemactions::::hardlink_one_fileinstaller::systemactions::hardlink_one_file
0000s0sinstaller::systemactions::::is_empty_dirinstaller::systemactions::is_empty_dir
0000s0sinstaller::systemactions::::make_numbered_dirinstaller::systemactions::make_numbered_dir
0000s0sinstaller::systemactions::::read_complete_directoryinstaller::systemactions::read_complete_directory
0000s0sinstaller::systemactions::::read_directoryinstaller::systemactions::read_directory
0000s0sinstaller::systemactions::::remove_empty_dirs_in_folderinstaller::systemactions::remove_empty_dirs_in_folder
0000s0sinstaller::systemactions::::softlink_complete_directoryinstaller::systemactions::softlink_complete_directory
0000s0sinstaller::systemactions::::softlink_one_fileinstaller::systemactions::softlink_one_file
0000s0sinstaller::systemactions::::try_to_create_directoryinstaller::systemactions::try_to_create_directory
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1#*************************************************************************
2#
3# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4#
5# Copyright 2000, 2010 Oracle and/or its affiliates.
6#
7# OpenOffice.org - a multi-platform office productivity suite
8#
9# This file is part of OpenOffice.org.
10#
11# OpenOffice.org is free software: you can redistribute it and/or modify
12# it under the terms of the GNU Lesser General Public License version 3
13# only, as published by the Free Software Foundation.
14#
15# OpenOffice.org is distributed in the hope that it will be useful,
16# but WITHOUT ANY WARRANTY; without even the implied warranty of
17# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18# GNU Lesser General Public License version 3 for more details
19# (a copy is included in the LICENSE file that accompanied this code).
20#
21# You should have received a copy of the GNU Lesser General Public License
22# version 3 along with OpenOffice.org. If not, see
23# <http://www.openoffice.org/license.html>
24# for a copy of the LGPLv3 License.
25#
26#*************************************************************************
27
28package installer::systemactions;
29
30263µs2540µ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
use Cwd;
# spent 456µs making 1 call to installer::systemactions::BEGIN@30 # spent 84µs making 1 call to Exporter::import
31262µs2123µ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
use File::Copy;
# spent 72µs making 1 call to installer::systemactions::BEGIN@31 # spent 51µs making 1 call to Exporter::import
3221.04ms22.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
use installer::converter;
# spent 2.61ms making 1 call to installer::systemactions::BEGIN@32 # spent 3µs making 1 call to UNIVERSAL::import
33257µs224µ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
use installer::exiter;
# spent 20µs making 1 call to installer::systemactions::BEGIN@33 # spent 4µs making 1 call to UNIVERSAL::import
34251µs217µ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
use installer::globals;
# spent 15µs making 1 call to installer::systemactions::BEGIN@34 # spent 2µs making 1 call to UNIVERSAL::import
352998µs21.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
use installer::pathanalyzer;
# spent 1.35ms making 1 call to installer::systemactions::BEGIN@35 # spent 3µs making 1 call to UNIVERSAL::import
36210.9ms21.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
use installer::remover;
# 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
42sub 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
{
4419288.58ms my ($directory) = @_;
45
46964693ms 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
53sub 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
{
559352696ms my ($directory, $privileges) = @_;
56
57 my $returnvalue = 1;
58 my $infoline = "";
59 my $localprivileges = oct("0".$privileges); # changes "777" to 0777
60
61965163ms if (!(-d $directory))
# spent 163ms making 965 calls to installer::systemactions::CORE:ftdir, avg 169µs/call
62 {
63816333ms $returnvalue = mkdir($directory, $localprivileges);
# spent 333ms making 816 calls to installer::systemactions::CORE:mkdir, avg 408µs/call
64
65 if ($returnvalue)
66 {
67 $infoline = "\nCreated directory: $directory\n";
68 push(@installer::globals::logfileinfo, $infoline);
69
70816136ms 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 $infoline = "\nAlready existing directory, did not create: $directory\n";
151 push(@installer::globals::logfileinfo, $infoline);
152
15314931.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
161sub 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
{
163309411.9ms my ($languagestring) = @_;
164
165 my $number = 1;
166
167 my $workstring = $languagestring;
168
16914130µs while ( $workstring =~ /^\s*(.*)_(.*?)\s*$/ )
# spent 130µs making 14 calls to installer::systemactions::CORE:match, avg 9µs/call
170 {
171 $workstring = $1;
17215124.81ms $number++;
# spent 4.81ms making 1512 calls to installer::systemactions::CORE:match, avg 3µs/call
173 }
174
175 return $number;
176}
177
178#######################################################################
179# Creating the directories, in which files are generated or unzipped
180#######################################################################
181
182sub 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
{
1846504.54s my ($newdirectory, $languagesref) =@_;
185
18640262µ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 my $path = "";
189
1901445µ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 if ( $installer::globals::temppathdefined ) { $path = $installer::globals::temppath; }
193 else { $path = $installer::globals::unpackpath; }
1941253µ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 $path = $path . $installer::globals::separator;
196 }
197 else
198 {
199 $path = $installer::globals::unpackpath . $installer::globals::separator;
200
201 # special handling, if LOCALINSTALLDIR is set
202 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 $infoline = "create_directories: Using $path for $newdirectory !\n";
210 push( @installer::globals::logfileinfo, $infoline);
211
212 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 my $localproductname = $installer::globals::product;
223 my $localproductsubdir = "";
224
2252029µ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 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 else { $path = $path . $localproductname . $installer::globals::separator; }
235
236209.57ms create_directory($path);
# spent 9.57ms making 20 calls to installer::systemactions::create_directory, avg 479µs/call
237
238 if ( $localproductsubdir )
239 {
240 $path = $path . $localproductsubdir . $installer::globals::separator;
241 create_directory($path);
242 }
243
244 $path = $path . $installer::globals::installertypedir . $installer::globals::separator;
245205.89ms create_directory($path);
# spent 5.89ms making 20 calls to installer::systemactions::create_directory, avg 294µs/call
246
247 $path = $path . $newdirectory . $installer::globals::separator;
2482014.0ms create_directory($path);
# spent 14.0ms making 20 calls to installer::systemactions::create_directory, avg 699µs/call
249
250 my $locallanguagesref = "";
251
252 if ( $$languagesref ) { $locallanguagesref = $$languagesref; }
253
254 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 if ($locallanguagesref ne "") # this will be a path like "01_49", for Profiles and ConfigurationFiles, idt-Files
263 {
264
265 my $languagestring = $$languagesref;
266
267 if (length($languagestring) > $installer::globals::max_lang_length )
268 {
2691311.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
270134.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 my $id = substr($shorter, 0, 8); # taking only the first 8 digits
272 $languagestring = "lang_" . $number_of_languages . "_id_" . $id;
273 }
274
275 $path = $path . $languagestring . $installer::globals::separator;
2761314.4ms create_directory($path);
# spent 14.4ms making 13 calls to installer::systemactions::create_directory, avg 1.11ms/call
277 }
278 }
279 }
280
28120776µs installer::remover::remove_ending_pathseparator(\$path);
# spent 776µs making 20 calls to installer::remover::remove_ending_pathseparator, avg 39µs/call
282
28320485µ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 return $path;
286}
287
288########################
289# Copying one file
290########################
291
292sub 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
{
2941343514.59s my ($source, $dest) = @_;
295
296 my ($returnvalue, $infoline);
297
298790317.2s my $copyreturn = copy($source, $dest);
# spent 17.2s making 7903 calls to File::Copy::copy, avg 2.17ms/call
299
300 if ($copyreturn)
301 {
302 $infoline = "Copy: $source to $dest\n";
303 $returnvalue = 1;
304 }
305 else
306 {
307 $infoline = "ERROR: Could not copy $source to $dest $!\n";
308 $returnvalue = 0;
309 }
310
311 push(@installer::globals::logfileinfo, $infoline);
312
313 if ( !$returnvalue ) {
314 return $returnvalue;
315 }
316
317 # taking care of file attributes
31879031.50s if ($installer::globals::iswin && -f $dest) {
# spent 1.50s making 7903 calls to installer::systemactions::CORE:ftfile, avg 190µs/call
31979031.57s my $mode = -x $source ? 0775 : 0664;
# spent 1.57s making 7903 calls to installer::systemactions::CORE:fteexec, avg 198µs/call
320 my $mode_str = sprintf("%o", $mode);
32179031.16s my $chmodreturn = chmod($mode, $dest);
# spent 1.16s making 7903 calls to installer::systemactions::CORE:chmod, avg 147µs/call
322 if ($chmodreturn)
323 {
324 $infoline = "chmod $mode_str, $dest\n";
325 $returnvalue = 1;
326 }
327 else
328 {
329 $infoline = "WARNING: Could not chmod $dest: $!\n";
330 $returnvalue = 0;
331 }
332
333 push(@installer::globals::logfileinfo, $infoline);
334 }
335
336 return $returnvalue;
337}
338
339##########################
340# Hard linking one file
341##########################
342
343sub 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
371sub 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
399sub 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
{
4014232835ms my ($source, $dest) = @_;
402
403 my ($returnvalue, $infoline);
404
405529823ms my $renamereturn = rename($source, $dest);
# spent 823ms making 529 calls to installer::systemactions::CORE:rename, avg 1.56ms/call
406
407 if ($renamereturn)
408 {
409 $infoline = "Rename: $source to $dest\n";
410 $returnvalue = 1;
411 }
412 else
413 {
414 $infoline = "ERROR: Could not rename $source to $dest\n";
415 $returnvalue = 0;
416 }
417
418 push(@installer::globals::logfileinfo, $infoline);
419
420 return $returnvalue;
421}
422
423##########################################
424# Copying all files from one directory
425# to another directory
426##########################################
427
428sub 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
{
43022454958ms my ($sourcedir, $destdir) = @_;
431
432 my @sourcefiles = ();
433
4344363.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
4354361.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 my $infoline = "\n";
438 push(@installer::globals::logfileinfo, $infoline);
439 $infoline = "Copying files from directory $sourcedir to directory $destdir\n";
440 push(@installer::globals::logfileinfo, $infoline);
441
44221822.7ms opendir(DIR, $sourcedir);
# spent 22.7ms making 218 calls to installer::systemactions::CORE:open_dir, avg 104µs/call
44321827.9ms @sourcefiles = readdir(DIR);
# spent 27.9ms making 218 calls to installer::systemactions::CORE:readdir, avg 128µs/call
4442184.98ms closedir(DIR);
# spent 4.98ms making 218 calls to installer::systemactions::CORE:closedir, avg 23µs/call
445
446 my $onefile;
447
448 foreach $onefile (@sourcefiles)
449 {
450 if ((!($onefile eq ".")) && (!($onefile eq "..")))
451 {
452 my $sourcefile = $sourcedir . $installer::globals::separator . $onefile;
453 my $destfile = $destdir . $installer::globals::separator . $onefile;
454948311.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
467sub 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
498sub 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
542sub 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
589sub 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
637sub 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
{
6392045934.79s my ($sourcedir, $destdir, $extension) = @_;
640
641 my @sourcefiles = ();
642
6434362.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
6444361.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 $infoline = "\n";
647 push(@installer::globals::logfileinfo, $infoline);
648 $infoline = "Copying files with extension $extension from directory $sourcedir to directory $destdir\n";
649 push(@installer::globals::logfileinfo, $infoline);
650
65121822.5ms opendir(DIR, $sourcedir);
# spent 22.5ms making 218 calls to installer::systemactions::CORE:open_dir, avg 103µs/call
652218373ms @sourcefiles = readdir(DIR);
# spent 373ms making 218 calls to installer::systemactions::CORE:readdir, avg 1.71ms/call
6532186.05ms closedir(DIR);
# spent 6.05ms making 218 calls to installer::systemactions::CORE:closedir, avg 28µs/call
654
655 my $onefile;
656
657 foreach $onefile (@sourcefiles)
658 {
659 if ((!($onefile eq ".")) && (!($onefile eq "..")))
660 {
661195764186ms 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 my $sourcefile = $sourcedir . $installer::globals::separator . $onefile;
664 my $destfile = $destdir . $installer::globals::separator . $onefile;
665370610.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
680sub 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
{
68213516175ms my ($dir, $extension) = @_;
683
684 my @sourcefiles = ();
685
6862181.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 my $infoline = "\n";
689 push(@installer::globals::logfileinfo, $infoline);
690 $infoline = "Renaming files with extension \"$extension\" in the directory $dir\n";
691 push(@installer::globals::logfileinfo, $infoline);
692
69310911.0ms opendir(DIR, $dir);
# spent 11.0ms making 109 calls to installer::systemactions::CORE:open_dir, avg 101µs/call
69410917.2ms @sourcefiles = readdir(DIR);
# spent 17.2ms making 109 calls to installer::systemactions::CORE:readdir, avg 158µs/call
6951092.51ms closedir(DIR);
# spent 2.51ms making 109 calls to installer::systemactions::CORE:closedir, avg 23µs/call
696
697 my $onefile;
698
699 foreach $onefile (@sourcefiles)
700 {
701 if ((!($onefile eq ".")) && (!($onefile eq "..")))
702 {
7031024613.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 my $destfile = $1;
706 my $sourcefile = $dir . $installer::globals::separator . $onefile;
707 $destfile = $dir . $installer::globals::separator . $destfile;
708872681ms 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
722sub 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
{
72411900111ms my ($extension, $dir) = @_;
725
726 my @allfiles = ();
727
7282201.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 my $infoline = "\n";
731 push(@installer::globals::logfileinfo, $infoline);
732 $infoline = "Searching files with extension \"$extension\" in the directory $dir\n";
733 push(@installer::globals::logfileinfo, $infoline);
734
73511014.9ms opendir(DIR, $dir);
# spent 14.9ms making 110 calls to installer::systemactions::CORE:open_dir, avg 136µs/call
73622020.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
7371102.73ms closedir(DIR);
# spent 2.73ms making 110 calls to installer::systemactions::CORE:closedir, avg 25µs/call
738
739 my $onefile;
740
741 foreach $onefile (@sourcefiles)
742 {
743 if ((!($onefile eq ".")) && (!($onefile eq "..")))
744 {
7451025015.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 return \@allfiles;
753}
754
755##############################################################
756# Creating a unique directory, for example "01_inprogress_7"
757# in the install directory.
758##############################################################
759
760sub 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
809sub 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
{
8119423µs my ($olddir, $oldstring, $newstring) = @_;
812
813 my $newdir = $olddir;
814 my $infoline = "";
815
816231µ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
8181318µs if (( -d $newdir ) && ( $olddir ne $newdir )) { remove_complete_directory($newdir, 1); }
# spent 318µs making 1 call to installer::systemactions::CORE:ftdir
819
820190.1ms if ( move($olddir, $newdir) )
# spent 90.1ms making 1 call to File::Copy::move
821 {
822 $infoline = "\nMoved directory from $olddir to $newdir\n";
823 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 return $newdir;
832}
833
834######################################################
835# Returning the complete directory name,
836# input is the first part of the directory name.
837######################################################
838
839sub 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
874sub 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
{
876628µs my ($olddir, $newdir) = @_;
877
878 my $infoline = "";
879
8801136ms if ( move($olddir, $newdir) )
# spent 136ms making 1 call to File::Copy::move
881 {
882 $infoline = "\nMoved directory from $olddir to $newdir\n";
883 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 return $newdir;
891}
892
893##############################################################
894# Creating a directory next to an existing directory
895##############################################################
896
897sub 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
{
899780µs my ($topdir, $dirname) = @_;
900
901 my $basedir = $topdir;
902148µs installer::pathanalyzer::get_path_from_fullqualifiedname(\$basedir);
903
904245µ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 my $newdir = $basedir . $installer::globals::separator . $dirname;
907
9081975µs create_directory($newdir);
# spent 975µs making 1 call to installer::systemactions::create_directory
909
910 return $newdir;
911}
912
913##############################################################
914# Collecting all directories inside a directory
915##############################################################
916
917sub 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
948sub 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
978sub 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
1008sub 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
1047sub 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
1083sub 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
1107sub 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
{
1109729527.38s my ($directory, $start) = @_;
1110
1111 my @content = ();
1112 my $infoline = "";
1113
1114382814.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
11161914145ms if ( -d $directory )
# spent 145ms making 1914 calls to installer::systemactions::CORE:ftdir, avg 76µs/call
1117 {
1118 if ( $start )
1119 {
1120 $infoline = "\n";
1121 push(@installer::globals::logfileinfo, $infoline);
1122 $infoline = "Removing directory $directory\n";
1123 push(@installer::globals::logfileinfo, $infoline);
1124 }
1125
11261914171ms opendir(DIR, $directory);
# spent 171ms making 1914 calls to installer::systemactions::CORE:open_dir, avg 89µs/call
11271914224ms @content = readdir(DIR);
# spent 224ms making 1914 calls to installer::systemactions::CORE:readdir, avg 117µs/call
1128191440.6ms closedir(DIR);
# spent 40.6ms making 1914 calls to installer::systemactions::CORE:closedir, avg 21µs/call
1129
1130 my $oneitem;
1131
1132 foreach $oneitem (@content)
1133 {
1134 if ((!($oneitem eq ".")) && (!($oneitem eq "..")))
1135 {
1136 my $item = $directory . $installer::globals::separator . $oneitem;
1137
1138211603.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
1143124911.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
115219141.28s my $returnvalue = rmdir $directory;
# spent 1.28s making 1914 calls to installer::systemactions::CORE:rmdir, avg 669µs/call
1153
1154 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)
11611914368ms 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
1192sub 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
1224sub 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
{
12267310µs my ($directory) = @_;
1227
1228218µ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 my $pid = $$; # process id
1230 my $time = time(); # time
1231
1232 $directory = $directory . "_" . $pid . $time;
1233
123421.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 return $directory;
1238}
1239
1240##############################################################
1241# Reading all files from a directory and its subdirectories
1242##############################################################
1243
1244sub 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
sub read_full_directory {
1283994772.64s my ( $currentdir, $pathstring, $collector ) = @_;
1284 my $item;
1285 my $fullname;
1286 local *DH;
1287
128849742.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 }
1292149154.4ms while (defined ($item = readdir(DH)))
# spent 54.4ms making 1491 calls to installer::systemactions::CORE:readdir, avg 36µs/call
1293 {
1294 next if($item eq "." or $item eq "..");
1295 $fullname = $currentdir . $installer::globals::separator . $item;
1296 my $sep = "";
1297 if ( $pathstring ne "" ) { $sep = $installer::globals::separator; }
1298
1299270022.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 my $newpathstring = $pathstring . $sep . $item;
130297432.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 my $content = $pathstring . $sep . $item;
1307 push(@{$collector}, $content);
1308 }
1309 }
13104979.90ms closedir(DH);
# spent 9.90ms making 497 calls to installer::systemactions::CORE:closedir, avg 20µs/call
1311 return
1312}
1313
1314##############################################################
1315# Removing all empty directories below a specified directory
1316##############################################################
1317
1318sub 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
136117µs1;
 
# 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
sub installer::systemactions::CORE:backtick; # opcode
# 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
sub installer::systemactions::CORE:chmod; # opcode
# 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
sub installer::systemactions::CORE:closedir; # opcode
# 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
sub installer::systemactions::CORE:ftdir; # opcode
# 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
sub installer::systemactions::CORE:fteexec; # opcode
# 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
sub installer::systemactions::CORE:ftfile; # opcode
# 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
sub installer::systemactions::CORE:ftlink; # opcode
# 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
sub installer::systemactions::CORE:match; # opcode
# 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
sub installer::systemactions::CORE:mkdir; # opcode
# 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
sub installer::systemactions::CORE:open_dir; # opcode
# 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
sub installer::systemactions::CORE:readdir; # opcode
# 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
sub installer::systemactions::CORE:regcomp; # opcode
# 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
sub installer::systemactions::CORE:rename; # opcode
# 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
sub installer::systemactions::CORE:rmdir; # opcode
# 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
sub installer::systemactions::CORE:sort; # opcode
# 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
sub installer::systemactions::CORE:subst; # opcode
# 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
sub installer::systemactions::CORE:unlink; # opcode