2 # This file is part of the LibreOffice project.
4 # This Source Code Form is subject to the terms of the Mozilla Public
5 # License, v. 2.0. If a copy of the MPL was not distributed with this
6 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 # This file incorporates work covered by the following license notice:
10 # Licensed to the Apache Software Foundation (ASF) under one or more
11 # contributor license agreements. See the NOTICE file distributed
12 # with this work for additional information regarding copyright
13 # ownership. The ASF licenses this file to you under the Apache
14 # License, Version 2.0 (the "License"); you may not use this file
15 # except in compliance with the License. You may obtain a copy of
16 # the License at http://www.apache.org/licenses/LICENSE-2.0 .
19 package installer
::copyproject
;
24 use installer
::control
;
25 use installer
::converter
;
27 use installer
::globals
;
28 use installer
::logger
;
29 use installer
::systemactions
;
30 use installer
::worker
;
32 ####################################################
33 # Including header files into the logfile
34 ####################################################
38 my ( $filesref, $scpactionsref, $loggingdir, $languagestringref, $shipinstalldir, $allsettingsarrayref ) = @_;
40 # Creating directories
42 installer
::logger
::include_header_into_logfile
("Creating installation directory");
44 my $current_install_number = "";
46 my $installdir = installer
::worker
::create_installation_directory
($shipinstalldir, $languagestringref, \
$current_install_number);
48 my $installlogdir = installer
::systemactions
::create_directory_next_to_directory
($installdir, "log");
50 # Copy files and ScpActions
52 installer
::logger
::include_header_into_logfile
("Copying files:");
56 for ( my $i = 0; $i <= $#{$filesref}; $i++ )
58 my $onefile = ${$filesref}[$i];
60 my $source = $onefile->{'sourcepath'};
61 my $destination = $installdir . $installer::globals
::separator
. $onefile->{'Name'};
63 installer
::systemactions
::copy_one_file
($source, $destination);
65 if ( $onefile->{'UnixRights'} )
67 chmod oct($onefile->{'UnixRights'}), $destination;
69 elsif ( $destination =~ /install\s*$/ )
71 chmod 0775, $destination;
77 for ( my $i = 0; $i <= $#{$scpactionsref}; $i++ )
79 my $onefile = ${$scpactionsref}[$i];
81 my $source = $onefile->{'sourcepath'};
82 my $destination = $installdir . $installer::globals
::separator
. $onefile->{'DestinationName'};
84 installer
::systemactions
::copy_one_file
($source, $destination);
86 if ( $onefile->{'UnixRights'} )
88 chmod oct($onefile->{'UnixRights'}), $destination;
90 elsif ( $destination =~ /install\s*$/ )
92 chmod 0775, $destination;
96 # Analyzing the log file
98 installer
::worker
::analyze_and_save_logfile
($loggingdir, $installdir, $installlogdir, $allsettingsarrayref, $languagestringref, $current_install_number);