scriptitems.pm (a91987c1) scriptitems.pm (dba1a2e4)
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

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

32use installer::pathanalyzer;
33use installer::remover;
34use installer::systemactions;
35
36use File::Spec;
37use SvnRevision;
38use ExtensionsLst;
39
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

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

32use installer::pathanalyzer;
33use installer::remover;
34use installer::systemactions;
35
36use File::Spec;
37use SvnRevision;
38use ExtensionsLst;
39
40use strict;
41
40################################################################
41# Resolving the GID for the directories defined in setup script
42################################################################
43
44sub resolve_all_directory_names
45{
46 my ($directoryarrayref) = @_;
47
42################################################################
43# Resolving the GID for the directories defined in setup script
44################################################################
45
46sub resolve_all_directory_names
47{
48 my ($directoryarrayref) = @_;
49
48 if ( $installer::globals::debug ) { installer::logger::debuginfo("installer::scriptitems::resolve_all_directory_names : $#{$directoryarrayref}"); }
49
50 # After this procedure the hash shall contain the complete language
51 # dependent path, not only the language dependent HostName.
52
53 my ($key, $value, $parentvalue, $parentgid, $parentdirectoryhashref);
54
55 for ( my $i = 0; $i <= $#{$directoryarrayref}; $i++ )
56 {
57 my $directoryhashref = ${$directoryarrayref}[$i];

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

155#############################################################################
156# Files with flag DELETE_ONLY do not need to be packed into installation set
157#############################################################################
158
159sub remove_delete_only_files_from_productlists
160{
161 my ($productarrayref) = @_;
162
50 # After this procedure the hash shall contain the complete language
51 # dependent path, not only the language dependent HostName.
52
53 my ($key, $value, $parentvalue, $parentgid, $parentdirectoryhashref);
54
55 for ( my $i = 0; $i <= $#{$directoryarrayref}; $i++ )
56 {
57 my $directoryhashref = ${$directoryarrayref}[$i];

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

155#############################################################################
156# Files with flag DELETE_ONLY do not need to be packed into installation set
157#############################################################################
158
159sub remove_delete_only_files_from_productlists
160{
161 my ($productarrayref) = @_;
162
163 if ( $installer::globals::debug ) { installer::logger::debuginfo("installer::scriptitems::remove_delete_only_files_from_productlists : $#{$productarrayref}"); }
164
165 my @newitems = ();
166
167 for ( my $i = 0; $i <= $#{$productarrayref}; $i++ )
168 {
169 my $oneitem = ${$productarrayref}[$i];
170 my $styles = "";
171
172 if ( $oneitem->{'Styles'} ) { $styles = $oneitem->{'Styles'}; }

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

184# Files with flag NOT_IN_SUITE do not need to be packed into
185# Suite installation sets
186#############################################################################
187
188sub remove_notinsuite_files_from_productlists
189{
190 my ($productarrayref) = @_;
191
163 my @newitems = ();
164
165 for ( my $i = 0; $i <= $#{$productarrayref}; $i++ )
166 {
167 my $oneitem = ${$productarrayref}[$i];
168 my $styles = "";
169
170 if ( $oneitem->{'Styles'} ) { $styles = $oneitem->{'Styles'}; }

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

182# Files with flag NOT_IN_SUITE do not need to be packed into
183# Suite installation sets
184#############################################################################
185
186sub remove_notinsuite_files_from_productlists
187{
188 my ($productarrayref) = @_;
189
192 if ( $installer::globals::debug ) { installer::logger::debuginfo("installer::scriptitems::remove_notinsuite_files_from_productlists : $#{$productarrayref}"); }
193
194 my @newitems = ();
195
196 for ( my $i = 0; $i <= $#{$productarrayref}; $i++ )
197 {
198 my $oneitem = ${$productarrayref}[$i];
199 my $styles = "";
200
201 if ( $oneitem->{'Styles'} ) { $styles = $oneitem->{'Styles'}; }

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

218# Files with flag NOT_IN_SUITE do not need to be packed into
219# Suite installation sets
220#############################################################################
221
222sub remove_office_start_language_files
223{
224 my ($productarrayref) = @_;
225
190 my @newitems = ();
191
192 for ( my $i = 0; $i <= $#{$productarrayref}; $i++ )
193 {
194 my $oneitem = ${$productarrayref}[$i];
195 my $styles = "";
196
197 if ( $oneitem->{'Styles'} ) { $styles = $oneitem->{'Styles'}; }

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

214# Files with flag NOT_IN_SUITE do not need to be packed into
215# Suite installation sets
216#############################################################################
217
218sub remove_office_start_language_files
219{
220 my ($productarrayref) = @_;
221
226 if ( $installer::globals::debug ) { installer::logger::debuginfo("installer::scriptitems::remove_notinsuite_files_from_productlists : $#{$productarrayref}"); }
227
228 my @newitems = ();
229
230 for ( my $i = 0; $i <= $#{$productarrayref}; $i++ )
231 {
232 my $oneitem = ${$productarrayref}[$i];
233 my $styles = "";
234
235 if ( $oneitem->{'Styles'} ) { $styles = $oneitem->{'Styles'}; }

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

252#############################################################################
253# Registryitems for Uninstall have to be removed
254#############################################################################
255
256sub remove_uninstall_regitems_from_script
257{
258 my ($registryarrayref) = @_;
259
222 my @newitems = ();
223
224 for ( my $i = 0; $i <= $#{$productarrayref}; $i++ )
225 {
226 my $oneitem = ${$productarrayref}[$i];
227 my $styles = "";
228
229 if ( $oneitem->{'Styles'} ) { $styles = $oneitem->{'Styles'}; }

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

246#############################################################################
247# Registryitems for Uninstall have to be removed
248#############################################################################
249
250sub remove_uninstall_regitems_from_script
251{
252 my ($registryarrayref) = @_;
253
260 if ( $installer::globals::debug ) { installer::logger::debuginfo("installer::scriptitems::remove_uninstall_regitems_from_script : $#{$registryarrayref}"); }
261
262 my @newitems = ();
263
264 for ( my $i = 0; $i <= $#{$registryarrayref}; $i++ )
265 {
266 my $oneitem = ${$registryarrayref}[$i];
267 my $subkey = "";
268
269 if ( $oneitem->{'Subkey'} ) { $subkey = $oneitem->{'Subkey'}; }

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

305##############################################################################
306# Removing all items in product lists which do not have the correct languages
307##############################################################################
308
309sub resolving_all_languages_in_productlists
310{
311 my ($productarrayref, $languagesarrayref) = @_;
312
254 my @newitems = ();
255
256 for ( my $i = 0; $i <= $#{$registryarrayref}; $i++ )
257 {
258 my $oneitem = ${$registryarrayref}[$i];
259 my $subkey = "";
260
261 if ( $oneitem->{'Subkey'} ) { $subkey = $oneitem->{'Subkey'}; }

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

297##############################################################################
298# Removing all items in product lists which do not have the correct languages
299##############################################################################
300
301sub resolving_all_languages_in_productlists
302{
303 my ($productarrayref, $languagesarrayref) = @_;
304
313 if ( $installer::globals::debug ) { installer::logger::debuginfo("installer::scriptitems::resolving_all_languages_in_productlists : $#{$productarrayref} : $#{$languagesarrayref}"); }
314
315 my @itemsinalllanguages = ();
316
317 my ($key, $value);
318
319 for ( my $i = 0; $i <= $#{$productarrayref}; $i++ )
320 {
321 my $oneitem = ${$productarrayref}[$i];
322

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

889################################################################################
890# Simplifying the name for language dependent items from "Name (xy)" to "Name"
891################################################################################
892
893sub changing_name_of_language_dependent_keys
894{
895 my ($itemsarrayref) = @_;
896
305 my @itemsinalllanguages = ();
306
307 my ($key, $value);
308
309 for ( my $i = 0; $i <= $#{$productarrayref}; $i++ )
310 {
311 my $oneitem = ${$productarrayref}[$i];
312

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

879################################################################################
880# Simplifying the name for language dependent items from "Name (xy)" to "Name"
881################################################################################
882
883sub changing_name_of_language_dependent_keys
884{
885 my ($itemsarrayref) = @_;
886
897 if ( $installer::globals::debug ) { installer::logger::debuginfo("installer::scriptitems::changing_name_of_language_dependent_keys : $#{$itemsarrayref}"); }
898
899 # Changing key for multilingual items from "Name ( )" to "Name" or "HostName ( )" to "HostName"
900
901 for ( my $i = 0; $i <= $#{$itemsarrayref}; $i++ )
902 {
903 my $oneitem = ${$itemsarrayref}[$i];
904 my $onelanguage = $oneitem->{'specificlanguage'};
905
906 if (!($onelanguage eq "" )) # language dependent item

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

957# Replacement of setup variables in ConfigurationItems and ProfileItems
958# <productkey>, <buildid>, <sequence_languages>, <productcode>, <upgradecode>, <productupdate>
959################################################################################
960
961sub replace_setup_variables
962{
963 my ($itemsarrayref, $languagestringref, $hashref) = @_;
964
887 # Changing key for multilingual items from "Name ( )" to "Name" or "HostName ( )" to "HostName"
888
889 for ( my $i = 0; $i <= $#{$itemsarrayref}; $i++ )
890 {
891 my $oneitem = ${$itemsarrayref}[$i];
892 my $onelanguage = $oneitem->{'specificlanguage'};
893
894 if (!($onelanguage eq "" )) # language dependent item

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

945# Replacement of setup variables in ConfigurationItems and ProfileItems
946# <productkey>, <buildid>, <sequence_languages>, <productcode>, <upgradecode>, <productupdate>
947################################################################################
948
949sub replace_setup_variables
950{
951 my ($itemsarrayref, $languagestringref, $hashref) = @_;
952
965 if ( $installer::globals::debug ) { installer::logger::debuginfo("installer::scriptitems::replace_setup_variables : $#{$itemsarrayref} : $$languagestringref : $hashref->{'PRODUCTNAME'}"); }
966
967 my $languagesstring = $$languagestringref;
968 $languagesstring =~ s/\_/ /g; # replacing underscore with whitespace
969 # $languagesstring is "01 49" instead of "en-US de"
970 installer::languages::fake_languagesstring(\$languagesstring);
971
972 my $productname = $hashref->{'PRODUCTNAME'};
973 my $productversion = $hashref->{'PRODUCTVERSION'};
974 my $userdirproductversion = "";

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

1022 }
1023}
1024
1025################################################################################
1026# By defining variable LOCALUSERDIR in *.lst it is possible to change
1027# the standard destination of user directory defined in scp2 ($SYSUSERCONFIG).
1028################################################################################
1029
953 my $languagesstring = $$languagestringref;
954 $languagesstring =~ s/\_/ /g; # replacing underscore with whitespace
955 # $languagesstring is "01 49" instead of "en-US de"
956 installer::languages::fake_languagesstring(\$languagesstring);
957
958 my $productname = $hashref->{'PRODUCTNAME'};
959 my $productversion = $hashref->{'PRODUCTVERSION'};
960 my $userdirproductversion = "";

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

1008 }
1009}
1010
1011################################################################################
1012# By defining variable LOCALUSERDIR in *.lst it is possible to change
1013# the standard destination of user directory defined in scp2 ($SYSUSERCONFIG).
1014################################################################################
1015
1030sub replace_userdir_variable
1016sub replace_userdir_variable ($$)
1031{
1017{
1032 my ($itemsarrayref) = @_;
1018 my ($itemsarrayref, $allvariableshashref) = @_;
1033
1034 my $userdir = "";
1019
1020 my $userdir = "";
1035 if ( $allvariableshashref->{'LOCALUSERDIR'} ) { $userdir = $allvariableshashref->{'LOCALUSERDIR'}; }
1036 else { $userdir = $installer::globals::simpledefaultuserdir; }
1021 if ($allvariableshashref->{'LOCALUSERDIR'})
1022 {
1023 $userdir = $allvariableshashref->{'LOCALUSERDIR'};
1024 }
1025 else
1026 {
1027 $userdir = $installer::globals::simpledefaultuserdir;
1028 }
1037
1029
1038 if ( $userdir ne "" )
1030 if ($userdir ne "")
1039 {
1031 {
1040 for ( my $i = 0; $i <= $#{$itemsarrayref}; $i++ )
1032 foreach my $oneitem (@$itemsarrayref)
1041 {
1033 {
1042 my $oneitem = ${$itemsarrayref}[$i];
1043 $oneitem->{'Value'} =~ s/\$SYSUSERCONFIG/$userdir/;
1044 }
1045 }
1046}
1047
1048#####################################################################################
1049# Files and ConfigurationItems are not included for all languages.
1050# For instance asian fonts. These can be removed, if no "Name" is found.
1051# ConfigurationItems are not always defined in the linguistic configuration file.
1052# The "Key" cannot be found for them.
1053#####################################################################################
1054
1055sub remove_non_existent_languages_in_productlists
1056{
1057 my ($itemsarrayref, $languagestringref, $searchkey, $itemtype) = @_;
1058
1034 $oneitem->{'Value'} =~ s/\$SYSUSERCONFIG/$userdir/;
1035 }
1036 }
1037}
1038
1039#####################################################################################
1040# Files and ConfigurationItems are not included for all languages.
1041# For instance asian fonts. These can be removed, if no "Name" is found.
1042# ConfigurationItems are not always defined in the linguistic configuration file.
1043# The "Key" cannot be found for them.
1044#####################################################################################
1045
1046sub remove_non_existent_languages_in_productlists
1047{
1048 my ($itemsarrayref, $languagestringref, $searchkey, $itemtype) = @_;
1049
1059 if ( $installer::globals::debug ) { installer::logger::debuginfo("installer::scriptitems::remove_non_existent_languages_in_productlists : $#{$itemsarrayref} : $$languagestringref : $searchkey : $itemtype"); }
1060
1061 # Removing of all non existent files, for instance asian fonts
1062
1063 installer::logger::include_header_into_logfile("Removing for this language $$languagestringref:");
1064
1065 my @allexistentitems = ();
1066
1067 my $infoline;
1068

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

1100########################################################################
1101# Input is the directory gid, output the "HostName" of the directory
1102########################################################################
1103
1104sub get_Directoryname_From_Directorygid
1105{
1106 my ($dirsarrayref ,$searchgid, $onelanguage, $oneitemgid) = @_;
1107
1050 # Removing of all non existent files, for instance asian fonts
1051
1052 installer::logger::include_header_into_logfile("Removing for this language $$languagestringref:");
1053
1054 my @allexistentitems = ();
1055
1056 my $infoline;
1057

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

1089########################################################################
1090# Input is the directory gid, output the "HostName" of the directory
1091########################################################################
1092
1093sub get_Directoryname_From_Directorygid
1094{
1095 my ($dirsarrayref ,$searchgid, $onelanguage, $oneitemgid) = @_;
1096
1108 if ( $installer::globals::debug ) { installer::logger::debuginfo("installer::scriptitems::get_Directoryname_From_Directorygid : $#{$dirsarrayref} : $searchgid : $onelanguage"); }
1109
1110 my $directoryname = "";
1111 my $onedirectory;
1112 my $foundgid = 0;
1113
1114 for ( my $i = 0; $i <= $#{$dirsarrayref}; $i++ )
1115 {
1116 $onedirectory = ${$dirsarrayref}[$i];
1117 my $directorygid = $onedirectory->{'gid'};

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

1153##################################################################
1154# Getting destination directory for links, files and profiles
1155##################################################################
1156
1157sub get_Destination_Directory_For_Item_From_Directorylist # this is used for Files, Profiles and Links
1158{
1159 my ($itemarrayref, $dirsarrayref) = @_;
1160
1097 my $directoryname = "";
1098 my $onedirectory;
1099 my $foundgid = 0;
1100
1101 for ( my $i = 0; $i <= $#{$dirsarrayref}; $i++ )
1102 {
1103 $onedirectory = ${$dirsarrayref}[$i];
1104 my $directorygid = $onedirectory->{'gid'};

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

1140##################################################################
1141# Getting destination directory for links, files and profiles
1142##################################################################
1143
1144sub get_Destination_Directory_For_Item_From_Directorylist # this is used for Files, Profiles and Links
1145{
1146 my ($itemarrayref, $dirsarrayref) = @_;
1147
1161 if ( $installer::globals::debug ) { installer::logger::debuginfo("installer::scriptitems::get_Destination_Directory_For_Item_From_Directorylist : $#{$itemarrayref} : $#{$dirsarrayref}"); }
1162
1163 for ( my $i = 0; $i <= $#{$itemarrayref}; $i++ )
1164 {
1165 my $oneitem = ${$itemarrayref}[$i];
1166 my $oneitemgid = $oneitem->{'gid'};
1167 my $directorygid = $oneitem->{'Dir'}; # for instance gid_Dir_Program
1168 my $netdirectorygid = "";
1169 my $onelanguage = $oneitem->{'specificlanguage'};
1170 my $ispredefinedprogdir = 0;

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

1216##########################################################################
1217# Searching a file in a list of pathes
1218##########################################################################
1219
1220sub get_sourcepath_from_filename_and_includepath_classic
1221{
1222 my ($searchfilenameref, $includepatharrayref, $write_logfile) = @_;
1223
1148 for ( my $i = 0; $i <= $#{$itemarrayref}; $i++ )
1149 {
1150 my $oneitem = ${$itemarrayref}[$i];
1151 my $oneitemgid = $oneitem->{'gid'};
1152 my $directorygid = $oneitem->{'Dir'}; # for instance gid_Dir_Program
1153 my $netdirectorygid = "";
1154 my $onelanguage = $oneitem->{'specificlanguage'};
1155 my $ispredefinedprogdir = 0;

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

1201##########################################################################
1202# Searching a file in a list of pathes
1203##########################################################################
1204
1205sub get_sourcepath_from_filename_and_includepath_classic
1206{
1207 my ($searchfilenameref, $includepatharrayref, $write_logfile) = @_;
1208
1224 if ( $installer::globals::debug ) { installer::logger::debuginfo("installer::scriptitems::get_sourcepath_from_filename_and_includepath_classic : $$searchfilenameref : $#{$includepatharrayref} : $write_logfile"); }
1225
1226 my ($onefile, $includepath, $infoline);
1227
1228 my $foundsourcefile = 0;
1229
1230 for ( my $j = 0; $j <= $#{$includepatharrayref}; $j++ )
1231 {
1232 $includepath = ${$includepatharrayref}[$j];
1233 installer::remover::remove_leading_and_ending_whitespaces(\$includepath);

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

1274##########################################################################
1275# Input is one file name, output the complete absolute path of this file
1276##########################################################################
1277
1278sub get_sourcepath_from_filename_and_includepath
1279{
1280 my ($searchfilenameref, $unused, $write_logfile) = @_;
1281
1209 my ($onefile, $includepath, $infoline);
1210
1211 my $foundsourcefile = 0;
1212
1213 for ( my $j = 0; $j <= $#{$includepatharrayref}; $j++ )
1214 {
1215 $includepath = ${$includepatharrayref}[$j];
1216 installer::remover::remove_leading_and_ending_whitespaces(\$includepath);

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

1257##########################################################################
1258# Input is one file name, output the complete absolute path of this file
1259##########################################################################
1260
1261sub get_sourcepath_from_filename_and_includepath
1262{
1263 my ($searchfilenameref, $unused, $write_logfile) = @_;
1264
1282 if ( $installer::globals::debug ) { installer::logger::debuginfo("installer::scriptitems::get_sourcepath_from_filename_and_includepath : $$searchfilenameref : $#{$includepatharrayref} : $write_logfile"); }
1283
1284 my ($onefile, $includepath, $infoline);
1285
1286 my $foundsourcefile = 0;
1287 my $foundnewname = 0;
1288
1289 for ( my $j = 0; $j <= $#installer::globals::allincludepathes; $j++ )
1290 {
1291 my $allfiles = $installer::globals::allincludepathes[$j];

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

1386# Getting all source pathes for all files to be packed
1387# $item can be "Files" or "ScpActions"
1388##############################################################
1389
1390sub get_Source_Directory_For_Files_From_Includepathlist
1391{
1392 my ($filesarrayref, $includepatharrayref, $dirsref, $item) = @_;
1393
1265 my ($onefile, $includepath, $infoline);
1266
1267 my $foundsourcefile = 0;
1268 my $foundnewname = 0;
1269
1270 for ( my $j = 0; $j <= $#installer::globals::allincludepathes; $j++ )
1271 {
1272 my $allfiles = $installer::globals::allincludepathes[$j];

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

1367# Getting all source pathes for all files to be packed
1368# $item can be "Files" or "ScpActions"
1369##############################################################
1370
1371sub get_Source_Directory_For_Files_From_Includepathlist
1372{
1373 my ($filesarrayref, $includepatharrayref, $dirsref, $item) = @_;
1374
1394 if ( $installer::globals::debug ) { installer::logger::debuginfo("installer::scriptitems::get_Source_Directory_For_Files_From_Includepathlist : $#{$filesarrayref} : $#{$includepatharrayref} : $item"); }
1395
1396 installer::logger::include_header_into_logfile("$item:");
1397
1398 my $infoline = "";
1399
1400 for ( my $i = 0; $i <= $#{$filesarrayref}; $i++ )
1401 {
1402 my $onefile = ${$filesarrayref}[$i];
1403 my $onelanguage = $onefile->{'specificlanguage'};

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

1482# Removing files, that shall not be included into languagepacks
1483# (because of rpm conflicts)
1484#################################################################################
1485
1486sub remove_Files_For_Languagepacks
1487{
1488 my ($itemsarrayref) = @_;
1489
1375 installer::logger::include_header_into_logfile("$item:");
1376
1377 my $infoline = "";
1378
1379 for ( my $i = 0; $i <= $#{$filesarrayref}; $i++ )
1380 {
1381 my $onefile = ${$filesarrayref}[$i];
1382 my $onelanguage = $onefile->{'specificlanguage'};

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

1461# Removing files, that shall not be included into languagepacks
1462# (because of rpm conflicts)
1463#################################################################################
1464
1465sub remove_Files_For_Languagepacks
1466{
1467 my ($itemsarrayref) = @_;
1468
1490 if ( $installer::globals::debug ) { installer::logger::debuginfo("installer::scriptitems::remove_Files_For_Languagepacks : $#{$filesarrayref}"); }
1491
1492 my $infoline;
1493
1494 my @newitemsarray = ();
1495
1496 for ( my $i = 0; $i <= $#{$itemsarrayref}; $i++ )
1497 {
1498 my $oneitem = ${$itemsarrayref}[$i];
1499 my $gid = $oneitem->{'gid'};

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

1518#################################################################################
1519# Files, whose source directory is not found, are removed now (this is an ERROR)
1520#################################################################################
1521
1522sub remove_Files_Without_Sourcedirectory
1523{
1524 my ($filesarrayref) = @_;
1525
1469 my $infoline;
1470
1471 my @newitemsarray = ();
1472
1473 for ( my $i = 0; $i <= $#{$itemsarrayref}; $i++ )
1474 {
1475 my $oneitem = ${$itemsarrayref}[$i];
1476 my $gid = $oneitem->{'gid'};

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

1495#################################################################################
1496# Files, whose source directory is not found, are removed now (this is an ERROR)
1497#################################################################################
1498
1499sub remove_Files_Without_Sourcedirectory
1500{
1501 my ($filesarrayref) = @_;
1502
1526 if ( $installer::globals::debug ) { installer::logger::debuginfo("installer::scriptitems::remove_Files_Without_Sourcedirectory : $#{$filesarrayref}"); }
1527
1528 my $infoline;
1529
1530 my $error_occured = 0;
1531 my @missingfiles = ();
1532 push(@missingfiles, "ERROR: The following files could not be found: \n");
1533
1534 my @newfilesarray = ();
1535

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

1630# in the installation root (next to the program dir). This is in scp
1631# project done by a post install basic script
1632############################################################################
1633
1634sub add_License_Files_into_Installdir
1635{
1636 my ($filesarrayref, $dirsarrayref, $languagesarrayref) = @_;
1637
1503 my $infoline;
1504
1505 my $error_occured = 0;
1506 my @missingfiles = ();
1507 push(@missingfiles, "ERROR: The following files could not be found: \n");
1508
1509 my @newfilesarray = ();
1510

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

1605# in the installation root (next to the program dir). This is in scp
1606# project done by a post install basic script
1607############################################################################
1608
1609sub add_License_Files_into_Installdir
1610{
1611 my ($filesarrayref, $dirsarrayref, $languagesarrayref) = @_;
1612
1638 if ( $installer::globals::debug ) { installer::logger::debuginfo("installer::scriptitems::add_License_Files_into_Installdir : $#{$filesarrayref} : $#{$languagesarrayref}"); }
1639
1640 my $infoline;
1641
1642 my @newfilesarray = ();
1643
1644 my $defaultlanguage = installer::languages::get_default_language($languagesarrayref);
1645
1646 my ($foundofficedir, $officedirectorygid, $officedirectoryhostname) = get_office_directory_gid_and_hostname($dirsarrayref);
1647

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

1903# Removing all scpactions, that have no name.
1904# See: FlatLoaderZip
1905############################################################################
1906
1907sub remove_scpactions_without_name
1908{
1909 my ($itemsarrayref) = @_;
1910
1613 my $infoline;
1614
1615 my @newfilesarray = ();
1616
1617 my $defaultlanguage = installer::languages::get_default_language($languagesarrayref);
1618
1619 my ($foundofficedir, $officedirectorygid, $officedirectoryhostname) = get_office_directory_gid_and_hostname($dirsarrayref);
1620

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

1876# Removing all scpactions, that have no name.
1877# See: FlatLoaderZip
1878############################################################################
1879
1880sub remove_scpactions_without_name
1881{
1882 my ($itemsarrayref) = @_;
1883
1911 if ( $installer::globals::debug ) { installer::logger::debuginfo("installer::scriptitems::remove_scpactions_without_name : $#{$itemsarrayref}"); }
1912
1913 my $infoline;
1914
1915 my @newitemsarray = ();
1916
1917 for ( my $i = 0; $i <= $#{$itemsarrayref}; $i++ )
1918 {
1919 my $oneitem = ${$itemsarrayref}[$i];
1920 my $name = "";

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

1939# Because of the item "File" the source name must be "Name". Therefore
1940# "Copy" is changed to "Name" and "Name" is changed to "DestinationName".
1941############################################################################
1942
1943sub change_keys_of_scpactions
1944{
1945 my ($itemsarrayref) = @_;
1946
1884 my $infoline;
1885
1886 my @newitemsarray = ();
1887
1888 for ( my $i = 0; $i <= $#{$itemsarrayref}; $i++ )
1889 {
1890 my $oneitem = ${$itemsarrayref}[$i];
1891 my $name = "";

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

1910# Because of the item "File" the source name must be "Name". Therefore
1911# "Copy" is changed to "Name" and "Name" is changed to "DestinationName".
1912############################################################################
1913
1914sub change_keys_of_scpactions
1915{
1916 my ($itemsarrayref) = @_;
1917
1947 if ( $installer::globals::debug ) { installer::logger::debuginfo("installer::scriptitems::change_keys_of_scpactions : $#{$itemsarrayref}"); }
1948
1949 for ( my $i = 0; $i <= $#{$itemsarrayref}; $i++ )
1950 {
1951 my $oneitem = ${$itemsarrayref}[$i];
1952
1953 my $key;
1954
1955 # First Name to DestinationName, then deleting Name
1956 foreach $key (keys %{$oneitem})

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

1984# Removing all xpd only items from installation set (scpactions with
1985# the style XPD_ONLY), except an xpd installation set is created
1986############################################################################
1987
1988sub remove_Xpdonly_Items
1989{
1990 my ($itemsarrayref) = @_;
1991
1918 for ( my $i = 0; $i <= $#{$itemsarrayref}; $i++ )
1919 {
1920 my $oneitem = ${$itemsarrayref}[$i];
1921
1922 my $key;
1923
1924 # First Name to DestinationName, then deleting Name
1925 foreach $key (keys %{$oneitem})

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

1953# Removing all xpd only items from installation set (scpactions with
1954# the style XPD_ONLY), except an xpd installation set is created
1955############################################################################
1956
1957sub remove_Xpdonly_Items
1958{
1959 my ($itemsarrayref) = @_;
1960
1992 if ( $installer::globals::debug ) { installer::logger::debuginfo("installer::scriptitems::remove_Xpdonly_Items : $#{$itemsarrayref}"); }
1993
1994 my $infoline;
1995
1996 my @newitemsarray = ();
1997
1998 for ( my $i = 0; $i <= $#{$itemsarrayref}; $i++ )
1999 {
2000 my $oneitem = ${$itemsarrayref}[$i];
2001 my $styles = "";

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

2022# Removing all language pack files from installation set (files with
2023# the style LANGUAGEPACK), except this is a language pack.
2024############################################################################
2025
2026sub remove_Languagepacklibraries_from_Installset
2027{
2028 my ($itemsarrayref) = @_;
2029
1961 my $infoline;
1962
1963 my @newitemsarray = ();
1964
1965 for ( my $i = 0; $i <= $#{$itemsarrayref}; $i++ )
1966 {
1967 my $oneitem = ${$itemsarrayref}[$i];
1968 my $styles = "";

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

1989# Removing all language pack files from installation set (files with
1990# the style LANGUAGEPACK), except this is a language pack.
1991############################################################################
1992
1993sub remove_Languagepacklibraries_from_Installset
1994{
1995 my ($itemsarrayref) = @_;
1996
2030 if ( $installer::globals::debug ) { installer::logger::debuginfo("installer::scriptitems::remove_Languagepacklibraries_from_Installset : $#{$itemsarrayref}"); }
2031
2032 my $infoline;
2033
2034 my @newitemsarray = ();
2035
2036 for ( my $i = 0; $i <= $#{$itemsarrayref}; $i++ )
2037 {
2038 my $oneitem = ${$itemsarrayref}[$i];
2039 my $styles = "";

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

2060# Removing all files with flag PATCH_ONLY from installation set.
2061# This function is not called during patch creation.
2062############################################################################
2063
2064sub remove_patchonlyfiles_from_Installset
2065{
2066 my ($itemsarrayref) = @_;
2067
1997 my $infoline;
1998
1999 my @newitemsarray = ();
2000
2001 for ( my $i = 0; $i <= $#{$itemsarrayref}; $i++ )
2002 {
2003 my $oneitem = ${$itemsarrayref}[$i];
2004 my $styles = "";

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

2025# Removing all files with flag PATCH_ONLY from installation set.
2026# This function is not called during patch creation.
2027############################################################################
2028
2029sub remove_patchonlyfiles_from_Installset
2030{
2031 my ($itemsarrayref) = @_;
2032
2068 if ( $installer::globals::debug ) { installer::logger::debuginfo("installer::scriptitems::remove_patchonlyfiles_from_Installset : $#{$itemsarrayref}"); }
2069
2070 my $infoline;
2071
2072 my @newitemsarray = ();
2073
2074 for ( my $i = 0; $i <= $#{$itemsarrayref}; $i++ )
2075 {
2076 my $oneitem = ${$itemsarrayref}[$i];
2077 my $styles = "";

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

2098# Removing all files with flag TAB_ONLY from installation set.
2099# This function is not called during tab creation.
2100############################################################################
2101
2102sub remove_tabonlyfiles_from_Installset
2103{
2104 my ($itemsarrayref) = @_;
2105
2033 my $infoline;
2034
2035 my @newitemsarray = ();
2036
2037 for ( my $i = 0; $i <= $#{$itemsarrayref}; $i++ )
2038 {
2039 my $oneitem = ${$itemsarrayref}[$i];
2040 my $styles = "";

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

2061# Removing all files with flag TAB_ONLY from installation set.
2062# This function is not called during tab creation.
2063############################################################################
2064
2065sub remove_tabonlyfiles_from_Installset
2066{
2067 my ($itemsarrayref) = @_;
2068
2106 if ( $installer::globals::debug ) { installer::logger::debuginfo("installer::scriptitems::remove_tabonlyfiles_from_Installset : $#{$itemsarrayref}"); }
2107
2108 my $infoline;
2109
2110 my @newitemsarray = ();
2111
2112 for ( my $i = 0; $i <= $#{$itemsarrayref}; $i++ )
2113 {
2114 my $oneitem = ${$itemsarrayref}[$i];
2115 my $styles = "";

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

2136# Removing all files with flag ONLY_INSTALLED_PRODUCT from installation set.
2137# This function is not called for PKGFORMAT installed and archive.
2138###############################################################################
2139
2140sub remove_installedproductonlyfiles_from_Installset
2141{
2142 my ($itemsarrayref) = @_;
2143
2069 my $infoline;
2070
2071 my @newitemsarray = ();
2072
2073 for ( my $i = 0; $i <= $#{$itemsarrayref}; $i++ )
2074 {
2075 my $oneitem = ${$itemsarrayref}[$i];
2076 my $styles = "";

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

2097# Removing all files with flag ONLY_INSTALLED_PRODUCT from installation set.
2098# This function is not called for PKGFORMAT installed and archive.
2099###############################################################################
2100
2101sub remove_installedproductonlyfiles_from_Installset
2102{
2103 my ($itemsarrayref) = @_;
2104
2144 if ( $installer::globals::debug ) { installer::logger::debuginfo("installer::scriptitems::remove_installedproductonlyfiles_from_Installset : $#{$itemsarrayref}"); }
2145
2146 my $infoline;
2147
2148 my @newitemsarray = ();
2149
2150 for ( my $i = 0; $i <= $#{$itemsarrayref}; $i++ )
2151 {
2152 my $oneitem = ${$itemsarrayref}[$i];
2153 my $styles = "";

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

2173# Some files cotain a $ in their name. epm conflicts with such files.
2174# Solution: Renaming this files, converting "$" to "$$"
2175############################################################################
2176
2177sub quoting_illegal_filenames
2178{
2179 my ($filesarrayref) = @_;
2180
2105 my $infoline;
2106
2107 my @newitemsarray = ();
2108
2109 for ( my $i = 0; $i <= $#{$itemsarrayref}; $i++ )
2110 {
2111 my $oneitem = ${$itemsarrayref}[$i];
2112 my $styles = "";

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

2132# Some files cotain a $ in their name. epm conflicts with such files.
2133# Solution: Renaming this files, converting "$" to "$$"
2134############################################################################
2135
2136sub quoting_illegal_filenames
2137{
2138 my ($filesarrayref) = @_;
2139
2181 if ( $installer::globals::debug ) { installer::logger::debuginfo("installer::scriptitems::rename_illegal_filenames : $#{$filesarrayref}"); }
2182
2183 # This function has to be removed as soon as possible!
2184
2185 installer::logger::include_header_into_logfile("Renaming illegal filenames:");
2186
2187 for ( my $i = 0; $i <= $#{$filesarrayref}; $i++ )
2188 {
2189 my $onefile = ${$filesarrayref}[$i];
2190 my $filename = $onefile->{'Name'};

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

2238##################################
2239# Collecting directories: Part 1
2240##################################
2241
2242sub collect_directories_from_filesarray
2243{
2244 my ($filesarrayref) = @_;
2245
2140 # This function has to be removed as soon as possible!
2141
2142 installer::logger::include_header_into_logfile("Renaming illegal filenames:");
2143
2144 for ( my $i = 0; $i <= $#{$filesarrayref}; $i++ )
2145 {
2146 my $onefile = ${$filesarrayref}[$i];
2147 my $filename = $onefile->{'Name'};

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

2195##################################
2196# Collecting directories: Part 1
2197##################################
2198
2199sub collect_directories_from_filesarray
2200{
2201 my ($filesarrayref) = @_;
2202
2246 if ( $installer::globals::debug ) { installer::logger::debuginfo("installer::scriptitems::collect_directories_from_filesarray : $#{$filesarrayref}"); }
2247
2248 my @alldirectories = ();
2249 my %alldirectoryhash = ();
2250
2251 my $predefinedprogdir_added = 0;
2252 my $alreadyincluded = 0;
2253
2254 # Preparing this already as hash, although the only needed value at the moment is the HostName
2255 # But also adding: "specificlanguage" and "Dir" (for instance gid_Dir_Program)

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

2344
2345 return (\@alldirectories, \%alldirectoryhash);
2346}
2347
2348##################################
2349# Collecting directories: Part 2
2350##################################
2351
2203 my @alldirectories = ();
2204 my %alldirectoryhash = ();
2205
2206 my $predefinedprogdir_added = 0;
2207 my $alreadyincluded = 0;
2208
2209 # Preparing this already as hash, although the only needed value at the moment is the HostName
2210 # But also adding: "specificlanguage" and "Dir" (for instance gid_Dir_Program)

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

2299
2300 return (\@alldirectories, \%alldirectoryhash);
2301}
2302
2303##################################
2304# Collecting directories: Part 2
2305##################################
2306
2352sub collect_directories_with_create_flag_from_directoryarray
2307sub collect_directories_with_create_flag_from_directoryarray ($$)
2353{
2354 my ($directoryarrayref, $alldirectoryhash) = @_;
2355
2308{
2309 my ($directoryarrayref, $alldirectoryhash) = @_;
2310
2356 if ( $installer::globals::debug ) { installer::logger::debuginfo("installer::scriptitems::collect_directories_with_create_flag_from_directoryarray : $#{$directoryarrayref}"); }
2357
2358 my $alreadyincluded = 0;
2359 my @alldirectories = ();
2360
2361 for ( my $i = 0; $i <= $#{$directoryarrayref}; $i++ )
2362 {
2363 my $onedir = ${$directoryarrayref}[$i];
2364 my $styles = "";
2311 my $alreadyincluded = 0;
2312 my @alldirectories = ();
2313
2314 for ( my $i = 0; $i <= $#{$directoryarrayref}; $i++ )
2315 {
2316 my $onedir = ${$directoryarrayref}[$i];
2317 my $styles = "";
2365 $newdirincluded = 0;
2318 my $newdirincluded = 0;
2366
2367 if ( $onedir->{'Styles'} ) { $styles = $onedir->{'Styles'}; }
2368
2369 if ( $styles =~ /\bCREATE\b/ )
2370 {
2371 my $directoryname = "";
2372
2373 if ( $onedir->{'HostName'} ) { $directoryname = $onedir->{'HostName'}; }

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

2462
2463 # Creating directory array
2464 foreach my $destdir ( sort keys %{$alldirectoryhash} )
2465 {
2466 $alldirectoryhash->{$destdir}->{'modules'} = optimize_list($alldirectoryhash->{$destdir}->{'modules'});
2467 push(@alldirectories, $alldirectoryhash->{$destdir});
2468 }
2469
2319
2320 if ( $onedir->{'Styles'} ) { $styles = $onedir->{'Styles'}; }
2321
2322 if ( $styles =~ /\bCREATE\b/ )
2323 {
2324 my $directoryname = "";
2325
2326 if ( $onedir->{'HostName'} ) { $directoryname = $onedir->{'HostName'}; }

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

2415
2416 # Creating directory array
2417 foreach my $destdir ( sort keys %{$alldirectoryhash} )
2418 {
2419 $alldirectoryhash->{$destdir}->{'modules'} = optimize_list($alldirectoryhash->{$destdir}->{'modules'});
2420 push(@alldirectories, $alldirectoryhash->{$destdir});
2421 }
2422
2470 return (\@alldirectories, \%alldirectoryhash);
2423 return (\@alldirectories, $alldirectoryhash);
2471}
2472
2473#################################################
2474# Determining the destination file of a link
2475#################################################
2476
2424}
2425
2426#################################################
2427# Determining the destination file of a link
2428#################################################
2429
2477sub get_destination_file_path_for_links
2430sub get_destination_file_path_for_links ($$)
2478{
2479 my ($linksarrayref, $filesarrayref) = @_;
2480
2431{
2432 my ($linksarrayref, $filesarrayref) = @_;
2433
2481 if ( $installer::globals::debug ) { installer::logger::debuginfo("installer::scriptitems::get_destination_file_path_for_links : $#{$linksarrayref} : $#{$filesarrayref}"); }
2482
2483 my $infoline;
2484
2485 for ( my $i = 0; $i <= $#{$linksarrayref}; $i++ )
2486 {
2487 my $fileid = "";
2488 my $onelink = ${$linksarrayref}[$i];
2489 if ( $onelink->{'FileID'} ) { $fileid = $onelink->{'FileID'}; }
2490

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

2516
2517 $installer::logger::Lang->printf("\n");
2518}
2519
2520#################################################
2521# Determining the destination link of a link
2522#################################################
2523
2434 my $infoline;
2435
2436 for ( my $i = 0; $i <= $#{$linksarrayref}; $i++ )
2437 {
2438 my $fileid = "";
2439 my $onelink = ${$linksarrayref}[$i];
2440 if ( $onelink->{'FileID'} ) { $fileid = $onelink->{'FileID'}; }
2441

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

2467
2468 $installer::logger::Lang->printf("\n");
2469}
2470
2471#################################################
2472# Determining the destination link of a link
2473#################################################
2474
2524sub get_destination_link_path_for_links
2475sub get_destination_link_path_for_links ($)
2525{
2526 my ($linksarrayref) = @_;
2527
2476{
2477 my ($linksarrayref) = @_;
2478
2528 if ( $installer::globals::debug ) { installer::logger::debuginfo("installer::scriptitems::get_destination_link_path_for_links : $#{$linksarrayref}"); }
2529
2530 my $infoline;
2531
2479 my $infoline;
2480
2532 for ( my $i = 0; $i <= $#{$linksarrayref}; $i++ )
2481 foreach my $onelink (@$linksarrayref)
2533 {
2534 my $shortcutid = "";
2482 {
2483 my $shortcutid = "";
2535 my $onelink = ${$linksarrayref}[$i];
2536 if ( $onelink->{'ShortcutID'} ) { $shortcutid = $onelink->{'ShortcutID'}; }
2484 if ($onelink->{'ShortcutID'})
2485 {
2486 $shortcutid = $onelink->{'ShortcutID'};
2487 }
2537
2488
2538 if (!( $shortcutid eq "" ))
2489 if ($shortcutid ne "")
2539 {
2540 my $foundlink = 0;
2541
2490 {
2491 my $foundlink = 0;
2492
2542 for ( my $j = 0; $j <= $#{$linksarrayref}; $j++ )
2493 foreach my $destlink (@$linksarrayref)
2543 {
2494 {
2544 my $destlink = ${$linksarrayref}[$j];
2545 $shortcutgid = $destlink->{'gid'};
2546
2547 if ( $shortcutgid eq $shortcutid )
2495 if ($destlink->{'gid'} eq $shortcutid)
2548 {
2549 $foundlink = 1;
2550 $onelink->{'destinationfile'} = $destlink->{'destination'}; # making key 'destinationfile'
2551 last;
2552 }
2553 }
2554
2496 {
2497 $foundlink = 1;
2498 $onelink->{'destinationfile'} = $destlink->{'destination'}; # making key 'destinationfile'
2499 last;
2500 }
2501 }
2502
2555 if (!($foundlink))
2503 if ( ! $foundlink)
2556 {
2557 $installer::logger::Lang->printf("Warning: ShortcutID %s for Link %s not found!\n",
2558 $shortcutid,
2559 $onelink->{'gid'});
2560 }
2561 }
2562 }
2563
2564 $installer::logger::Lang->printf("\n");
2565}
2566
2567###################################################################################
2568# Items with flag WORKSTATION are not needed (here: links and configurationitems)
2569###################################################################################
2570
2571sub remove_workstation_only_items
2572{
2573 my ($itemarrayref) = @_;
2574
2504 {
2505 $installer::logger::Lang->printf("Warning: ShortcutID %s for Link %s not found!\n",
2506 $shortcutid,
2507 $onelink->{'gid'});
2508 }
2509 }
2510 }
2511
2512 $installer::logger::Lang->printf("\n");
2513}
2514
2515###################################################################################
2516# Items with flag WORKSTATION are not needed (here: links and configurationitems)
2517###################################################################################
2518
2519sub remove_workstation_only_items
2520{
2521 my ($itemarrayref) = @_;
2522
2575 if ( $installer::globals::debug ) { installer::logger::debuginfo("installer::scriptitems::remove_workstation_only_items : $#{$itemarrayref}"); }
2576
2577 my @newitemarray = ();
2578
2579 for ( my $i = 0; $i <= $#{$itemarrayref}; $i++ )
2580 {
2581 my $oneitem = ${$itemarrayref}[$i];
2582 my $styles = $oneitem->{'Styles'};
2583
2584 if (( $styles =~ /\bWORKSTATION\b/ ) &&

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

2597################################################
2598# Resolving relative path in links
2599################################################
2600
2601sub resolve_links_with_flag_relative
2602{
2603 my ($linksarrayref) = @_;
2604
2523 my @newitemarray = ();
2524
2525 for ( my $i = 0; $i <= $#{$itemarrayref}; $i++ )
2526 {
2527 my $oneitem = ${$itemarrayref}[$i];
2528 my $styles = $oneitem->{'Styles'};
2529
2530 if (( $styles =~ /\bWORKSTATION\b/ ) &&

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

2543################################################
2544# Resolving relative path in links
2545################################################
2546
2547sub resolve_links_with_flag_relative
2548{
2549 my ($linksarrayref) = @_;
2550
2605 if ( $installer::globals::debug ) { installer::logger::debuginfo("installer::scriptitems::resolve_links_with_flag_relative : $#{$linksarrayref}"); }
2606
2607 # Before this step is:
2608 # destination=program/libsalhelperC52.so.3, this will be the name of the link
2609 # destinationfile=program/libsalhelperC52.so.3, this will be the linked file or name
2610 # If the flag RELATIVE is set, the pathes have to be analyzed. If the flag is not set
2611 # (this will not occur in the future?) destinationfile has to be an absolute path name
2612
2613 for ( my $i = 0; $i <= $#{$linksarrayref}; $i++ )
2614 {

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

2660 my @gids = ();
2661 $hash->{$item} = \@gids;
2662 }
2663 my $gid_list = $hash->{$item};
2664 push @{$gid_list}, $id;
2665 $hash->{$item} = $gid_list;
2666}
2667
2551 # Before this step is:
2552 # destination=program/libsalhelperC52.so.3, this will be the name of the link
2553 # destinationfile=program/libsalhelperC52.so.3, this will be the linked file or name
2554 # If the flag RELATIVE is set, the pathes have to be analyzed. If the flag is not set
2555 # (this will not occur in the future?) destinationfile has to be an absolute path name
2556
2557 for ( my $i = 0; $i <= $#{$linksarrayref}; $i++ )
2558 {

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

2604 my @gids = ();
2605 $hash->{$item} = \@gids;
2606 }
2607 my $gid_list = $hash->{$item};
2608 push @{$gid_list}, $id;
2609 $hash->{$item} = $gid_list;
2610}
2611
2668sub build_modulegids_table
2612sub build_modulegids_table ($$)
2669{
2670 my ($modulesref, $itemname) = @_;
2671
2672 my %module_lookup_table = ();
2673
2674 # build map of item names to list of respective module gids
2675 # containing these items
2613{
2614 my ($modulesref, $itemname) = @_;
2615
2616 my %module_lookup_table = ();
2617
2618 # build map of item names to list of respective module gids
2619 # containing these items
2676 for my $onemodule (@{$modulesref})
2620 foreach my $onemodule (@{$modulesref})
2677 {
2621 {
2678 next if ( ! defined $onemodule->{$itemname} );
2622 next if ! defined $onemodule->{$itemname};
2679 # these are the items contained in this module
2680 # eg. Files = (gid_a_b_c,gid_d_e_f)
2681 my $module_gids = $onemodule->{$itemname};
2682
2683 # prune outer brackets
2684 $module_gids =~ s|^\s*\(||g;
2685 $module_gids =~ s|\)\s*$||g;
2686 for my $id (split (/,/, $module_gids))

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

2693 return \%module_lookup_table;
2694}
2695
2696########################################################################
2697# Items like files do not know their modules
2698# This function is a helper of function "assigning_modules_to_items"
2699########################################################################
2700
2623 # these are the items contained in this module
2624 # eg. Files = (gid_a_b_c,gid_d_e_f)
2625 my $module_gids = $onemodule->{$itemname};
2626
2627 # prune outer brackets
2628 $module_gids =~ s|^\s*\(||g;
2629 $module_gids =~ s|\)\s*$||g;
2630 for my $id (split (/,/, $module_gids))

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

2637 return \%module_lookup_table;
2638}
2639
2640########################################################################
2641# Items like files do not know their modules
2642# This function is a helper of function "assigning_modules_to_items"
2643########################################################################
2644
2701sub get_string_of_modulegids_for_itemgid
2645sub get_string_of_modulegids_for_itemgid ($$)
2702{
2646{
2703 my ($module_lookup_table, $modulesref, $itemgid, $itemname) = @_;
2647 my ($module_lookup_table, $itemgid) = @_;
2704
2648
2705 if ( $installer::globals::debug ) { installer::logger::debuginfo("installer::scriptitems::get_string_of_modulegids_for_itemgid : $#{$modulesref} : $itemgid : $itemname"); }
2706
2707 my $allmodules = "";
2708 my $haslanguagemodule = 0;
2709 my %foundmodules = ();
2710
2711 # print STDERR "lookup '" . lc($itemgid) . "'\n";
2712 my $gid_list = $module_lookup_table->{lc($itemgid)};
2713
2649 my $haslanguagemodule = 0;
2650 my %foundmodules = ();
2651
2652 # print STDERR "lookup '" . lc($itemgid) . "'\n";
2653 my $gid_list = $module_lookup_table->{lc($itemgid)};
2654
2714 for my $gid (@{$gid_list})
2655 foreach my $gid (@{$gid_list})
2715 {
2716 $foundmodules{$gid} = 1;
2656 {
2657 $foundmodules{$gid} = 1;
2717 $allmodules = $allmodules . "," . $gid;
2718 # Is this module a language module? This info should be stored at the file.
2658 # Is this module a language module? This info should be stored at the file.
2719 if ( exists($installer::globals::alllangmodules{$gid}) ) { $haslanguagemodule = 1; }
2659 if ( exists($installer::globals::alllangmodules{$gid}) )
2660 {
2661 $haslanguagemodule = 1;
2662 }
2720 }
2721
2663 }
2664
2722 $allmodules =~ s/^\s*\,//; # removing leading comma
2665 my $allmodules = join(",", keys %foundmodules);
2723
2724 # Check: All modules or no module must have flag LANGUAGEMODULE
2725 if ( $haslanguagemodule )
2726 {
2666
2667 # Check: All modules or no module must have flag LANGUAGEMODULE
2668 if ( $haslanguagemodule )
2669 {
2727 my $isreallylanguagemodule = installer::worker::key_in_a_is_also_key_in_b(\%foundmodules, \%installer::globals::alllangmodules);
2728 if ( ! $isreallylanguagemodule ) { installer::exiter::exit_program("ERROR: \"$itemgid\" is assigned to modules with flag \"LANGUAGEMODULE\" and also to modules without this flag! Modules: $allmodules", "get_string_of_modulegids_for_itemgid"); }
2670 my $isreallylanguagemodule = installer::worker::key_in_a_is_also_key_in_b(
2671 \%foundmodules,
2672 \%installer::globals::alllangmodules);
2673 if ( ! $isreallylanguagemodule )
2674 {
2675 installer::exiter::exit_program(
2676 sprintf(
2677 "ERROR: \"\" is assigned to modules with flag "
2678 . "\"LANGUAGEMODULE\" and also to modules without this flag! Modules: %s",
2679 $itemgid,
2680 $allmodules),
2681 "get_string_of_modulegids_for_itemgid");
2682 }
2729 }
2730
2683 }
2684
2731 # print STDERR "get_string_for_itemgid ($itemgid, $itemname) => $allmodules, $haslanguagemodule\n";
2732
2733 return ($allmodules, $haslanguagemodule);
2734}
2735
2736########################################################
2737# Items like files do not know their modules
2738# This function add the {'modules'} to these items
2739########################################################
2740
2741sub assigning_modules_to_items
2742{
2743 my ($modulesref, $itemsref, $itemname) = @_;
2744
2685 return ($allmodules, $haslanguagemodule);
2686}
2687
2688########################################################
2689# Items like files do not know their modules
2690# This function add the {'modules'} to these items
2691########################################################
2692
2693sub assigning_modules_to_items
2694{
2695 my ($modulesref, $itemsref, $itemname) = @_;
2696
2745 if ( $installer::globals::debug ) { installer::logger::debuginfo("installer::scriptitems::assigning_modules_to_items : $#{$modulesref} : $#{$itemsref} : $itemname"); }
2746
2747 my $infoline = "";
2748 my $languageassignmenterror = 0;
2749 my @languageassignmenterrors = ();
2750
2751 my $module_lookup_table = build_modulegids_table($modulesref, $itemname);
2752
2753 for my $oneitem (@{$itemsref})
2754 {
2755 my $itemgid = $oneitem->{'gid'};
2756
2757 my $styles = "";
2758 if ( $oneitem->{'Styles'} ) { $styles = $oneitem->{'Styles'}; }
2759 if (( $itemname eq "Dirs" ) && ( ! ( $styles =~ /\bCREATE\b/ ))) { next; }
2760
2761 if ( $itemgid eq "" )
2762 {
2697 my $languageassignmenterror = 0;
2698 my @languageassignmenterrors = ();
2699
2700 my $module_lookup_table = build_modulegids_table($modulesref, $itemname);
2701
2702 for my $oneitem (@{$itemsref})
2703 {
2704 my $itemgid = $oneitem->{'gid'};
2705
2706 my $styles = "";
2707 if ( $oneitem->{'Styles'} ) { $styles = $oneitem->{'Styles'}; }
2708 if (( $itemname eq "Dirs" ) && ( ! ( $styles =~ /\bCREATE\b/ ))) { next; }
2709
2710 if ( $itemgid eq "" )
2711 {
2763 installer::exiter::exit_program("ERROR in item collection: No gid for item $oneitem->{'Name'}", "assigning_modules_to_items");
2712 installer::exiter::exit_program(
2713 sprintf("ERROR in item collection: No gid for item %s", $oneitem->{'Name'}),
2714 "assigning_modules_to_items");
2764 }
2765
2766 # every item can belong to many modules
2767
2715 }
2716
2717 # every item can belong to many modules
2718
2768 my ($modulegids, $haslanguagemodule) = get_string_of_modulegids_for_itemgid($module_lookup_table, $modulesref, $itemgid, $itemname);
2719 my ($modulegids, $haslanguagemodule) = get_string_of_modulegids_for_itemgid(
2720 $module_lookup_table,
2721 $itemgid);
2769
2770 if ($modulegids eq "")
2771 {
2722
2723 if ($modulegids eq "")
2724 {
2772 installer::exiter::exit_program("ERROR in file collection: No module found for $itemname $itemgid", "assigning_modules_to_items");
2725 installer::exiter::exit_program(
2726 sprintf("ERROR in file collection: No module found for %s %s",
2727 $itemname,
2728 $itemgid),
2729 "assigning_modules_to_items");
2773 }
2774
2775 $oneitem->{'modules'} = $modulegids;
2776 $oneitem->{'haslanguagemodule'} = $haslanguagemodule;
2777
2778 # Important check: "ismultilingual" and "haslanguagemodule" must have the same value !
2730 }
2731
2732 $oneitem->{'modules'} = $modulegids;
2733 $oneitem->{'haslanguagemodule'} = $haslanguagemodule;
2734
2735 # Important check: "ismultilingual" and "haslanguagemodule" must have the same value !
2779 if (( $oneitem->{'ismultilingual'} ) && ( ! $oneitem->{'haslanguagemodule'} ))
2736 if ($oneitem->{'ismultilingual'} && ! $oneitem->{'haslanguagemodule'})
2780 {
2737 {
2781 $infoline = "Error: \"$oneitem->{'gid'}\" is multi lingual, but not in language pack (Assigned module: $modulegids)!\n";
2738 my $infoline = sprintf(
2739 "Error: \"%s\" is multi lingual, but not in language pack (Assigned module: %s)\n",
2740 $oneitem->{'gid'},
2741 $modulegids);
2782 $installer::logger::Global->print($infoline);
2742 $installer::logger::Global->print($infoline);
2783 push( @languageassignmenterrors, $infoline );
2743 push(@languageassignmenterrors, $infoline);
2784 $languageassignmenterror = 1;
2785 }
2744 $languageassignmenterror = 1;
2745 }
2786 if (( $oneitem->{'haslanguagemodule'} ) && ( ! $oneitem->{'ismultilingual'} ))
2746 elsif ($oneitem->{'haslanguagemodule'} && ! $oneitem->{'ismultilingual'})
2787 {
2747 {
2788 $infoline = "Error: \"$oneitem->{'gid'}\" is in language pack, but not multi lingual (Assigned module: $modulegids)!\n";
2748 my $infoline = sprintf(
2749 "Error: \"%s\" is in language pack, but not multi lingual (Assigned module: %s)\n",
2750 $oneitem->{'gid'},
2751 $modulegids);
2789 $installer::logger::Global->print($infoline);
2752 $installer::logger::Global->print($infoline);
2790 push( @languageassignmenterrors, $infoline );
2753 push(@languageassignmenterrors, $infoline);
2791 $languageassignmenterror = 1;
2792 }
2793 }
2794
2795 if ($languageassignmenterror)
2796 {
2797 for ( my $i = 0; $i <= $#languageassignmenterrors; $i++ ) { print "$languageassignmenterrors[$i]"; }
2798 installer::exiter::exit_program("ERROR: Incorrect assignments for language packs.", "assigning_modules_to_items");

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

2803#################################################################################################
2804# Root path (for instance /opt/openofficeorg20) needs to be added to directories, files and links
2805#################################################################################################
2806
2807sub add_rootpath_to_directories
2808{
2809 my ($dirsref, $rootpath) = @_;
2810
2754 $languageassignmenterror = 1;
2755 }
2756 }
2757
2758 if ($languageassignmenterror)
2759 {
2760 for ( my $i = 0; $i <= $#languageassignmenterrors; $i++ ) { print "$languageassignmenterrors[$i]"; }
2761 installer::exiter::exit_program("ERROR: Incorrect assignments for language packs.", "assigning_modules_to_items");

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

2766#################################################################################################
2767# Root path (for instance /opt/openofficeorg20) needs to be added to directories, files and links
2768#################################################################################################
2769
2770sub add_rootpath_to_directories
2771{
2772 my ($dirsref, $rootpath) = @_;
2773
2811 if ( $installer::globals::debug ) { installer::logger::debuginfo("installer::scriptitems::add_rootpath_to_directories : $#{$dirsref} : $rootpath"); }
2812
2813 for ( my $i = 0; $i <= $#{$dirsref}; $i++ )
2814 {
2815 my $onedir = ${$dirsref}[$i];
2816 my $dir = "";
2817
2818 if ( $onedir->{'Dir'} ) { $dir = $onedir->{'Dir'}; }
2819
2820 if (!($dir =~ /\bPREDEFINED_/ ))

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

2834 }
2835 }
2836}
2837
2838sub add_rootpath_to_files
2839{
2840 my ($filesref, $rootpath) = @_;
2841
2774 for ( my $i = 0; $i <= $#{$dirsref}; $i++ )
2775 {
2776 my $onedir = ${$dirsref}[$i];
2777 my $dir = "";
2778
2779 if ( $onedir->{'Dir'} ) { $dir = $onedir->{'Dir'}; }
2780
2781 if (!($dir =~ /\bPREDEFINED_/ ))

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

2795 }
2796 }
2797}
2798
2799sub add_rootpath_to_files
2800{
2801 my ($filesref, $rootpath) = @_;
2802
2842 if ( $installer::globals::debug ) { installer::logger::debuginfo("installer::scriptitems::add_rootpath_to_files : $#{$filesref} : $rootpath"); }
2843
2844 for ( my $i = 0; $i <= $#{$filesref}; $i++ )
2845 {
2846 my $onefile = ${$filesref}[$i];
2847 my $destination = $onefile->{'destination'};
2848 $destination = $rootpath . $installer::globals::separator . $destination;
2849 $onefile->{'destination'} = $destination;
2850 }
2851}
2852
2853sub add_rootpath_to_links
2854{
2855 my ($linksref, $rootpath) = @_;
2856
2803 for ( my $i = 0; $i <= $#{$filesref}; $i++ )
2804 {
2805 my $onefile = ${$filesref}[$i];
2806 my $destination = $onefile->{'destination'};
2807 $destination = $rootpath . $installer::globals::separator . $destination;
2808 $onefile->{'destination'} = $destination;
2809 }
2810}
2811
2812sub add_rootpath_to_links
2813{
2814 my ($linksref, $rootpath) = @_;
2815
2857 if ( $installer::globals::debug ) { installer::logger::debuginfo("installer::scriptitems::add_rootpath_to_links : $#{$linksref} : $rootpath"); }
2858
2859 for ( my $i = 0; $i <= $#{$linksref}; $i++ )
2860 {
2861 my $onelink = ${$linksref}[$i];
2862 my $styles = $onelink->{'Styles'};
2863
2864 my $destination = $onelink->{'destination'};
2865 $destination = $rootpath . $installer::globals::separator . $destination;
2866 $onelink->{'destination'} = $destination;

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

3121 }
3122
3123 if ( $isrequired ) { push(@alllinks, $onelink); }
3124 }
3125
3126 return \@alllinks;
3127}
3128
2816 for ( my $i = 0; $i <= $#{$linksref}; $i++ )
2817 {
2818 my $onelink = ${$linksref}[$i];
2819 my $styles = $onelink->{'Styles'};
2820
2821 my $destination = $onelink->{'destination'};
2822 $destination = $rootpath . $installer::globals::separator . $destination;
2823 $onelink->{'destination'} = $destination;

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

3078 }
3079
3080 if ( $isrequired ) { push(@alllinks, $onelink); }
3081 }
3082
3083 return \@alllinks;
3084}
3085
3086
3087
3088
3089=head2 print_script_item($item)
3090
3091 For debugging.
3092 Print the contents of the given script item to $installer::logger::Lang.
3093
3094=cut
3095sub print_script_item ($)
3096{
3097 my ($item) = @_;
3098
3099 $installer::logger::Lang->printf("script item %s\n", $item->{'uniquename'});
3100 foreach my $key (sort keys %$item)
3101 {
3102 my $value = $item->{$key};
3103 $value = "<undef>" unless defined $value;
3104 $installer::logger::Lang->printf(" %20s -> %s\n", $key, $value);
3105 }
3106}
3107
3108
31291;
31091;