Changeset 31876

Show
Ignore:
Timestamp:
11.08.2017 16:13:34 (2 years ago)
Author:
ak19
Message:

1. Getting the recently added util::print_env() subroutine, which has now already helped in debugging a 2nd issue, to work on Windows. Keeping the same changes for linux too. 2. Dr Bainbridge said that single quoting the string https in dictionary props files would be better.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone2/perllib/util.pm

    r31863 r31876  
    586586     
    587587    if (scalar(@envvars) == 0) { 
    588     #print $handle "@@@ All env vars requested\n";     
    589      
    590     my $output; 
    591     if (defined $ENV{'GSDLOS'} && $ENV{'GSDLOS'} =~ m/windows/) { 
    592         $output = `set`; 
    593     } 
    594     else { 
    595         $output = `env`; 
    596     } 
    597      
    598     print $handle "@@@ Environment was:\n********\n$output\n********\n"; 
     588        #print $handle "@@@ All env vars requested\n";     
     589         
     590        my $output = ""; 
     591 
     592        print $handle "@@@ Environment was:\n********\n";        
     593        foreach my $envvar (sort keys(%ENV)) { 
     594            if(defined $ENV{$envvar}) { 
     595                print $handle "\t$envvar = $ENV{$envvar}\n"; 
     596            } else { 
     597            print $handle "\t$envvar = \n"; 
     598            }    
     599        } 
     600        print $handle "********\n";  
    599601    } else { 
    600602    print $handle "@@@ Environment was:\n********\n"; 
     
    602604        if(defined $ENV{$envvar}) { 
    603605        print $handle "\t$envvar = ".$ENV{$envvar}."\n"; 
    604         } else { 
    605         $envvar = uc($envvar); 
    606         if(defined $ENV{$envvar}) { 
    607             print $handle "\t$envvar = ".$ENV{$envvar}."\n"; 
    608         } else { 
    609             print $handle "Env var $envvar was not set\n"; 
    610         } 
     606        } else {         
     607            print $handle "Env var '$envvar' was not set\n";         
    611608        } 
    612609    }