← 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:42 2012

Filename/cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer/strip.pm
StatementsExecuted 16 statements in 1.26ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
111337µs345µsinstaller::strip::::BEGIN@30installer::strip::BEGIN@30
11118µs38µsinstaller::strip::::BEGIN@31installer::strip::BEGIN@31
11114µs16µsinstaller::strip::::BEGIN@37installer::strip::BEGIN@37
11113µs16µsinstaller::strip::::BEGIN@35installer::strip::BEGIN@35
11113µs101µsinstaller::strip::::BEGIN@33installer::strip::BEGIN@33
11113µs15µsinstaller::strip::::BEGIN@38installer::strip::BEGIN@38
11112µs43µsinstaller::strip::::BEGIN@36installer::strip::BEGIN@36
0000s0sinstaller::strip::::_do_stripinstaller::strip::_do_strip
0000s0sinstaller::strip::::_need_to_stripinstaller::strip::_need_to_strip
0000s0sinstaller::strip::::strip_librariesinstaller::strip::strip_libraries
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::strip;
29
30262µs2354µ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
use strict;
# spent 345µs making 1 call to installer::strip::BEGIN@30 # spent 9µs making 1 call to strict::import
31259µs258µ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
use warnings;
# spent 38µs making 1 call to installer::strip::BEGIN@31 # spent 20µs making 1 call to warnings::import
32
33258µs2190µ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
use base 'Exporter';
# spent 101µs making 1 call to installer::strip::BEGIN@33 # spent 89µs making 1 call to base::import
34
35251µs218µ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
use installer::globals;
# spent 16µs making 1 call to installer::strip::BEGIN@35 # spent 2µs making 1 call to UNIVERSAL::import
36256µs274µ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
use installer::logger;
# spent 43µs making 1 call to installer::strip::BEGIN@36 # spent 31µs making 1 call to Exporter::import
37254µs218µ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
use installer::pathanalyzer;
# spent 16µs making 1 call to installer::strip::BEGIN@37 # spent 2µs making 1 call to UNIVERSAL::import
382902µs217µ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
use installer::systemactions;
# spent 15µs making 1 call to installer::strip::BEGIN@38 # spent 2µs making 1 call to UNIVERSAL::import
39
4012µsour @EXPORT_OK = qw(strip_libraries);
41
42#####################################################################
43# Checking whether a file has to be stripped
44#####################################################################
45
46sub _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
67sub _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
94sub 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
144111µs1;