Ignore:
Timestamp:
2019-04-12T19:36:30+12:00 (2 years ago)
Author:
ak19
Message:

On Ubuntu 18.04, confirmed Renate's findings that gsdlCGI.pm wasn't found by gliserver.pl in its @INC paths. Have now added the containing cgi-bin folder on GS2 and cgi folder on GS3 to @INC to teach gliserver.pl to find gsdlCGI.pm. This however needed a fix in build.xml where force-start-tomcat was passing the wrong value for GSDL3HOME to tomcat: it was passing in basedir instead of web.home. With this fix, gliserver.pl now works on Ubuntu 18.04. Have added lines identical to the changes in gliserver.pl to the other pl files in the cgi(-bin) folder for those pl files that similarly import gsdlCGI.pm.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone2/common-src/cgi-bin/index-server.pl

    r24872 r33011  
    1111    Win32::SetChildShowWindow(0)
    1212    if defined &Win32::SetChildShowWindow;
     13
     14    # On Ubuntu 18.04, gsdlCGI.pm can't be found as the cgi folder is not among @INC paths.
     15    # Ensure gsdlCGI.pm is available in @INC by adding the cgi folder to it.
     16    # For GS2:
     17    my $gsdl_cgi_path = $ENV{'GSDLHOME'} . "/cgi-bin";
     18    # For GS3:
     19    $gsdl_cgi_path = $ENV{'GSDL3HOME'} . "/WEB-INF" . "/cgi" if defined $ENV{'GSDL3HOME'};
     20
     21    my $found_cgi_path = 0;
     22    foreach my $inc_path (@INC) {
     23        if($inc_path eq $gsdl_cgi_path) {
     24                $found_cgi_path = 1;
     25                last;
     26        }
     27    }
     28    if(!$found_cgi_path) {
     29      unshift (@INC, $gsdl_cgi_path);
     30    }
    1331}
    1432
Note: See TracChangeset for help on using the changeset viewer.