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

Filename/cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer/windows/upgrade.pm
StatementsExecuted 33 statements in 1.91ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
111384µs387µsinstaller::windows::upgrade::::BEGIN@30installer::windows::upgrade::BEGIN@30
11195µs765µsinstaller::windows::upgrade::::create_upgrade_tableinstaller::windows::upgrade::create_upgrade_table
11118µs21µsinstaller::windows::upgrade::::BEGIN@31installer::windows::upgrade::BEGIN@31
11116µs18µsinstaller::windows::upgrade::::BEGIN@33installer::windows::upgrade::BEGIN@33
11116µs18µsinstaller::windows::upgrade::::BEGIN@32installer::windows::upgrade::BEGIN@32
1119µs9µsinstaller::windows::upgrade::::CORE:matchinstaller::windows::upgrade::CORE:match (opcode)
0000s0sinstaller::windows::upgrade::::analyze_file_for_upgrade_tableinstaller::windows::upgrade::analyze_file_for_upgrade_table
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::windows::upgrade;
29
30267µs2391µs
# spent 387µs (384+4) within installer::windows::upgrade::BEGIN@30 which was called: # once (384µs+4µs) by installer::BEGIN@83 at line 30
use installer::exiter;
# spent 387µs making 1 call to installer::windows::upgrade::BEGIN@30 # spent 4µs making 1 call to UNIVERSAL::import
31257µs223µs
# spent 21µs (18+3) within installer::windows::upgrade::BEGIN@31 which was called: # once (18µs+3µs) by installer::BEGIN@83 at line 31
use installer::files;
# spent 21µs making 1 call to installer::windows::upgrade::BEGIN@31 # spent 3µs making 1 call to UNIVERSAL::import
32255µs221µs
# spent 18µs (16+3) within installer::windows::upgrade::BEGIN@32 which was called: # once (16µs+3µs) by installer::BEGIN@83 at line 32
use installer::globals;
# spent 18µs making 1 call to installer::windows::upgrade::BEGIN@32 # spent 3µs making 1 call to UNIVERSAL::import
3321.63ms220µs
# spent 18µs (16+2) within installer::windows::upgrade::BEGIN@33 which was called: # once (16µs+2µs) by installer::BEGIN@83 at line 33
use installer::windows::idtglobal;
# spent 18µs making 1 call to installer::windows::upgrade::BEGIN@33 # spent 2µs making 1 call to UNIVERSAL::import
34
35####################################################################################
36# Creating the file Upgrade.idt dynamically
37# Content:
38# UpgradeCode VersionMin VersionMax Language Attributes Remove ActionProperty
39####################################################################################
40
41sub create_upgrade_table
42
# spent 765µs (95+670) within installer::windows::upgrade::create_upgrade_table which was called: # once (95µs+670µs) by installer::run at line 1527 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer.pm
{
432494µs my ($basedir, $allvariableshashref) = @_;
44
45 my @upgradetable = ();
46
47 # fix for problematic OOo 1.9 versions
48 my $include_ooo_fix = 0;
49 my $ooomaxnew = "";
5019µs if (($installer::globals::product =~ /^\s*OpenOffice/i ) && ( ! ( $installer::globals::product =~ /SDK/i )) && ( ! $installer::globals::languagepack ) && ( ! $installer::globals::helppack ))
# spent 9µs making 1 call to installer::windows::upgrade::CORE:match
51 {
52 $include_ooo_fix = 1;
53 $ooomaxnew = "34.0.0";
54 }
55
56127µs installer::windows::idtglobal::write_idt_header(\@upgradetable, "upgrade");
# spent 27µs making 1 call to installer::windows::idtglobal::write_idt_header
57
58 # Setting also $installer::globals::msimajorproductversion, that is for example "3.0.0", to differ between old products for OOo 2.x and
59 # older products from OOo 3.x. The latter must be removed always, the removal of the first is controlled with a checkbox.
60 my $newline = $installer::globals::upgradecode . "\t" . "\t" . $installer::globals::msimajorproductversion . "\t" . "\t" . "0" . "\t" . "\t" . "OLDPRODUCTS" . "\n";
61 push(@upgradetable, $newline);
62
63 # Setting all products, that must be removed.
64 # $newline = $installer::globals::upgradecode . "\t" . $installer::globals::msimajorproductversion . "\t" . $installer::globals::msiproductversion . "\t" . "\t" . "257" . "\t" . "\t" . "OLDPRODUCTSSAMEMAJOR" . "\n";
65 $newline = $installer::globals::upgradecode . "\t" . $installer::globals::msimajorproductversion . "\t" . $installer::globals::msiproductversion . "\t" . "\t" . "769" . "\t" . "\t" . "OLDPRODUCTSSAMEMAJOR" . "\n";
66 push(@upgradetable, $newline);
67
68 if ( ! $installer::globals::patch )
69 {
70 # preventing downgrading
71 $newline = $installer::globals::upgradecode . "\t" . $installer::globals::msiproductversion . "\t" . $ooomaxnew . "\t" . "\t" . "2" . "\t" . "\t" . "NEWPRODUCTS" . "\n";
72 push(@upgradetable, $newline);
73
74 # $newline = $installer::globals::upgradecode . "\t" . $installer::globals::msiproductversion . "\t" . $ooomaxnew . "\t" . "\t" . "258" . "\t" . "\t" . "SAMEPRODUCTS" . "\n";
75 # push(@upgradetable, $newline);
76
77 if ( $include_ooo_fix )
78 {
79 $newline = $installer::globals::upgradecode . "\t" . "35.0.0" . "\t" . "36.0.0" . "\t" . "\t" . "1" . "\t" . "\t" . "OLDPRODUCTS2" . "\n";
80 push(@upgradetable, $newline);
81 }
82
83 # if (( $allvariableshashref->{'PATCHUPGRADECODE'} ) && ( ! $installer::globals::languagepack ))
84 # {
85 # $newline = $allvariableshashref->{'PATCHUPGRADECODE'} . "\t" . "\t" . $installer::globals::msiproductversion . "\t" . "\t" . "1" . "\t" . "\t" . "OLDPRODUCTSPATCH" . "\n";
86 # push(@upgradetable, $newline);
87 #
88 # $newline = $allvariableshashref->{'PATCHUPGRADECODE'} . "\t" . $installer::globals::msiproductversion . "\t" . "\t" . "\t" . "2" . "\t" . "\t" . "NEWPRODUCTSPATCH" . "\n";
89 # push(@upgradetable, $newline);
90 #
91 # $newline = $allvariableshashref->{'PATCHUPGRADECODE'} . "\t" . $installer::globals::msiproductversion . "\t" . "\t" . "\t" . "258" . "\t" . "\t" . "SAMEPRODUCTSPATCH" . "\n";
92 # push(@upgradetable, $newline);
93 # }
94
95 # also searching for the beta
96
97 if (( $allvariableshashref->{'BETAUPGRADECODE'} ) && ( ! $installer::globals::languagepack ) && ( ! $installer::globals::helppack ))
98 {
99 $newline = $allvariableshashref->{'BETAUPGRADECODE'} . "\t" . "1.0" . "\t" . "\t" . "\t" . "1" . "\t" . "\t" . "BETAPRODUCTS" . "\n";
100 push(@upgradetable, $newline);
101 }
102
103 # also searching for the stub
104
105 if (( $allvariableshashref->{'STUBUPGRADECODE'} ) && ( ! $installer::globals::languagepack ) && ( ! $installer::globals::helppack ))
106 {
107 $newline = $allvariableshashref->{'STUBUPGRADECODE'} . "\t" . "1.0" . "\t" . "\t" . "\t" . "1" . "\t" . "\t" . "STUBPRODUCTS" . "\n";
108 push(@upgradetable, $newline);
109 }
110
111 # searching for all older patches and languagepacks (defined in a extra file)
112
113 if (( $allvariableshashref->{'REMOVE_UPGRADE_CODE_FILE'} ) && ( ! $installer::globals::languagepack ) && ( ! $installer::globals::helppack ))
114 {
115 my $filename = $allvariableshashref->{'REMOVE_UPGRADE_CODE_FILE'};
116 my $langpackcodefilename = $installer::globals::idttemplatepath . $installer::globals::separator . $filename;
117 if ( ! -f $langpackcodefilename ) { installer::exiter::exit_program("ERROR: Could not find file \"$langpackcodefilename\".", "create_upgrade_table"); }
118
119 my $filecontent = installer::files::read_file($langpackcodefilename);
120 my $newlines = analyze_file_for_upgrade_table($filecontent);
121
122 for ( my $i = 0; $i <= $#{$newlines}; $i++ ) { push(@upgradetable, ${$newlines}[$i]); }
123 }
124 }
125
126 # No upgrade for Beta versions!
127
128 if (( $allvariableshashref->{'PRODUCTEXTENSION'} eq "Beta" ) && ( ! $installer::globals::patch ) && ( ! $installer::globals::languagepack ) && ( ! $installer::globals::helppack ))
129 {
130 @upgradetable = ();
131 installer::windows::idtglobal::write_idt_header(\@upgradetable, "upgrade");
132 my $infoline = "Beta product -> empty Upgrade table\n";
133 push(@installer::globals::logfileinfo, $infoline);
134 }
135
136 # Saving the file
137
138 my $upgradetablename = $basedir . $installer::globals::separator . "Upgrade.idt";
1391634µs installer::files::save_file($upgradetablename ,\@upgradetable);
# spent 634µs making 1 call to installer::files::save_file
140 my $infoline = "Created idt file: $upgradetablename\n";
141 push(@installer::globals::logfileinfo, $infoline);
142}
143
144##############################################################
145# Reading the file with UpgradeCodes of old products,
146# that can be removed, if the user wants to remove them.
147##############################################################
148
149sub analyze_file_for_upgrade_table
150{
151 my ($filecontent) = @_;
152
153 my @allnewlines = ();
154
155 for ( my $i = 0; $i <= $#{$filecontent}; $i++ )
156 {
157 my $line = ${$filecontent}[$i];
158 if ( $line =~ /^\s*$/ ) { next; } # empty lines can be ignored
159 if ( $line =~ /^\s*\#/ ) { next; } # comment lines starting with a hash
160
161 if ( $line =~ /^(.*)\t(.*)\t(.*)\t(.*)\t(.*)\t(.*)\t(.*)$/ ) { push(@allnewlines, $line); }
162 else { installer::exiter::exit_program("ERROR: Wrong syntax in file for upgrade table", "analyze_file_for_upgrade_table"); }
163 }
164
165 return \@allnewlines;
166}
167
16817µs1;
 
# spent 9µs within installer::windows::upgrade::CORE:match which was called: # once (9µs+0s) by installer::windows::upgrade::create_upgrade_table at line 50
sub installer::windows::upgrade::CORE:match; # opcode