Changeset 16509

Show
Ignore:
Timestamp:
22.07.2008 13:41:28 (11 years ago)
Author:
ak19
Message:

Better processing of perlpath property so that it no longer needs to be uncommented when used.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • gsdl/trunk/cgi-bin/gsdlCGI.pm

    r16467 r16509  
    297297sub get_perl_path { 
    298298    my $self = shift @_; 
     299    my ($optional) = @_; 
    299300     
    300301    if (defined $self->{'perlpath'}) { 
     
    302303    } 
    303304 
    304     my $perlpath = $self->get_config_info("perlpath"); 
     305    my $perlpath = $self->get_config_info("perlpath", $optional); 
    305306 
    306307    if(defined $perlpath) { 
     
    440441    &util::envvar_append("PATH",$gsdl_bin_os); 
    441442     
    442     # Perl comes installed with the GS Windows Release Kit.  
    443     # However, if GS is from SVN, the user must have their own Perl and put it on the path. 
    444     my $perl_bin_dir; # undefined 
    445     if ($gsdlos eq "windows") { 
     443    # If the "perlpath" property is set in the gsdl(3)site.cfg config file, it is 
     444    # prepended to PATH only if the same perl bin dir path is not already on PATH env 
     445    my $perl_bin_dir = $self->get_perl_path($optional); 
     446    if(defined $perl_bin_dir)  
     447    { 
     448    &util::envvar_prepend("PATH", $perl_bin_dir);    
     449    } 
     450    elsif ($gsdlos eq "windows")  
     451    { 
     452    # Perl comes installed with the GS Windows Release Kit. However, note that if GS  
     453    # is from SVN, the user must have their own Perl and put it on the PATH or set 
     454    # perlpath in the gsdl site config file. 
    446455    $perl_bin_dir = &util::filename_cat($gsdlhome, "bin", "windows", "perl", "bin"); 
    447456    if(-e $perl_bin_dir) { 
     
    449458    } 
    450459    } 
    451  
    452     # Uncomment these lines if you want to read the "perlpath" property from 
    453     # the gsdl(3)site.cfg config file into PATH 
    454     #if(!defined $perl_bin_dir) { 
    455     #$perl_bin_dir = $self->get_perl_path(); 
    456     #&util::envvar_append("PATH", $perl_bin_dir); 
    457     #} 
    458      
    459     # gsdl(3)site.cfg can specify JAVA_HOME and FEDORA_HOME along with Fedora's version. Both 
    460     # are needed (by scripts g2f-import and g2f-buildcol) when using Greenstone 2 with Fedora. 
    461     if(!defined $ENV{'JAVA_HOME'}) { 
    462     $ENV{'JAVA_HOME'} = $self->get_java_home($optional); 
    463     } 
    464  
     460     
     461    # If javahome is explicitly set in the gsdl site config file then it will override 
     462    # any env variable JAVA_HOME. A GS2 server does not set JAVA_HOME, though java is on 
     463    # the path. Therefore, if Fedora is being used for FLI with GS2, then javahome must  
     464    # be set in gsdlsite.cfg or the JAVA_HOME env var must be explicitly set by the user. 
     465    my $java_home = $self->get_java_home($optional); 
     466    if(defined $java_home) { 
     467    $ENV{'JAVA_HOME'} = $java_home; 
     468    } 
     469 
     470    # FEDORA_HOME and FEDORA_VERSION are needed (by scripts g2f-import and g2f-buildcol). 
    465471    $self->setup_fedora_homes($optional); 
    466472}