Changeset 19252

Show
Ignore:
Timestamp:
24.04.2009 15:27:18 (10 years ago)
Author:
ak19
Message:

Had to change the way $lang_env was set for the context of the $java_command that is to be executed, so that it will still work on Windows (it broke on Windows). It no longer prefixes LANG=$lang_env to the $java_command, but sets the $ENV{LANG} instead since the various gliserver.pl subroutines/commands are not persistent (a gsdlCGI object is setup for each command, and so the environment gets reset for each.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • gsdl/trunk/cgi-bin/gliserver.pl

    r19233 r19252  
    520520    $java_args .= " gsdl3"; ## must this be done elsewhere as well? 
    521521    } 
    522     my $java_command = "LANG=$lang_env \"$java\" -classpath \"$java_classpath\" org.greenstone.gatherer.remote.ZipCollectionShell $java_args";  
     522 
     523    $ENV{'LANG'} = $lang_env; 
     524    my $java_command = "\"$java\" -classpath \"$java_classpath\" org.greenstone.gatherer.remote.ZipCollectionShell $java_args";  
    523525 
    524526    my $java_output = `$java_command`; 
     
    570572    my $zip_file_path = &util::filename_cat($collect_directory, $collection . "-archives-" . $timestamp . ".zip"); 
    571573    my $java_args = "\"$zip_file_path\" \"$collect_directory\" \"$collection\""; 
    572     my $java_command = "LANG=$lang_env \"$java\" -classpath \"$java_classpath\" org.greenstone.gatherer.remote.ZipCollectionArchives $java_args";  
     574    $ENV{'LANG'} = $lang_env; 
     575    my $java_command = "\"$java\" -classpath \"$java_classpath\" org.greenstone.gatherer.remote.ZipCollectionArchives $java_args";  
    573576 
    574577    my $java_output = `$java_command`; 
     
    608611    my $zip_file_path = &util::filename_cat($collect_directory, "collection-configurations-" . $timestamp . ".zip"); 
    609612    my $java_args = "\"$zip_file_path\" \"$collect_directory\" \"$username\" \"$user_groups\""; 
    610     my $java_command = "LANG=$lang_env \"$java\" -classpath \"$java_classpath\" org.greenstone.gatherer.remote.ZipCollectionConfigurations $java_args";  
     613    $ENV{'LANG'} = $lang_env; 
     614    my $java_command = "\"$java\" -classpath \"$java_classpath\" org.greenstone.gatherer.remote.ZipCollectionConfigurations $java_args";  
    611615    my $java_output = `$java_command`; 
    612616    my $java_status = $?; 
     
    699703    my $zip_file_path = &util::filename_cat($collection_directory, $collection . "-file-" . $timestamp . ".zip"); 
    700704    my $java_args = "\"$zip_file_path\" \"$collection_directory\" \"$file\""; 
    701     my $java_command = "LANG=$lang_env \"$java\" -classpath \"$java_classpath\" org.greenstone.gatherer.remote.ZipFiles $java_args";  
     705    $ENV{'LANG'} = $lang_env; 
     706    my $java_command = "\"$java\" -classpath \"$java_classpath\" org.greenstone.gatherer.remote.ZipFiles $java_args";  
    702707 
    703708    my $java_output = `$java_command`; 
     
    751756    my $zip_file_path = &util::filename_cat($web_inf_directory, "webxml" . $timestamp . ".zip"); 
    752757    my $java_args = "\"$zip_file_path\" \"$web_inf_directory\" \"$file\""; 
    753     my $java_command = "LANG=$lang_env \"$java\" -classpath \"$java_classpath\" org.greenstone.gatherer.remote.ZipFiles $java_args";  
     758    $ENV{'LANG'} = $lang_env; 
     759    my $java_command = "\"$java\" -classpath \"$java_classpath\" org.greenstone.gatherer.remote.ZipFiles $java_args";  
    754760    my $java_output = `$java_command`; 
    755761 
     
    11601166    my $java_classpath = &util::filename_cat($ENV{'GSDLHOME'}, "bin", "java", "GLIServer.jar"); 
    11611167    my $java_args = "\"$file_path\" \"$directory_path\""; 
    1162     my $java_command = "LANG=$lang_env \"$java\" -classpath \"$java_classpath\" org.greenstone.gatherer.remote.Unzip $java_args";  
     1168    $ENV{'LANG'} = $lang_env; 
     1169    my $java_command = "\"$java\" -classpath \"$java_classpath\" org.greenstone.gatherer.remote.Unzip $java_args";  
    11631170    my $java_output = `$java_command`; 
    11641171    my $java_status = $?;