diff options
author | Ivo Hinkelmann <ihi@openoffice.org> | 2008-07-16 15:04:42 +0000 |
---|---|---|
committer | Ivo Hinkelmann <ihi@openoffice.org> | 2008-07-16 15:04:42 +0000 |
commit | 5a43b402aff0c7d4ebae2b9d8abb2cdaf9f4f0a0 (patch) | |
tree | c662e36f7854956f608c47aaaf2c5de0bd0f863d /solenv/bin/modules/installer/scpzipfiles.pm | |
parent | 4d700f95b9e092cf115680f84755ba6325b24ead (diff) |
INTEGRATION: CWS sysui26 (1.14.52); FILE MERGED
2008/06/22 19:35:40 obr 1.14.52.1: #i90155# initial support for renaming files during packaging process
Diffstat (limited to 'solenv/bin/modules/installer/scpzipfiles.pm')
-rw-r--r-- | solenv/bin/modules/installer/scpzipfiles.pm | 77 |
1 files changed, 31 insertions, 46 deletions
diff --git a/solenv/bin/modules/installer/scpzipfiles.pm b/solenv/bin/modules/installer/scpzipfiles.pm index 9de1fca67b06..f5a242b5ff0a 100644 --- a/solenv/bin/modules/installer/scpzipfiles.pm +++ b/solenv/bin/modules/installer/scpzipfiles.pm @@ -8,7 +8,7 @@ # # $RCSfile: scpzipfiles.pm,v $ # -# $Revision: 1.14 $ +# $Revision: 1.15 $ # # This file is part of OpenOffice.org. # @@ -140,62 +140,47 @@ sub resolving_scpzip_replace_flag my $replacedir = $replacedirbase . $installer::globals::separator . $onelanguage . $installer::globals::separator; installer::systemactions::create_directory($replacedir); # creating language specific directories - if (!( $styles =~ /\bARCHIVE\b/ )) # The simple case - { - # copy files and edit them with the variables defined in the zip.lst - - my $longfilename = 0; - - my $onefilename = $onefile->{'Name'}; - my $sourcepath = $onefile->{'sourcepath'}; + # copy files and edit them with the variables defined in the zip.lst - if ( $onefilename =~ /^\s*\Q$installer::globals::separator\E/ ) # filename begins with a slash, for instance /registry/schema/org/openoffice/VCL.xcs - { - $onefilename =~ s/^\s*\Q$installer::globals::separator\E//; - $longfilename = 1; - } + my $longfilename = 0; - my $destinationpath = $replacedir . $onefilename; - my $movepath = $destinationpath . ".orig"; + my $onefilename = $onefile->{'Name'}; + my $sourcepath = $onefile->{'sourcepath'}; - if ( $longfilename ) # the destination directory has to be created before copying - { - my $destdir = $movepath; - installer::pathanalyzer::get_path_from_fullqualifiedname(\$destdir); - installer::systemactions::create_directory_structure($destdir); - } + if ( $onefilename =~ /^\s*\Q$installer::globals::separator\E/ ) # filename begins with a slash, for instance /registry/schema/org/openoffice/VCL.xcs + { + $onefilename =~ s/^\s*\Q$installer::globals::separator\E//; + $longfilename = 1; + } - my $copysuccess = installer::systemactions::copy_one_file($sourcepath, $movepath); + my $destinationpath = $replacedir . $onefilename; + my $movepath = $destinationpath . ".orig"; - if ( $copysuccess ) - { - # Now the file can be edited - # ToDo: How about binary patching? + if ( $longfilename ) # the destination directory has to be created before copying + { + my $destdir = $movepath; + installer::pathanalyzer::get_path_from_fullqualifiedname(\$destdir); + installer::systemactions::create_directory_structure($destdir); + } - my $onefileref = installer::files::read_file($movepath); - replace_all_ziplistvariables_in_file($onefileref, $variableshashref); - installer::files::save_file($destinationpath ,$onefileref); - } + my $copysuccess = installer::systemactions::copy_one_file($sourcepath, $movepath); - # Saving the original source, where the file was found - $onefile->{'originalsourcepath'} = $onefile->{'sourcepath'}; + if ( $copysuccess ) + { + # Now the file can be edited + # ToDo: How about binary patching? - # Saving the original source, where the file was found - $onefile->{'originalsourcepath'} = $onefile->{'sourcepath'}; + my $onefileref = installer::files::read_file($movepath); + replace_all_ziplistvariables_in_file($onefileref, $variableshashref); + installer::files::save_file($destinationpath ,$onefileref); + } - # Saving the original source, where the file was found - $onefile->{'originalsourcepath'} = $onefile->{'sourcepath'}; + # Saving the original source, where the file was found + $onefile->{'originalsourcepath'} = $onefile->{'sourcepath'}; - # Writing the new sourcepath into the hashref, even if it was no copied + # Writing the new sourcepath into the hashref, even if it was no copied - $onefile->{'sourcepath'} = $destinationpath; - } - else - { - # ToDo: How about SCPZIP_REPLACE and ARCHIVE? - # Requires that the zip file was unpacked in resolving_archive_flag - # and that $installer::globals::dounzip is set (Parameter -unzip). - } + $onefile->{'sourcepath'} = $destinationpath; } } |