Filename | /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer/strip.pm |
Statements | Executed 16 statements in 1.26ms |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
1 | 1 | 1 | 337µs | 345µs | BEGIN@30 | installer::strip::
1 | 1 | 1 | 18µs | 38µs | BEGIN@31 | installer::strip::
1 | 1 | 1 | 14µs | 16µs | BEGIN@37 | installer::strip::
1 | 1 | 1 | 13µs | 16µs | BEGIN@35 | installer::strip::
1 | 1 | 1 | 13µs | 101µs | BEGIN@33 | installer::strip::
1 | 1 | 1 | 13µs | 15µs | BEGIN@38 | installer::strip::
1 | 1 | 1 | 12µs | 43µs | BEGIN@36 | installer::strip::
0 | 0 | 0 | 0s | 0s | _do_strip | installer::strip::
0 | 0 | 0 | 0s | 0s | _need_to_strip | installer::strip::
0 | 0 | 0 | 0s | 0s | strip_libraries | installer::strip::
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::strip; | ||||
29 | |||||
30 | 2 | 62µs | 2 | 354µs | # spent 345µs (337+9) within installer::strip::BEGIN@30 which was called:
# once (337µs+9µs) by installer::simplepackage::BEGIN@36 at line 30 # spent 345µs making 1 call to installer::strip::BEGIN@30
# spent 9µs making 1 call to strict::import |
31 | 2 | 59µs | 2 | 58µs | # spent 38µs (18+20) within installer::strip::BEGIN@31 which was called:
# once (18µs+20µs) by installer::simplepackage::BEGIN@36 at line 31 # spent 38µs making 1 call to installer::strip::BEGIN@31
# spent 20µs making 1 call to warnings::import |
32 | |||||
33 | 2 | 58µs | 2 | 190µs | # spent 101µs (13+89) within installer::strip::BEGIN@33 which was called:
# once (13µs+89µs) by installer::simplepackage::BEGIN@36 at line 33 # spent 101µs making 1 call to installer::strip::BEGIN@33
# spent 89µs making 1 call to base::import |
34 | |||||
35 | 2 | 51µs | 2 | 18µs | # spent 16µs (13+3) within installer::strip::BEGIN@35 which was called:
# once (13µs+3µs) by installer::simplepackage::BEGIN@36 at line 35 # spent 16µs making 1 call to installer::strip::BEGIN@35
# spent 2µs making 1 call to UNIVERSAL::import |
36 | 2 | 56µs | 2 | 74µs | # spent 43µs (12+31) within installer::strip::BEGIN@36 which was called:
# once (12µs+31µs) by installer::simplepackage::BEGIN@36 at line 36 # spent 43µs making 1 call to installer::strip::BEGIN@36
# spent 31µs making 1 call to Exporter::import |
37 | 2 | 54µs | 2 | 18µs | # spent 16µs (14+2) within installer::strip::BEGIN@37 which was called:
# once (14µs+2µs) by installer::simplepackage::BEGIN@36 at line 37 # spent 16µs making 1 call to installer::strip::BEGIN@37
# spent 2µs making 1 call to UNIVERSAL::import |
38 | 2 | 902µs | 2 | 17µs | # spent 15µs (13+2) within installer::strip::BEGIN@38 which was called:
# once (13µs+2µs) by installer::simplepackage::BEGIN@36 at line 38 # spent 15µs making 1 call to installer::strip::BEGIN@38
# spent 2µs making 1 call to UNIVERSAL::import |
39 | |||||
40 | 1 | 2µs | our @EXPORT_OK = qw(strip_libraries); | ||
41 | |||||
42 | ##################################################################### | ||||
43 | # Checking whether a file has to be stripped | ||||
44 | ##################################################################### | ||||
45 | |||||
46 | sub _need_to_strip | ||||
47 | { | ||||
48 | my ( $filename ) = @_; | ||||
49 | |||||
50 | my $strip = 0; | ||||
51 | |||||
52 | # Check using the "file" command | ||||
53 | |||||
54 | open (FILE, "file $filename |"); | ||||
55 | my $fileoutput = <FILE>; | ||||
56 | close (FILE); | ||||
57 | |||||
58 | if (( $fileoutput =~ /not stripped/i ) && ( $fileoutput =~ /\bELF\b/ )) { $strip = 1; } | ||||
59 | |||||
60 | return $strip | ||||
61 | } | ||||
62 | |||||
63 | ##################################################################### | ||||
64 | # Checking whether a file has to be stripped | ||||
65 | ##################################################################### | ||||
66 | |||||
67 | sub _do_strip | ||||
68 | { | ||||
69 | my ( $filename ) = @_; | ||||
70 | |||||
71 | my $systemcall = "strip" . " " . $filename; | ||||
72 | |||||
73 | my $returnvalue = system($systemcall); | ||||
74 | |||||
75 | my $infoline = "Systemcall: $systemcall\n"; | ||||
76 | push( @installer::globals::logfileinfo, $infoline); | ||||
77 | |||||
78 | if ($returnvalue) | ||||
79 | { | ||||
80 | $infoline = "ERROR: Could not strip $filename!\n"; | ||||
81 | push( @installer::globals::logfileinfo, $infoline); | ||||
82 | } | ||||
83 | else | ||||
84 | { | ||||
85 | $infoline = "SUCCESS: Stripped library $filename!\n"; | ||||
86 | push( @installer::globals::logfileinfo, $infoline); | ||||
87 | } | ||||
88 | } | ||||
89 | |||||
90 | ##################################################################### | ||||
91 | # Resolving all variables in the packagename. | ||||
92 | ##################################################################### | ||||
93 | |||||
94 | sub strip_libraries | ||||
95 | { | ||||
96 | my ( $filelist, $languagestringref ) = @_; | ||||
97 | |||||
98 | installer::logger::include_header_into_logfile("Stripping files:"); | ||||
99 | |||||
100 | my $strippeddirbase = installer::systemactions::create_directories("stripped", $languagestringref); | ||||
101 | |||||
102 | if (! grep {$_ eq $strippeddirbase} @installer::globals::removedirs) | ||||
103 | { | ||||
104 | push(@installer::globals::removedirs, $strippeddirbase); | ||||
105 | } | ||||
106 | |||||
107 | for ( my $i = 0; $i <= $#{$filelist}; $i++ ) | ||||
108 | { | ||||
109 | my $sourcefilename = ${$filelist}[$i]->{'sourcepath'}; | ||||
110 | |||||
111 | if ( _need_to_strip($sourcefilename) ) | ||||
112 | { | ||||
113 | my $shortfilename = $sourcefilename; | ||||
114 | installer::pathanalyzer::make_absolute_filename_to_relative_filename(\$shortfilename); | ||||
115 | |||||
116 | my $infoline = "Strip: $shortfilename\n"; | ||||
117 | push( @installer::globals::logfileinfo, $infoline); | ||||
118 | |||||
119 | # copy file into directory for stripped libraries | ||||
120 | |||||
121 | my $onelanguage = ${$filelist}[$i]->{'specificlanguage'}; | ||||
122 | |||||
123 | # files without language into directory "00" | ||||
124 | |||||
125 | if ($onelanguage eq "") { $onelanguage = "00"; } | ||||
126 | |||||
127 | my $strippeddir = $strippeddirbase . $installer::globals::separator . $onelanguage; | ||||
128 | installer::systemactions::create_directory($strippeddir); # creating language specific subdirectories | ||||
129 | |||||
130 | my $destfilename = $strippeddir . $installer::globals::separator . $shortfilename; | ||||
131 | installer::systemactions::copy_one_file($sourcefilename, $destfilename); | ||||
132 | |||||
133 | # change sourcepath in files collector | ||||
134 | |||||
135 | ${$filelist}[$i]->{'sourcepath'} = $destfilename; | ||||
136 | |||||
137 | # strip file | ||||
138 | |||||
139 | _do_strip($destfilename); | ||||
140 | } | ||||
141 | } | ||||
142 | } | ||||
143 | |||||
144 | 1 | 11µs | 1; |