Changeset 33011


Ignore:
Timestamp:
2019-04-12T19:36:30+12:00 (5 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.

Location:
main/trunk
Files:
11 edited

Legend:

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

    r24872 r33011  
    1212    Win32::SetChildShowWindow(0)
    1313    if defined &Win32::SetChildShowWindow;
     14   
     15    # On Ubuntu 18.04, gsdlCGI.pm can't be found as the cgi folder is not among @INC paths.
     16    # Ensure gsdlCGI.pm is available in @INC by adding the cgi folder to it.
     17    # For GS2:
     18    my $gsdl_cgi_path = $ENV{'GSDLHOME'} . "/cgi-bin";
     19    # For GS3:
     20    $gsdl_cgi_path = $ENV{'GSDL3HOME'} . "/WEB-INF" . "/cgi" if defined $ENV{'GSDL3HOME'};
     21
     22    my $found_cgi_path = 0;
     23    foreach my $inc_path (@INC) {
     24        if($inc_path eq $gsdl_cgi_path) {
     25                $found_cgi_path = 1;
     26                last;
     27        }
     28    }
     29    if(!$found_cgi_path) {
     30      unshift (@INC, $gsdl_cgi_path);
     31    }
    1432}
    1533
  • main/trunk/greenstone2/common-src/cgi-bin/document-extract.pl

    r28242 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'};
    1320
     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    }
    1431}
    1532
  • main/trunk/greenstone2/common-src/cgi-bin/experimental-ocr-server.pl

    r24872 r33011  
    1414    Win32::SetChildShowWindow(0)
    1515    if defined &Win32::SetChildShowWindow;
     16   
     17    # On Ubuntu 18.04, gsdlCGI.pm can't be found as the cgi folder is not among @INC paths.
     18    # Ensure gsdlCGI.pm is available in @INC by adding the cgi folder to it.
     19    # For GS2:
     20    my $gsdl_cgi_path = $ENV{'GSDLHOME'} . "/cgi-bin";
     21    # For GS3:
     22    $gsdl_cgi_path = $ENV{'GSDL3HOME'} . "/WEB-INF" . "/cgi" if defined $ENV{'GSDL3HOME'};
    1623
     24    my $found_cgi_path = 0;
     25    foreach my $inc_path (@INC) {
     26        if($inc_path eq $gsdl_cgi_path) {
     27                $found_cgi_path = 1;
     28                last;
     29        }
     30    }
     31    if(!$found_cgi_path) {
     32      unshift (@INC, $gsdl_cgi_path);
     33    }
    1734}
    1835
  • main/trunk/greenstone2/common-src/cgi-bin/explode-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
  • main/trunk/greenstone2/common-src/cgi-bin/gliserver.pl

    r32921 r33011  
    1414    if defined &Win32::SetChildShowWindow;
    1515
     16    # On Ubuntu 18.04, gsdlCGI.pm can't be found as the cgi folder is not among @INC paths.
     17    # Ensure gsdlCGI.pm is available in @INC by adding the cgi folder to it.
     18    # For GS2:
     19    my $gsdl_cgi_path = $ENV{'GSDLHOME'} . "/cgi-bin";
     20    # For GS3:
     21    $gsdl_cgi_path = $ENV{'GSDL3HOME'} . "/WEB-INF" . "/cgi" if defined $ENV{'GSDL3HOME'};
     22
     23    my $found_cgi_path = 0;
     24    foreach my $inc_path (@INC) {
     25        if($inc_path eq $gsdl_cgi_path) {
     26                $found_cgi_path = 1;
     27                last;
     28        }
     29    }
     30    if(!$found_cgi_path) {
     31      unshift (@INC, $gsdl_cgi_path);
     32    }
    1633}
    1734
  • main/trunk/greenstone2/common-src/cgi-bin/image-server.pl

    r24872 r33011  
    44
    55use strict;
     6
     7
     8BEGIN {
     9    # On Ubuntu 18.04, gsdlCGI.pm can't be found as the cgi folder is not among @INC paths.
     10    # Ensure gsdlCGI.pm is available in @INC by adding the cgi folder to it.
     11    # For GS2:
     12    my $gsdl_cgi_path = $ENV{'GSDLHOME'} . "/cgi-bin";
     13    # For GS3:
     14    $gsdl_cgi_path = $ENV{'GSDL3HOME'} . "/WEB-INF" . "/cgi" if defined $ENV{'GSDL3HOME'};
     15
     16    my $found_cgi_path = 0;
     17    foreach my $inc_path (@INC) {
     18        if($inc_path eq $gsdl_cgi_path) {
     19                $found_cgi_path = 1;
     20                last;
     21        }
     22    }
     23    if(!$found_cgi_path) {
     24      unshift (@INC, $gsdl_cgi_path);
     25    }
     26}
    627
    728
  • 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
  • main/trunk/greenstone2/common-src/cgi-bin/metadata-server.pl

    r27318 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'};
    1320
     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    }
    1431}
    1532
  • main/trunk/greenstone2/common-src/cgi-bin/talkback-progressbar.pl

    r23520 r33011  
    1313
    1414BEGIN {
     15
     16    # On Ubuntu 18.04, gsdlCGI.pm can't be found as the cgi folder is not among @INC paths.
     17    # Ensure gsdlCGI.pm is available in @INC by adding the cgi folder to it.
     18    # For GS2:
     19    my $gsdl_cgi_path = $ENV{'GSDLHOME'} . "/cgi-bin";
     20    # For GS3:
     21    $gsdl_cgi_path = $ENV{'GSDL3HOME'} . "/WEB-INF" . "/cgi" if defined $ENV{'GSDL3HOME'};
     22
     23    my $found_cgi_path = 0;
     24    foreach my $inc_path (@INC) {
     25        if($inc_path eq $gsdl_cgi_path) {
     26                $found_cgi_path = 1;
     27                last;
     28        }
     29    }
     30    if(!$found_cgi_path) {
     31      unshift (@INC, $gsdl_cgi_path);
     32    }
    1533   
    1634    $|=1; # Force auto-flushing for output
    17 
     35   
    1836    eval('require "./gsdlCGI.pm"');
    1937    if ($@)
  • main/trunk/greenstone2/common-src/cgi-bin/talkback-transfer.pl

    r23518 r33011  
    1212
    1313BEGIN {
     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    }
     31   
    1432    eval('require "./gsdlCGI.pm"');
    1533    if ($@)
  • main/trunk/greenstone3/build.xml

    r33004 r33011  
    24332433    <exec executable="${sudo.or.not}" os="${os.unix}" dir="${catalina.home}/bin" spawn="false">
    24342434      <!--<env key="GSDLOS" value="linux"/> do we need this?? -->
    2435       <env key="GSDL3HOME" value="${basedir}"/>
     2435      <env key="GSDL3HOME" value="${web.home}"/>
    24362436      <env key="PATH" path="${tomcat.path}"/>
    24372437      <env key="CATALINA_OPTS" value="${catalina.opts}"/>
     
    24462446    <exec executable="${catalina.home}/bin/startup.bat" osfamily="windows" dir="${catalina.home}/bin" spawn="true">
    24472447      <env key="GSDLOS" value="windows"/>
    2448       <env key="GSDL3HOME" value="${basedir}"/>
     2448      <env key="GSDL3HOME" value="${web.home}"/>
    24492449      <env key="Path" path="${tomcat.path}"/>
    24502450      <env key="PATH" path="${tomcat.path}"/>
Note: See TracChangeset for help on using the changeset viewer.