Changeset 16461

Show
Ignore:
Timestamp:
18.07.2008 15:23:16 (11 years ago)
Author:
ak19
Message:

1. FEDORA_VERSION has become the secondary environment variable when running FLI. It has replaced FEDORA2_HOME/FEDORA3_HOME. 2. When FEDORA_HOME is set but not FEDORA_VERSION, it will default to FEDORA_VERSION being 3. This is done here order to keep it in sync with running FLI locally with the fli.bat/fli.sh scripts.

Location:
greenstone3/trunk/web/WEB-INF/cgi
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • greenstone3/trunk/web/WEB-INF/cgi/gliserver.pl

    r16441 r16461  
    377377    $installation_status .= "JAVA_HOME: " . $ENV{'JAVA_HOME'} . "\n" if defined($ENV{'JAVA_HOME'}); # on GS2, Java's only on the PATH 
    378378    $installation_status .= "PATH: " . $ENV{'PATH'} . "\n"; 
    379     $installation_status .= "FEDORA_HOME: ".$ENV{'FEDORA_HOME'} if defined($ENV{'FEDORA_HOME'}); 
     379    if(defined $ENV{'FEDORA_VERSION'}) { # not using FLI unless version set 
     380    $installation_status .= "FEDORA_HOME: ".$ENV{'FEDORA_HOME'} . "\n"; 
     381    $installation_status .= "FEDORA_VERSION: ".$ENV{'FEDORA_VERSION'}; 
     382    } 
    380383     
    381     if (defined $ENV{'FEDORA2_HOME'}) { 
    382     $installation_status .= "\nFEDORA2_HOME: ".$ENV{'FEDORA2_HOME'}."\n"; 
    383     } elsif (defined $ENV{'FEDORA3_HOME'}) { 
    384     $installation_status .= "\nFEDORA3_HOME: ".$ENV{'FEDORA3_HOME'}."\n"; 
    385     } 
    386  
    387384    if ($installation_ok) { ## M. Dewsnip's svn log comment stated that for iis6_mode output needs to go to STDOUT 
    388385    if($iis6_mode && $gsdl_cgi->greenstone_version() == 2) { 
  • greenstone3/trunk/web/WEB-INF/cgi/gsdlCGI.pm

    r16415 r16461  
    367367    my ($optional) = @_; 
    368368 
    369     # The following will still allow the ENV FEDORA_HOME variables to have been set outside  
    370     # the gsdlsite.cfg file. Existing env vars are only overwritten if they've *also* been 
    371     # defined in gsdlsite.cfg. 
    372     if(!defined $self->{'fedora_home'} && !defined $self->{'fedora_version'})  
     369    # The following will still allow the FEDORA_HOME and FEDORA_VERSION environment  
     370    # variables to have been set outside the gsdlsite.cfg file. Existing env vars  
     371    # are only overwritten if they've *also* been defined in gsdlsite.cfg. 
     372 
     373    if (!defined $self->{'fedora_home'}) # Don't need to go through it all again if we'd already done this before 
    373374    { 
    374     # Can look for any fedorahome properties defined in the gsdlsite.cfg file 
     375    # First look in the gsdlsite.cfg file for the fedora properties to be defined 
     376    # and set $ENV{FEDORA_HOME} and $ENV{FEDORA_VERSION} if values were provided 
    375377    $self->{'fedora_home'} = $self->get_config_info("fedorahome", $optional); 
    376     $self->{'fedora_version'} = $self->get_config_info("fedoraversion", $optional); 
    377378     
    378     if(defined $self->{'fedora_home'} && defined $self->{'fedora_version'})  
    379     { 
    380         # need to set $ENV{FEDORA2_HOME} or $ENV{FEDORA3_HOME} *and* $ENV{FEDORA_HOME} 
    381         my $env_name = "FEDORA".$self->{'fedora_version'}."_HOME"; 
    382         $ENV{$env_name} = $self->{'fedora_home'}; 
     379    if (defined $self->{'fedora_home'}) { 
    383380        $ENV{'FEDORA_HOME'} = $self->{'fedora_home'};  
    384381    }  
    385  
    386     # if none were specified in the file, use the ENV vars if FEDORA_HOME is already set there 
    387     elsif(defined $ENV{'FEDORA_HOME'})  
    388     {  
     382    elsif (defined $ENV{'FEDORA_HOME'}) { # check environment variable 
    389383        $self->{'fedora_home'} = $ENV{'FEDORA_HOME'}; 
    390         if(defined $ENV{'FEDORA2_HOME'} && ($ENV{'FEDORA_HOME'} eq $ENV{'FEDORA2_HOME'}))  
    391         { 
    392         $self->{'fedora_version'} = 2; 
     384    } 
     385     
     386    # if FEDORA_HOME is now defined, we can look for the fedora version that is being used 
     387    if (defined $ENV{'FEDORA_HOME'})  
     388    { 
     389        # first look in the file 
     390        $self->{'fedora_version'} = $self->get_config_info("fedoraversion", $optional); 
     391 
     392        if (defined $self->{'fedora_version'}) { 
     393        $ENV{'FEDORA_VERSION'} = $self->{'fedora_version'}; 
    393394        }  
    394         else # try defaulting to Fedora 3 
    395         {  
    396         print STDERR "Setting FEDORA3_HOME env variable to FEDORA_HOME (".$ENV{'FEDORA_HOME'}.").\n"; 
    397         $self->{'fedora_version'} = 3;  
    398         $ENV{'FEDORA3_HOME'} = $ENV{'FEDORA_HOME'}; 
     395        elsif (defined $ENV{'FEDORA_VERSION'}) { # then check environment variable 
     396        $self->{'fedora_version'} = $ENV{'FEDORA_VERSION'}; 
     397        }  
     398        else { # finally, default to version 3 and warn the user 
     399        $ENV{'FEDORA_VERSION'} = "3"; 
     400        $self->{'fedora_version'} = $ENV{'FEDORA_VERSION'}; 
     401        #$self->generate_ok_message("FEDORA_HOME is set, but not FEDORA_VERSION, defaulted to: 3."); 
    399402        } 
    400403    }