Ignore:
Timestamp:
2008-07-10T11:15:53+12:00 (16 years ago)
Author:
ak19
Message:

Calls to execute java nested inside quotes in case the path to java contains spaces. This now works on Windows.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • greenstone3/trunk/web/WEB-INF/cgi/gliserver.pl

    r16248 r16326  
    211211    my $java_args = &util::filename_cat($gsdl3srchome, "web", "sites", $site, "etc", "usersDB");
    212212    $gsdl_cgi->checked_chdir($java_args);
    213     my $java_command="$java -classpath \"$java_classpath\" org.greenstone.gsdl3.util.usersDB2txt \"$java_args\" 2>&1";
     213    my $java_command="\"$java\" -classpath \"$java_classpath\" org.greenstone.gsdl3.util.usersDB2txt \"$java_args\" 2>&1";
    214214    $users_db_content = `$java_command`;
    215215    }
     
    347347    # Check that Java is installed and accessible
    348348    my $java = $gsdl_cgi->get_java_path();
    349     my $java_command = "$java -version 2>&1";
    350 
     349    my $java_command = "\"$java\" -version 2>&1";
     350   
    351351    # IIS 6: redirecting output from STDERR to STDOUT just doesn't work, so we have to let it go
    352352    #   directly out to the page
    353353    if($iis6_mode && $gsdl_cgi->greenstone_version() == 2) { ##
    354354    print STDOUT "Content-type:text/plain\n\n";
    355     $java_command = "java -version";
     355    $java_command = "\"$java\" -version";
    356356    }
    357357
    358358    my $java_output = `$java_command`;
     359       
    359360    my $java_status = $?;
    360361    if ($java_status < 0) {
     
    372373    $installation_status .= "GSDLHOME: " . $ENV{'GSDLHOME'} . "\n";
    373374    $installation_status .= "GSDLOS: " . $ENV{'GSDLOS'} . "\n";
     375    $installation_status .= "JAVA_HOME: " . $ENV{'JAVA_HOME'} . "\n" if defined($ENV{'JAVA_HOME'}); # on GS2, Java's only on the PATH
    374376    $installation_status .= "PATH: " . $ENV{'PATH'} . "\n";
    375 
     377   
    376378
    377379    if ($installation_ok) { ## M. Dewsnip's svn log comment stated that for iis6_mode output needs to go to STDOUT
     
    509511    $java_args .= " gsdl3"; ## must this be done elsewhere as well?
    510512    }
    511     my $java_command = "$java -classpath \"$java_classpath\" org.greenstone.gatherer.remote.ZipCollectionShell $java_args";
     513    my $java_command = "\"$java\" -classpath \"$java_classpath\" org.greenstone.gatherer.remote.ZipCollectionShell $java_args";
    512514
    513515    my $java_output = `$java_command`;
     
    555557    my $zip_file_path = &util::filename_cat($collect_directory, $collection . "-archives-" . $timestamp . ".zip");
    556558    my $java_args = "\"$zip_file_path\" \"$collect_directory\" \"$collection\"";
    557     my $java_command = "$java -classpath \"$java_classpath\" org.greenstone.gatherer.remote.ZipCollectionArchives $java_args";
     559    my $java_command = "\"$java\" -classpath \"$java_classpath\" org.greenstone.gatherer.remote.ZipCollectionArchives $java_args";
    558560
    559561    my $java_output = `$java_command`;
     
    589591    my $zip_file_path = &util::filename_cat($collect_directory, "collection-configurations-" . $timestamp . ".zip");
    590592    my $java_args = "\"$zip_file_path\" \"$collect_directory\" \"$username\" \"$user_groups\"";
    591     my $java_command = "$java -classpath \"$java_classpath\" org.greenstone.gatherer.remote.ZipCollectionConfigurations $java_args";
     593    my $java_command = "\"$java\" -classpath \"$java_classpath\" org.greenstone.gatherer.remote.ZipCollectionConfigurations $java_args";
    592594    my $java_output = `$java_command`;
    593595    my $java_status = $?;
     
    675677    my $zip_file_path = &util::filename_cat($collection_directory, $collection . "-file-" . $timestamp . ".zip");
    676678    my $java_args = "\"$zip_file_path\" \"$collection_directory\" \"$file\"";
    677     my $java_command = "$java -classpath \"$java_classpath\" org.greenstone.gatherer.remote.ZipFiles $java_args";
     679    my $java_command = "\"$java\" -classpath \"$java_classpath\" org.greenstone.gatherer.remote.ZipFiles $java_args";
    678680
    679681    my $java_output = `$java_command`;
     
    724726    my $zip_file_path = &util::filename_cat($web_inf_directory, "webxml" . $timestamp . ".zip");
    725727    my $java_args = "\"$zip_file_path\" \"$web_inf_directory\" \"$file\"";
    726     my $java_command = "$java -classpath \"$java_classpath\" org.greenstone.gatherer.remote.ZipFiles $java_args";
     728    my $java_command = "\"$java\" -classpath \"$java_classpath\" org.greenstone.gatherer.remote.ZipFiles $java_args";
    727729    my $java_output = `$java_command`;
    728730
     
    989991    if (($script eq "import.pl") || ($script eq "buildcol.pl") || ($script eq "mkcol.pl")) { # || ($script eq "schedule.pl")
    990992    my $collect_directory = $gsdl_cgi->get_collection_dir($site);
    991     ## previously only done for GS3, now it will do this for GS2 too. Is this how it should be?
    992993    $perl_args = $perl_args . " -collectdir " . $collect_directory;
    993994    }
     
    11171118    my $java_classpath = &util::filename_cat($ENV{'GSDLHOME'}, "bin", "java", "GLIServer.jar");
    11181119    my $java_args = "\"$file_path\" \"$directory_path\"";
    1119     my $java_command = "$java -classpath \"$java_classpath\" org.greenstone.gatherer.remote.Unzip $java_args";
     1120    my $java_command = "\"$java\" -classpath \"$java_classpath\" org.greenstone.gatherer.remote.Unzip $java_args";
    11201121
    11211122    my $java_output = `$java_command`;
Note: See TracChangeset for help on using the changeset viewer.