scriptitems.pm (010ec03a) scriptitems.pm (c6dedb65)
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

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

30use installer::languages;
31use installer::logger;
32use installer::pathanalyzer;
33use installer::remover;
34use installer::systemactions;
35
36use File::Spec;
37use SvnRevision;
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

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

30use installer::languages;
31use installer::logger;
32use installer::pathanalyzer;
33use installer::remover;
34use installer::systemactions;
35
36use File::Spec;
37use SvnRevision;
38use ExtensionsLst;
38
39################################################################
40# Resolving the GID for the directories defined in setup script
41################################################################
42
43sub resolve_all_directory_names
44{
45 my ($directoryarrayref) = @_;

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

485 next;
486 }
487 push(@filesarray, $onefile);
488 }
489
490 return \@filesarray;
491}
492
39
40################################################################
41# Resolving the GID for the directories defined in setup script
42################################################################
43
44sub resolve_all_directory_names
45{
46 my ($directoryarrayref) = @_;

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

486 next;
487 }
488 push(@filesarray, $onefile);
489 }
490
491 return \@filesarray;
492}
493
494=head3 add_bundled_extension_blobs
495 Add entries for extension blobs to the global file list.
496 Extension blobs, unlike preregistered extensions, are not
497 extracted before included into a pack set.
498
499 The set of extensions to include is taken from the BUNDLED_EXTENSION_BLOBS
500 environment variable (typically set in configure.)
501
502 If that variable is not defined then the content of main/extensions.lst defines
503 the default set.
504
505 Extension blobs are placed in gid_Brand_Dir_Share_Extensions_Install.
506=cut
493sub add_bundled_extension_blobs
494{
495 my @filelist = @{$_[0]};
496
507sub add_bundled_extension_blobs
508{
509 my @filelist = @{$_[0]};
510
497 my $bundleenv = $ENV{'BUNDLED_EXTENSION_BLOBS'};
498 my $bundlesrc = $ENV{'TARFILE_LOCATION'};
499 my @bundle_files = split(/\s+/, $bundleenv, -1);
500 foreach my $filename ( @bundle_files) {
501 my $basename = File::Basename::basename( $filename);
502 my $onefile = {
503 'Dir' => 'gid_Brand_Dir_Share_Extensions_Install',
504 'Name' => $basename,
505 'Styles' => '(PACKED)',
506 'UnixRights' => '444',
507 'sourcepath' => $bundlesrc . $installer::globals::separator . $filename
508 };
509 push( @filelist, $onefile);
510 push( @installer::globals::logfileinfo, "\tbundling \"$filename\" extension\n");
511 }
511 my @bundle_files = ();
512 my $bundleenv = $ENV{'BUNDLED_EXTENSION_BLOBS'};
513 my $bundlesrc = $ENV{'TARFILE_LOCATION'};
514
515 if ($installer::globals::product =~ /(SDK|URE)/i )
516 {
517 # No extensions for the SDK.
518 }
519 elsif (defined $bundleenv)
520 {
521 # Use the list of extensions that was explicitly given to configure.
522 @bundle_files = split(/\s+/, $bundleenv, -1);
523 }
524 else
525 {
526 # Add the default rextensions for the current language set.
527 @bundle_files = ExtensionsLst::GetExtensionList("http|https", @installer::globals::languageproducts);
528 }
512
529
530 installer::logger::print_message(
531 sprintf("preparing %d extension blob%s for language%s %s:\n %s\n",
532 $#bundle_files + 1,
533 $#bundle_files!=0 ? "s" : "",
534 $#installer::globals::languageproducts!=0 ? "s" : "",
535 join(" ", @installer::globals::languageproducts),
536 join("\n ", @bundle_files)));
537
538 foreach my $filename ( @bundle_files)
539 {
540 my $basename = File::Basename::basename( $filename);
541 my $onefile = {
542 'Dir' => 'gid_Brand_Dir_Share_Extensions_Install',
543 'Name' => $basename,
544 'Styles' => '(PACKED)',
545 'UnixRights' => '444',
546 'sourcepath' => $bundlesrc . $installer::globals::separator . $filename,
547 'modules' => "gid_Module_Dictionaries",
548 'gid' => "gid_File_Extension_".$basename
549 };
550 push( @filelist, $onefile);
551 push( @installer::globals::logfileinfo, "\tbundling \"$filename\" extension\n");
552 }
553
513 return \@filelist;
514}
515
554 return \@filelist;
555}
556
557=head3 add_bundled_prereg_extensions
558 Add entries for preregistered extensions to the global file list.
559
560 The set of extensions to include is taken from the BUNDLED_PREREG_EXTENSIONS
561 environment variable (typically set in configure.)
562
563 If that variable is not defined then the content of main/extensions.lst defines
564 the default set.
565
566 Preregistered extensions are placed in subdirectories of gid_Brand_Dir_Share_Prereg_Bundled.
567=cut
516sub add_bundled_prereg_extensions
517{
518 my @filelist = @{$_[0]};
568sub add_bundled_prereg_extensions
569{
570 my @filelist = @{$_[0]};
571 my $dirsref = $_[1];
519
572
520 my $bundleenv = $ENV{'BUNDLED_PREREG_EXTENSIONS'};
521 my $bundlesrc = $ENV{'TARFILE_LOCATION'};
522 my @bundle_files = split(/\s+/, $bundleenv, -1);
523 foreach my $filename ( @bundle_files) {
524 my $basename = File::Basename::basename( $filename);
525 my $onefile = {
526 'Dir' => 'gid_Profileitem_Uno_Uno_Bundled_Extensions_Prereg',
527 'Name' => $basename,
528 'Styles' => '(PACKED,ARCHIVE)',
529 'UnixRights' => '444',
530 'sourcepath' => $bundlesrc . $installer::globals::separator . $filename
531 };
532 push( @filelist, $onefile);
533 push( @installer::globals::logfileinfo, "\tbundling \"$filename\" extension\n");
534 }
573 my @bundle_files = ();
574 my $bundleenv = $ENV{'BUNDLED_PREREG_EXTENSIONS'};
575
576 if ($installer::globals::product =~ /(SDK|URE)/i )
577 {
578 # No extensions for the SDK.
579 }
580 elsif (defined $bundleenv)
581 {
582 # Use the list of extensions that was explicitly given to configure.
583 @bundle_files = split(/\s+/, $bundleenv, -1);
584 }
585 else
586 {
587 # Add the default rextensions for the current language set.
588 @bundle_files = ExtensionsLst::GetExtensionList("file", @installer::globals::languageproducts);
589 }
535
590
536 return \@filelist;
591 installer::logger::print_message(
592 sprintf("preparing %d bundled extension%s for language%s %s:\n %s\n",
593 $#bundle_files + 1,
594 $#bundle_files!=0 ? "s" : "",
595 $#installer::globals::languageproducts!=0 ? "s" : "",
596 join(" ", @installer::globals::languageproducts),
597 join("\n ", @bundle_files)));
598
599 # Find the prereg directory entry so that we can create a new sub-directory.
600 my $parentdir_gid = "gid_Brand_Dir_Share_Prereg_Bundled";
601 my $parentdir = undef;
602 foreach my $dir (@{$dirsref})
603 {
604 if ($dir->{'gid'} eq $parentdir_gid)
605 {
606 $parentdir = $dir;
607 last;
608 }
609 }
610
611 foreach my $filename ( @bundle_files)
612 {
613 my $basename = File::Basename::basename( $filename);
614
615 # Create a new directory into which the extension will be installed.
616 my $dirgid = $parentdir_gid . "_" . $basename;
617 my $onedir = {
618 'modules' => 'gid_Module_Root_Brand',
619 'ismultilingual' => 0,
620 'Styles' => '(CREATE)',
621 'ParentID' => $parentdir_gid,
622 'specificlanguage' => "",
623 'haslanguagemodule' => 0,
624 'gid' => $dirgid,
625 'HostName' => $parentdir->{'HostName'} . $installer::globals::separator . $basename
626 };
627 push (@{$dirsref}, $onedir);
628
629 # Create a new file entry for the extension.
630 my $onefile = {
631 'Dir' => $dirgid,
632 'Name' => $basename,
633 'Styles' => '(PACKED,ARCHIVE)',
634 'UnixRights' => '444',
635 'sourcepath' => File::Spec->catfile($ENV{'OUTDIR'}, "bin", $filename),
636 'specificlanguage' => "",
637 'modules' => "gid_Module_Dictionaries",
638 'gid' => "gid_File_Extension_".$basename
639 };
640 push( @filelist, $onefile);
641 push( @installer::globals::logfileinfo, "\tbundling \"$filename\" extension\n");
642 }
643
644 return (\@filelist, $dirsref);
537}
538
539################################################################################
540# Looking for directories without correct HostName
541################################################################################
542
543sub checking_directories_with_corrupt_hostname
544{

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

2174 $directoryhash{'Dir'} = $onefile->{'Dir'};
2175 $directoryhash{'modules'} = $onefile->{'modules'}; # NEW, saving modules
2176 # NEVER!!! if ( ! $installer::globals::iswindowsbuild ) { $directoryhash{'Styles'} = "(CREATE)"; } # this directories must be created
2177
2178 $alldirectoryhash{$destinationpath} = \%directoryhash;
2179 }
2180 else
2181 {
645}
646
647################################################################################
648# Looking for directories without correct HostName
649################################################################################
650
651sub checking_directories_with_corrupt_hostname
652{

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

2282 $directoryhash{'Dir'} = $onefile->{'Dir'};
2283 $directoryhash{'modules'} = $onefile->{'modules'}; # NEW, saving modules
2284 # NEVER!!! if ( ! $installer::globals::iswindowsbuild ) { $directoryhash{'Styles'} = "(CREATE)"; } # this directories must be created
2285
2286 $alldirectoryhash{$destinationpath} = \%directoryhash;
2287 }
2288 else
2289 {
2182 # Adding the modules to the module list!
2290 # Adding the modules to the module list!
2183 $alldirectoryhash{$destinationpath}->{'modules'} = $alldirectoryhash{$destinationpath}->{'modules'} . "," . $onefile->{'modules'};
2184 }
2185 }
2186 }
2187 else
2188 {
2189 # Adding the modules to the module list!
2190 $alldirectoryhash{$destinationpath}->{'modules'} = $alldirectoryhash{$destinationpath}->{'modules'} . "," . $onefile->{'modules'};

--- 817 unchanged lines hidden ---
2291 $alldirectoryhash{$destinationpath}->{'modules'} = $alldirectoryhash{$destinationpath}->{'modules'} . "," . $onefile->{'modules'};
2292 }
2293 }
2294 }
2295 else
2296 {
2297 # Adding the modules to the module list!
2298 $alldirectoryhash{$destinationpath}->{'modules'} = $alldirectoryhash{$destinationpath}->{'modules'} . "," . $onefile->{'modules'};

--- 817 unchanged lines hidden ---