| Filename | /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer/windows/removefile.pm |
| Statements | Executed 2670 statements in 4.80ms |
| Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
|---|---|---|---|---|---|
| 1 | 1 | 1 | 3.72ms | 5.10ms | installer::windows::removefile::create_removefile_table |
| 1 | 1 | 1 | 376µs | 380µs | installer::windows::removefile::BEGIN@30 |
| 2 | 1 | 1 | 19µs | 19µs | installer::windows::removefile::get_removefile_filekey |
| 1 | 1 | 1 | 16µs | 18µs | installer::windows::removefile::BEGIN@32 |
| 1 | 1 | 1 | 14µs | 16µs | installer::windows::removefile::BEGIN@31 |
| 2 | 1 | 1 | 11µs | 11µs | installer::windows::removefile::get_removefile_component |
| 2 | 1 | 1 | 10µs | 10µs | installer::windows::removefile::get_removefile_dirproperty |
| 2 | 1 | 1 | 9µs | 9µs | installer::windows::removefile::get_removefile_filename |
| 1 | 1 | 1 | 6µs | 6µs | installer::windows::removefile::get_removefile_installmode |
| Line | State ments |
Time on line |
Calls | Time in subs |
Code |
|---|---|---|---|---|---|
| 1 | #************************************************************************* | ||||
| 2 | # | ||||
| 3 | # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. | ||||
| 4 | # | ||||
| 5 | # Copyright 2000, 2010 Oracle and/or its affiliates. | ||||
| 6 | # | ||||
| 7 | # OpenOffice.org - a multi-platform office productivity suite | ||||
| 8 | # | ||||
| 9 | # This file is part of OpenOffice.org. | ||||
| 10 | # | ||||
| 11 | # OpenOffice.org is free software: you can redistribute it and/or modify | ||||
| 12 | # it under the terms of the GNU Lesser General Public License version 3 | ||||
| 13 | # only, as published by the Free Software Foundation. | ||||
| 14 | # | ||||
| 15 | # OpenOffice.org is distributed in the hope that it will be useful, | ||||
| 16 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||||
| 17 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||||
| 18 | # GNU Lesser General Public License version 3 for more details | ||||
| 19 | # (a copy is included in the LICENSE file that accompanied this code). | ||||
| 20 | # | ||||
| 21 | # You should have received a copy of the GNU Lesser General Public License | ||||
| 22 | # version 3 along with OpenOffice.org. If not, see | ||||
| 23 | # <http://www.openoffice.org/license.html> | ||||
| 24 | # for a copy of the LGPLv3 License. | ||||
| 25 | # | ||||
| 26 | #************************************************************************* | ||||
| 27 | |||||
| 28 | package installer::windows::removefile; | ||||
| 29 | |||||
| 30 | 2 | 63µs | 2 | 384µs | # spent 380µs (376+4) within installer::windows::removefile::BEGIN@30 which was called:
# once (376µs+4µs) by installer::BEGIN@78 at line 30 # spent 380µs making 1 call to installer::windows::removefile::BEGIN@30
# spent 4µs making 1 call to UNIVERSAL::import |
| 31 | 2 | 54µs | 2 | 19µs | # spent 16µs (14+3) within installer::windows::removefile::BEGIN@31 which was called:
# once (14µs+3µs) by installer::BEGIN@78 at line 31 # spent 16µs making 1 call to installer::windows::removefile::BEGIN@31
# spent 3µs making 1 call to UNIVERSAL::import |
| 32 | 2 | 905µs | 2 | 21µs | # spent 18µs (16+3) within installer::windows::removefile::BEGIN@32 which was called:
# once (16µs+3µs) by installer::BEGIN@78 at line 32 # spent 18µs making 1 call to installer::windows::removefile::BEGIN@32
# spent 3µs making 1 call to UNIVERSAL::import |
| 33 | |||||
| 34 | ######################################################################## | ||||
| 35 | # Returning the FileKey for a folderitem for removefile table. | ||||
| 36 | ######################################################################## | ||||
| 37 | |||||
| 38 | sub get_removefile_filekey | ||||
| 39 | # spent 19µs within installer::windows::removefile::get_removefile_filekey which was called 2 times, avg 10µs/call:
# 2 times (19µs+0s) by installer::windows::removefile::create_removefile_table at line 127, avg 10µs/call | ||||
| 40 | 2 | 3µs | my ($folderitem) = @_; | ||
| 41 | |||||
| 42 | # returning the unique identifier | ||||
| 43 | |||||
| 44 | 2 | 5µs | my $identifier = "remove_" . $folderitem->{'directory'}; | ||
| 45 | |||||
| 46 | 2 | 2µs | $identifier = lc($identifier); | ||
| 47 | |||||
| 48 | 2 | 18µs | return $identifier; | ||
| 49 | } | ||||
| 50 | |||||
| 51 | ######################################################################## | ||||
| 52 | # Returning the Component for a folderitem for removefile table. | ||||
| 53 | ######################################################################## | ||||
| 54 | |||||
| 55 | sub get_removefile_component | ||||
| 56 | # spent 11µs within installer::windows::removefile::get_removefile_component which was called 2 times, avg 5µs/call:
# 2 times (11µs+0s) by installer::windows::removefile::create_removefile_table at line 128, avg 5µs/call | ||||
| 57 | 2 | 2µs | my ($folderitem) = @_; | ||
| 58 | |||||
| 59 | 2 | 16µs | return $folderitem->{'component'}; | ||
| 60 | } | ||||
| 61 | |||||
| 62 | ######################################################################## | ||||
| 63 | # Returning the FileName for a folderitem for removefile table. | ||||
| 64 | ######################################################################## | ||||
| 65 | |||||
| 66 | sub get_removefile_filename | ||||
| 67 | # spent 9µs within installer::windows::removefile::get_removefile_filename which was called 2 times, avg 4µs/call:
# 2 times (9µs+0s) by installer::windows::removefile::create_removefile_table at line 129, avg 4µs/call | ||||
| 68 | 2 | 2µs | my ($folderitem) = @_; | ||
| 69 | |||||
| 70 | # return nothing: The assigned directory will be removed | ||||
| 71 | |||||
| 72 | 2 | 14µs | return ""; | ||
| 73 | } | ||||
| 74 | |||||
| 75 | ######################################################################## | ||||
| 76 | # Returning the DirProperty for a folderitem for removefile table. | ||||
| 77 | ######################################################################## | ||||
| 78 | |||||
| 79 | sub get_removefile_dirproperty | ||||
| 80 | # spent 10µs within installer::windows::removefile::get_removefile_dirproperty which was called 2 times, avg 5µs/call:
# 2 times (10µs+0s) by installer::windows::removefile::create_removefile_table at line 130, avg 5µs/call | ||||
| 81 | 2 | 2µs | my ($folderitem) = @_; | ||
| 82 | |||||
| 83 | 2 | 18µs | return $folderitem->{'directory'}; | ||
| 84 | } | ||||
| 85 | |||||
| 86 | ######################################################################## | ||||
| 87 | # Returning the InstallMode for a folderitem for removefile table. | ||||
| 88 | ######################################################################## | ||||
| 89 | |||||
| 90 | sub get_removefile_installmode | ||||
| 91 | # spent 6µs within installer::windows::removefile::get_removefile_installmode which was called:
# once (6µs+0s) by installer::windows::removefile::create_removefile_table at line 133 | ||||
| 92 | 1 | 2µs | my ($folderitem) = @_; | ||
| 93 | |||||
| 94 | # always returning "2": The file is only removed, if the assigned | ||||
| 95 | # component is removed. Name: msidbRemoveFileInstallModeOnRemove | ||||
| 96 | |||||
| 97 | 1 | 8µs | return 2; | ||
| 98 | } | ||||
| 99 | |||||
| 100 | ########################################################################################################### | ||||
| 101 | # Creating the file RemoveFi.idt dynamically | ||||
| 102 | # Content: | ||||
| 103 | # FileKey Component_ FileName DirProperty InstallMode | ||||
| 104 | ########################################################################################################### | ||||
| 105 | |||||
| 106 | sub create_removefile_table | ||||
| 107 | # spent 5.10ms (3.72+1.38) within installer::windows::removefile::create_removefile_table which was called:
# once (3.72ms+1.38ms) by installer::run at line 1531 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer.pm | ||||
| 108 | 1 | 3µs | my ($folderitemsref, $basedir) = @_; | ||
| 109 | |||||
| 110 | # Only the directories created for the FolderItems have to be deleted | ||||
| 111 | # with the information in the table RemoveFile | ||||
| 112 | |||||
| 113 | 1 | 1µs | my @directorycollector = (); | ||
| 114 | |||||
| 115 | 1 | 485µs | for ( my $i = 0; $i <= $#{$folderitemsref}; $i++ ) | ||
| 116 | { | ||||
| 117 | 872 | 607µs | my $onelink = ${$folderitemsref}[$i]; | ||
| 118 | |||||
| 119 | 872 | 1.21ms | if ( $onelink->{'used'} == 0 ) { next; } | ||
| 120 | |||||
| 121 | 872 | 1.28ms | next if grep {$_ eq $onelink->{'directory'}} @directorycollector; | ||
| 122 | |||||
| 123 | 2 | 5µs | push(@directorycollector, $onelink->{'directory'}); | ||
| 124 | |||||
| 125 | 2 | 4µs | my %removefile = (); | ||
| 126 | |||||
| 127 | 2 | 10µs | 2 | 19µs | $removefile{'FileKey'} = get_removefile_filekey($onelink); # spent 19µs making 2 calls to installer::windows::removefile::get_removefile_filekey, avg 10µs/call |
| 128 | 2 | 8µs | 2 | 11µs | $removefile{'Component_'} = get_removefile_component($onelink); # spent 11µs making 2 calls to installer::windows::removefile::get_removefile_component, avg 5µs/call |
| 129 | 2 | 8µs | 2 | 9µs | $removefile{'FileName'} = get_removefile_filename($onelink); # spent 9µs making 2 calls to installer::windows::removefile::get_removefile_filename, avg 4µs/call |
| 130 | 2 | 8µs | 2 | 10µs | $removefile{'DirProperty'} = get_removefile_dirproperty($onelink); # spent 10µs making 2 calls to installer::windows::removefile::get_removefile_dirproperty, avg 5µs/call |
| 131 | # fdo#44565 do not remove empty Desktop folder | ||||
| 132 | 3 | 5µs | if ( $removefile{'DirProperty'} eq $installer::globals::desktopfolder ) { next; } | ||
| 133 | 1 | 5µs | 1 | 6µs | $removefile{'InstallMode'} = get_removefile_installmode($onelink); # spent 6µs making 1 call to installer::windows::removefile::get_removefile_installmode |
| 134 | |||||
| 135 | 1 | 8µs | my $oneline = $removefile{'FileKey'} . "\t" . $removefile{'Component_'} . "\t" . $removefile{'FileName'} . "\t" | ||
| 136 | . $removefile{'DirProperty'} . "\t" . $removefile{'InstallMode'} . "\n"; | ||||
| 137 | |||||
| 138 | 1 | 5µs | push(@installer::globals::removefiletable, $oneline); | ||
| 139 | } | ||||
| 140 | |||||
| 141 | # Saving the file | ||||
| 142 | |||||
| 143 | 1 | 4µs | my $removefiletablename = $basedir . $installer::globals::separator . "RemoveFi.idt"; | ||
| 144 | 1 | 6µs | 1 | 1.32ms | installer::files::save_file($removefiletablename ,\@installer::globals::removefiletable); # spent 1.32ms making 1 call to installer::files::save_file |
| 145 | 1 | 5µs | my $infoline = "Created idt file: $removefiletablename\n"; | ||
| 146 | 1 | 11µs | push(@installer::globals::logfileinfo, $infoline); | ||
| 147 | |||||
| 148 | } | ||||
| 149 | |||||
| 150 | 1 | 7µs | 1; |