greenstone.org greenstone wiki greenstone trac planet greenstone

Changeset 16207

Show
Ignore:
Timestamp:
2008-06-26 14:40:53 (3 months ago)
Author:
oranfry
Message:

made the linux wrapper use libsearch4j instead of a bundled search4j executable

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • release-kits/shared/linux/wrapper.cpp

    r16089 r16207  
    66 
    77#include "wrapper.h" 
     8#include "libsearch4j.h" 
    89 
    910bool extract_bundled_file( const char[], int, char*, bool ); 
     
    1314        string tempdir = "greenstone.tmp"; //temporary directory where we will store extracted files 
    1415        string jarfile = tempdir + "/@installer.name@.jar"; //where we will store the jar file 
    15         string search4jfile = tempdir + "/search4j"; //where we will store the jar file 
    1616        string javafile = tempdir + "/@java.installer@"; //where we will store the java tar file 
    1717        bool succeeded = false; 
     
    3030        cout << "Extracting installer jar..." << endl; 
    3131        succeeded = extract_bundled_file( @installer.name@jar, sizeof(@installer.name@jar), (char*)jarfile.c_str(), false); 
    32  
    33         cout << "Extracting search4j tool..." << endl; 
    34         succeeded = extract_bundled_file( search4j, sizeof(search4j), (char*)search4jfile.c_str(), true ) && succeeded; 
    3532 
    3633        #ifdef java_is_bundled 
     
    6158 
    6259        //check if an appropriate java is found 
    63         bool jvmFound = (system( "./search4j -m @java.min.version@ -h ./@java.extracted@" ) == 0); 
     60        Jvm minimum; minimum.setVersionFromString( "@java.min.version@" ); 
     61        string hint = "./@java.extracted@"; 
     62        Jvm foundJvm; 
     63        bool jvmFound = find( foundJvm, true, minimum, hint, false ); 
    6464 
    6565        //if the jvm was not found, report not found 
     
    7070                 
    7171                //tell them if java is absent or just too old 
    72                 if ( system( "./search4j -h ./@java.extracted@" ) == 0 ) { 
     72                Jvm tmpJvm; 
     73                if ( find(tmpJvm,false,minimum,hint,false) ) { 
    7374                        cout << "You have java, but it is too old." << endl; 
    7475                } else { 
    7576                        cout << "Could not find java on your system." << endl; 
    7677                } 
     78                tmpJvm = NULL; 
    7779 
    7880                cout << "Install java (@java.min.version@ or greater) and set JAVA_HOME or JRE_HOME, and try again" << endl; 
     
    8688                cout << "Launching Installer ..." << endl; 
    8789                int launch_exit_code = 0; 
    88                 launch_exit_code = system("./search4j -m @java.min.version@ -l @installer.name@.jar -h ./@java.extracted@"); 
     90                launch_exit_code = system( foundJvm.getExecutable() + " -jar @installer.name@.jar" ); 
    8991 
    9092                //report how it went