Changeset 35233


Ignore:
Timestamp:
2021-07-27T17:12:00+12:00 (2 months ago)
Author:
anupama
Message:

Extending changes of commits 35213-35215 as they broke diffcol on Linux (yet strangely not on Windows): diffcol exports empty GSDL3SRCHOME (and GSDLHOME) variable. This ends up as defined but with no value. After commit revisions 35213-35215 the import, buildcol (and activate) scripts test whether these variables are defined (which they are even for GS2 when diffcol runs) and then sets the site variable to localsite. Need to test these variables aren't just defined but also not empty string before setting site to localsite, in order for diffcol testing, which runs on GS2 installs, to still work.

Location:
main/trunk/greenstone2/bin/script
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone2/bin/script/activate.pl

    r35215 r35233  
    186186
    187187    ## shortcut - if gsdl3srchome is set, and site is not set, set site to localsite
    188     if (defined $ENV{'GSDL3SRCHOME'}) {
     188    ## But need to check gsdl3srchome not empty even if defined, as that can
     189    ## happen when nightly diffcol is run and doesn't mean it's a GS3 install
     190    if (defined $ENV{'GSDL3SRCHOME'} && $ENV{'GSDL3SRCHOME'} ne "") {
    189191        if (!defined $site || $site eq "") {
    190192        $site = "localsite";
  • main/trunk/greenstone2/bin/script/buildcol.pl

    r35214 r35233  
    357357
    358358        ## shortcut - if gsdl3srchome is set, and site is not set, set site to localsite
    359         if (defined $ENV{'GSDL3SRCHOME'}) {
     359    ## But need to check gsdl3srchome not empty even if defined, as that can
     360    ## happen when nightly diffcol is run and doesn't mean it's a GS3 install
     361    if (defined $ENV{'GSDL3SRCHOME'} && $ENV{'GSDL3SRCHOME'} ne "") {
    360362            if (!defined $buildcolutils->{'site'} || $buildcolutils->{'site'} eq "") {
    361363                $buildcolutils->{'site'} = "localsite";
  • main/trunk/greenstone2/bin/script/import.pl

    r35213 r35233  
    229229   
    230230    ## shortcut - if gsdl3srchome is set, and site is not set, set site to localsite
    231     if (defined $ENV{'GSDL3SRCHOME'}) {
     231    ## But need to check gsdl3srchome not empty even if defined, as that can
     232    ## happen when nightly diffcol is run and doesn't mean it's a GS3 install
     233    if (defined $ENV{'GSDL3SRCHOME'} && $ENV{'GSDL3SRCHOME'} ne "") {
    232234        if (!defined $inexport->{'site'} || $inexport->{'site'} eq "") {
    233235        $inexport->{'site'} = "localsite";
Note: See TracChangeset for help on using the changeset viewer.