component.pm (677600b0) component.pm (d62abd1a)
1#**************************************************************
2#
3# Licensed to the Apache Software Foundation (ASF) under one
4# or more contributor license agreements. See the NOTICE file
5# distributed with this work for additional information
6# regarding copyright ownership. The ASF licenses this file
7# to you under the Apache License, Version 2.0 (the
8# "License"); you may not use this file except in compliance

--- 90 unchanged lines hidden (view full) ---

99
100
101
102
103sub get_file_component_directory_for_file ($$)
104{
105 my ($onefile, $dirref) = @_;
106
1#**************************************************************
2#
3# Licensed to the Apache Software Foundation (ASF) under one
4# or more contributor license agreements. See the NOTICE file
5# distributed with this work for additional information
6# regarding copyright ownership. The ASF licenses this file
7# to you under the Apache License, Version 2.0 (the
8# "License"); you may not use this file except in compliance

--- 90 unchanged lines hidden (view full) ---

99
100
101
102
103sub get_file_component_directory_for_file ($$)
104{
105 my ($onefile, $dirref) = @_;
106
107 my $localstyles = $onefile->{'Styles'} // "";
108
109 if ( $localstyles =~ /\bFONT\b/ ) # special handling for font files
110 {
111 return $installer::globals::fontsfolder;
112 }
113
114 my $destdir = "";
115
116 if ( $onefile->{'Dir'} ) { $destdir = $onefile->{'Dir'}; }
107 my $localstyles = $onefile->{'Styles'};
108 $localstyles = "" unless defined $localstyles;
109
110 if ( $localstyles =~ /\bFONT\b/ ) # special handling for font files
111 {
112 return $installer::globals::fontsfolder;
113 }
114
115 my $destdir = "";
116
117 if ( $onefile->{'Dir'} ) { $destdir = $onefile->{'Dir'}; }
117
118
118 if ( $destdir =~ /\bPREDEFINED_OSSHELLNEWDIR\b/ ) # special handling for shellnew files
119 {
120 return $installer::globals::templatefolder;
121 }
119 if ( $destdir =~ /\bPREDEFINED_OSSHELLNEWDIR\b/ ) # special handling for shellnew files
120 {
121 return $installer::globals::templatefolder;
122 }
122
123
123 my $destination = $onefile->{'destination'};
124
125 installer::pathanalyzer::get_path_from_fullqualifiedname(\$destination);
124 my $destination = $onefile->{'destination'};
125
126 installer::pathanalyzer::get_path_from_fullqualifiedname(\$destination);
126
127
127 $destination =~ s/\Q$installer::globals::separator\E\s*$//;
128 $destination =~ s/\Q$installer::globals::separator\E\s*$//;
128
129
129 # This path has to be defined in the directory collection at "HostName"
130 # This path has to be defined in the directory collection at "HostName"
130
131 my $uniquedir = undef;
131
132 my $uniquedir = undef;
132 if ($destination eq "") # files in the installation root
133 {
134 $uniquedir = "INSTALLLOCATION";
135 }
136 else
137 {
138 my $found = 0;
133 if ($destination eq "") # files in the installation root
134 {
135 $uniquedir = "INSTALLLOCATION";
136 }
137 else
138 {
139 my $found = 0;
139 foreach my $directory (@$dirref)
140 foreach my $directory (@$dirref)
140 {
141 if ($directory->{'HostName'} eq $destination)
142 {
143 $found = 1;
141 {
142 if ($directory->{'HostName'} eq $destination)
143 {
144 $found = 1;
144 $uniquedir = $directory->{'uniquename'};
145 $uniquedir = $directory->{'uniquename'};
145 last;
146 }
147 }
146 last;
147 }
148 }
148
149
149 if ( ! $found)
150 {
151 installer::exiter::exit_program(
150 if ( ! $found)
151 {
152 installer::exiter::exit_program(
152 "ERROR: Did not find destination $destination in directory collection",
153 "get_file_component_directory");
153 "ERROR: Did not find destination $destination in directory collection",
154 "get_file_component_directory");
154 }
155 }
155
156
156 if ( $uniquedir eq $installer::globals::officeinstalldirectory )
157 {
158 $uniquedir = "INSTALLLOCATION";
159 }
157 if ( $uniquedir eq $installer::globals::officeinstalldirectory )
158 {
159 $uniquedir = "INSTALLLOCATION";
160 }
160 }
161 }
161
162
162 $onefile->{'uniquedirname'} = $uniquedir; # saving it in the file collection
163 $onefile->{'uniquedirname'} = $uniquedir; # saving it in the file collection
163
164
164 return $uniquedir
165 return $uniquedir
165}
166
167##############################################################
168# Returning the directory for a registry component.
169# This cannot be a useful value
170##############################################################
171
172sub get_registry_component_directory

--- 579 unchanged lines hidden ---
166}
167
168##############################################################
169# Returning the directory for a registry component.
170# This cannot be a useful value
171##############################################################
172
173sub get_registry_component_directory

--- 579 unchanged lines hidden ---