diff options
author | Oliver Bolte <obo@openoffice.org> | 2008-07-25 10:52:08 +0000 |
---|---|---|
committer | Oliver Bolte <obo@openoffice.org> | 2008-07-25 10:52:08 +0000 |
commit | 66cc159985778f55572a380ab95ef7d9d7cc4bb7 (patch) | |
tree | fae1a8753015b4c3e21598162b1b2e86d0b76377 /solenv/bin/modules/installer/worker.pm | |
parent | 9802ee93a64976dec82293fe2d240a1a6a5c968b (diff) |
INTEGRATION: CWS socs17 (1.64.18); FILE MERGED
2008/07/22 13:58:46 tkr 1.64.18.1: #158228# license text added
Diffstat (limited to 'solenv/bin/modules/installer/worker.pm')
-rw-r--r-- | solenv/bin/modules/installer/worker.pm | 35 |
1 files changed, 34 insertions, 1 deletions
diff --git a/solenv/bin/modules/installer/worker.pm b/solenv/bin/modules/installer/worker.pm index fa474a41e6b0..3cfc2bbfd127 100644 --- a/solenv/bin/modules/installer/worker.pm +++ b/solenv/bin/modules/installer/worker.pm @@ -8,7 +8,7 @@ # # $RCSfile: worker.pm,v $ # -# $Revision: 1.64 $ +# $Revision: 1.65 $ # # This file is part of OpenOffice.org. # @@ -2958,4 +2958,37 @@ sub set_spellcheckerlanguages push( @installer::globals::globallogfileinfo, $infoline); } +################################################ +# Including a license text into setup script +################################################ + +sub put_license_into_setup +{ + my ($installdir, $includepatharrayref) = @_; + + # find and read english license file + my $licenselanguage = "en-US"; # always english ! + my $licensefilename = "LICENSE_" . $licenselanguage; + my $licenseincludepatharrayref = get_language_specific_include_pathes($includepatharrayref, $licenselanguage); + + my $licenseref = installer::scriptitems::get_sourcepath_from_filename_and_includepath(\$licensefilename, $licenseincludepatharrayref, 0); + if ($$licenseref eq "") { installer::exiter::exit_program("ERROR: Could not find License file $licensefilename!", "put_license_into_setup"); } + my $licensefile = installer::files::read_file($$licenseref); + + # Read setup + my $setupfilename = $installdir . $installer::globals::separator . "setup"; + my $setupfile = installer::files::read_file($setupfilename); + + # Replacement + my $infoline = "Adding licensefile into setup script\n"; + push( @installer::globals::logfileinfo, $infoline); + + my $includestring = ""; + for ( my $i = 0; $i <= $#{$licensefile}; $i++ ) { $includestring = $includestring . ${$licensefile}[$i]; } + for ( my $i = 0; $i <= $#{$setupfile}; $i++ ) { ${$setupfile}[$i] =~ s/LICENSEFILEPLACEHOLDER/$includestring/; } + + # Write setup + installer::files::save_file($setupfilename, $setupfile); +} + 1; |