#!<> use INSTALL::common; use INSTALL::global; use INSTALL::parameter; use INSTALL::os; use INSTALL::query; use INSTALL::ini; #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # Internal functions #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ my $pParameters = \%INSTALL::parameter::variables; #============================================================================== #------------------------ Default global values #============================================================================== $pParameters->{asphome} = "<>"; $pParameters->{com_layer} = "<>"; INSTALL::common::set_standard_globals; my $pGlobals = \%INSTALL::global::variables; my $pOS = \%INSTALL::os::Details; #============================================================================== #------------------------ Configure any available components. #============================================================================== my %components; if (exists($pParameters->{components_dir})) { $pGlobals->{components_dir} = $pParameters->{components_dir}; } local *DIR; if (opendir(DIR,$pGlobals->{components_dir})) { my @components = readdir(DIR); closedir(DIR); foreach(@components) { next if (($_ eq ".") || ($_ eq "..")); my $component_name = $_; my $component_dir = "$pGlobals->{components_dir}/$component_name"; if (-f "$component_dir/component.ini") { my $pIni = INSTALL::ini::open("$component_dir/component.ini"); if (grep { $_ eq "Descriptor" } INSTALL::ini::getSectionNames($pIni)) { my $pSection = INSTALL::ini::openSection($pIni,"Descriptor"); if (exists $pSection->{name}) { $components{$pSection->{name}} = $component_dir; } else { note("Discovered component '$component_name' without name in [Descriptor] section", "of its 'component.ini'."); } } else { note("Discovered component '$component_name' without a 'component.ini'."); $components{$component_name} = $component_dir; } } elsif (-d $component_dir) { note("Discovered component '$component_name' without an installation script."); } } } my @component_list = keys %components; my $component = INSTALL::query::user_menu ("INSTALL COMPONENTS", "The following Sun Chili!Soft components are available for install.", "Component to install", (map { "$_." } @component_list), "All components.", "default=Cancel install."); my $max_index = $#component_list + 1; my @install_list; if ($component <= $max_index) { push @install_list, $component_list[$component - 1]; } elsif ($component == ($max_index + 1)) { @install_list = @component_list; } if ($#install_list >= 0) { my $result = 1; foreach(@install_list) { my $component_name = $_; my $component_dir = $components{$component_name}; if ((not -f "$component_dir/install.pl") || system("$pGlobals->{perl} -I$pGlobals->{asphome} -I$component_dir $component_dir/install.pl ". "\"component_dir=$component_dir\" \"asphome=$pGlobals->{asphome}\" ". "\"component_name=$component_name\" $pGlobals->{execute_params}")) { report(""); note("The $component_name component returned failure."); report("Cause: ", "While this may indicate a failure during installation, it may also", "indicate that the user opted not to install the specified component.", "In the former case, error messages would have been displayed prior", "to this message."); report("Press enter to continue ..."); ; $result = undef; } } if ($result) { report("The installation was completely successful."); } else { report("The installation contained failures."); } } else { report("Installation canceled."); }