Filename | /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer/windows/upgrade.pm |
Statements | Executed 33 statements in 1.91ms |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
1 | 1 | 1 | 384µs | 387µs | BEGIN@30 | installer::windows::upgrade::
1 | 1 | 1 | 95µs | 765µs | create_upgrade_table | installer::windows::upgrade::
1 | 1 | 1 | 18µs | 21µs | BEGIN@31 | installer::windows::upgrade::
1 | 1 | 1 | 16µs | 18µs | BEGIN@33 | installer::windows::upgrade::
1 | 1 | 1 | 16µs | 18µs | BEGIN@32 | installer::windows::upgrade::
1 | 1 | 1 | 9µs | 9µs | CORE:match (opcode) | installer::windows::upgrade::
0 | 0 | 0 | 0s | 0s | analyze_file_for_upgrade_table | installer::windows::upgrade::
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::upgrade; | ||||
29 | |||||
30 | 2 | 67µs | 2 | 391µ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 # spent 387µs making 1 call to installer::windows::upgrade::BEGIN@30
# spent 4µs making 1 call to UNIVERSAL::import |
31 | 2 | 57µs | 2 | 23µ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 # spent 21µs making 1 call to installer::windows::upgrade::BEGIN@31
# spent 3µs making 1 call to UNIVERSAL::import |
32 | 2 | 55µs | 2 | 21µ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 # spent 18µs making 1 call to installer::windows::upgrade::BEGIN@32
# spent 3µs making 1 call to UNIVERSAL::import |
33 | 2 | 1.63ms | 2 | 20µ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 # 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 | |||||
41 | sub 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 | ||||
43 | 24 | 94µ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 = ""; | ||||
50 | 1 | 9µ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 | |||||
56 | 1 | 27µ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"; | ||||
139 | 1 | 634µ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 | |||||
149 | sub 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 | |||||
168 | 1 | 7µs | 1; | ||
# 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 |