file.pm (cdf0e10c) | file.pm (19d58b3a) |
---|---|
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# --- 23 unchanged lines hidden (view full) --- 32use installer::exiter; 33use installer::files; 34use installer::globals; 35use installer::logger; 36use installer::pathanalyzer; 37use installer::worker; 38use installer::windows::font; 39use installer::windows::idtglobal; | 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# --- 23 unchanged lines hidden (view full) --- 32use installer::exiter; 33use installer::files; 34use installer::globals; 35use installer::logger; 36use installer::pathanalyzer; 37use installer::worker; 38use installer::windows::font; 39use installer::windows::idtglobal; |
40use installer::windows::msiglobal; |
|
40use installer::windows::language; 41 42########################################################################## 43# Assigning one cabinet file to each file. This is requrired, 44# if cabinet files shall be equivalent to packages. 45########################################################################## 46 47sub assign_cab_to_files --- 126 unchanged lines hidden (view full) --- 174# Create a shorter version of a long component name, 175# because maximum length in msi database is 72. 176# Attention: In multi msi installation sets, the short 177# names have to be unique over all packages, because 178# this string is used to create the globally unique id 179# -> no resetting of 180# %installer::globals::allshortcomponents 181# after a package was created. | 41use installer::windows::language; 42 43########################################################################## 44# Assigning one cabinet file to each file. This is requrired, 45# if cabinet files shall be equivalent to packages. 46########################################################################## 47 48sub assign_cab_to_files --- 126 unchanged lines hidden (view full) --- 175# Create a shorter version of a long component name, 176# because maximum length in msi database is 72. 177# Attention: In multi msi installation sets, the short 178# names have to be unique over all packages, because 179# this string is used to create the globally unique id 180# -> no resetting of 181# %installer::globals::allshortcomponents 182# after a package was created. |
183# Using no counter because of reproducibility. |
|
182######################################################### 183 184sub generate_new_short_componentname 185{ 186 my ($componentname) = @_; 187 | 184######################################################### 185 186sub generate_new_short_componentname 187{ 188 my ($componentname) = @_; 189 |
188 my $shortcomponentname = ""; 189 my $counter = 1; 190 | |
191 my $startversion = substr($componentname, 0, 60); # taking only the first 60 characters | 190 my $startversion = substr($componentname, 0, 60); # taking only the first 60 characters |
192 $startversion = $startversion . "_"; | 191 my $subid = installer::windows::msiglobal::calculate_id($componentname, 9); # taking only the first 9 digits 192 my $shortcomponentname = $startversion . "_" . $subid; |
193 | 193 |
194 $shortcomponentname = $startversion . $counter; 195 196 while ( exists($installer::globals::allshortcomponents{$shortcomponentname}) ) 197 { 198 $counter++; 199 $shortcomponentname = $startversion . $counter; 200 } | 194 if ( exists($installer::globals::allshortcomponents{$shortcomponentname}) ) { installer::exiter::exit_program("Failed to create unique component name: \"$shortcomponentname\"", "generate_new_short_componentname"); } |
201 202 $installer::globals::allshortcomponents{$shortcomponentname} = 1; 203 204 return $shortcomponentname; 205} 206 207############################################### 208# Generating the component name from a file --- 68 unchanged lines hidden (view full) --- 277 } 278 279 if ( exists($installer::globals::allcomponents{$fullname}) ) 280 { 281 $componentname = $installer::globals::allcomponents{$fullname}; 282 } 283 else 284 { | 195 196 $installer::globals::allshortcomponents{$shortcomponentname} = 1; 197 198 return $shortcomponentname; 199} 200 201############################################### 202# Generating the component name from a file --- 68 unchanged lines hidden (view full) --- 271 } 272 273 if ( exists($installer::globals::allcomponents{$fullname}) ) 274 { 275 $componentname = $installer::globals::allcomponents{$fullname}; 276 } 277 else 278 { |
285 if ( length($componentname) > 60 ) | 279 if ( length($componentname) > 70 ) |
286 { | 280 { |
287 # Using md5sum needs much time 288 # chomp(my $shorter = `echo $componentname | md5sum | sed -e "s/ .*//g"`); 289 # $componentname = "comp_$shorter"; | |
290 $componentname = generate_new_short_componentname($componentname); # This has to be unique for the complete product, not only one package 291 } 292 293 $installer::globals::allcomponents{$fullname} = $componentname; 294 $installer::globals::allcomponents_in_this_database{$fullname} = 1; 295 } 296 297 # $componentname =~ s/gid_file_/g_f_/g; --- 778 unchanged lines hidden --- | 281 $componentname = generate_new_short_componentname($componentname); # This has to be unique for the complete product, not only one package 282 } 283 284 $installer::globals::allcomponents{$fullname} = $componentname; 285 $installer::globals::allcomponents_in_this_database{$fullname} = 1; 286 } 287 288 # $componentname =~ s/gid_file_/g_f_/g; --- 778 unchanged lines hidden --- |