Ignore:
Timestamp:
2009-11-18T16:12:06+13:00 (14 years ago)
Author:
ak19
Message:

3 changes: 1. A few more instances where perl should be launched for all OS with perl -S, since there's now a tarred up Perl available for Linux users in case their system perl is not the right one. 2. Incremental- and full-build and incremental- and full-import need not add the -collectdir parameter for the Remote Greenstone case, since the remote side will work out the path to the collection directory. 3. Calls to LocalGreenstone.getBinScriptDirectoryPath() are restricted to the local Greenstone case, so the path to the local bin script is no longer used in Remote Greenstone cases.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • gli/trunk/src/org/greenstone/gatherer/collection/CollectionManager.java

    r20924 r20960  
    118118    static final public int SCHEDULING = 7;
    119119
     120    /** To store the path to the perl scripts. In the case of local Greenstone servers,
     121     * this will be the local bin/script folder. */
     122    static private String scriptPath = "";
    120123 
    121124    /** Constructor. */
     
    135138        System.err.println("Done.");
    136139        new File(Gatherer.getCollectDirectoryPath()).mkdirs();
     140
     141        scriptPath = ""; // remote greenstone: scriptPath will be determined on remote server side
     142    }
     143    else { // local greenstone case: scripts are inside bin/script
     144        scriptPath = LocalGreenstone.getBinScriptDirectoryPath();
    137145    }
    138146    }
     
    170178
    171179    if (Configuration.fedora_info.isActive()) {
    172         command_parts_list.add(LocalGreenstone.getBinScriptDirectoryPath() + "g2f-buildcol.pl");
     180        command_parts_list.add(scriptPath + "g2f-buildcol.pl");
    173181
    174182        command_parts_list.add("-hostname");
     
    191199       
    192200        if ( !CollectionDesignManager.isCompleteBuild() && CollectionDesignManager.index_manager.isLucene() ) {
    193             command_parts_list.add(LocalGreenstone.getBinScriptDirectoryPath() + "incremental-buildcol.pl");
     201            command_parts_list.add(scriptPath + "incremental-buildcol.pl");
    194202            CollectionDesignManager.setBuildcolWasFull(false);
    195203        } else {
    196             command_parts_list.add(LocalGreenstone.getBinScriptDirectoryPath() + "full-buildcol.pl");
     204            command_parts_list.add(scriptPath + "full-buildcol.pl");
    197205            CollectionDesignManager.setBuildcolWasFull(true);
    198206        }
     
    202210    command_parts_list.add("-language");
    203211    command_parts_list.add(Configuration.getLanguage());
    204     command_parts_list.add("-collectdir");
    205     command_parts_list.add(getCollectDirectory());
     212    if(!Gatherer.isGsdlRemote) {
     213        command_parts_list.add("-collectdir");
     214        command_parts_list.add(getCollectDirectory());
     215    }
    206216
    207217    String[] build_options = collection.build_options.getValues();
     
    228238
    229239    ArrayList sched_list = new ArrayList();
    230     if ((Utility.isWindows()) && (!Gatherer.isGsdlRemote)) {
     240    if (!Gatherer.isGsdlRemote) {
    231241        sched_list.add(Configuration.perl_path);
    232242        sched_list.add("-S");
    233243    }
    234     sched_list.add(LocalGreenstone.getBinScriptDirectoryPath() + "schedule.pl");
     244    sched_list.add(scriptPath + "schedule.pl");
    235245    sched_list.add("-colname");
    236246    sched_list.add(collection.getName());
     
    240250    // Generate the import.pl command
    241251    ArrayList import_list = new ArrayList();
    242     if ((Utility.isWindows()) && (!Gatherer.isGsdlRemote)) {
     252    if (!Gatherer.isGsdlRemote) {
    243253        import_list.add(Configuration.perl_path);
    244254        import_list.add("-S");
     
    246256
    247257    String cmdPrefix = CollectionDesignManager.isCompleteBuild() ? "full-" : "incremental-";
    248     import_list.add(LocalGreenstone.getBinScriptDirectoryPath() + cmdPrefix + "import.pl");
     258    import_list.add(scriptPath + cmdPrefix + "import.pl");
    249259    import_list.add("-language");
    250260    import_list.add(Configuration.getLanguage());
    251     import_list.add("-collectdir");
    252     import_list.add(getCollectDirectory());
     261    if(!Gatherer.isGsdlRemote) {
     262        import_list.add("-collectdir");
     263        import_list.add(getCollectDirectory());
     264    }
    253265
    254266    String[] import_options = collection.import_options.getValues();
     
    275287
    276288    // i'm not doing this in schedule.pl right now - should i be?
    277     if ((Utility.isWindows()) && (!Gatherer.isGsdlRemote)) {
     289    if (!Gatherer.isGsdlRemote) {
    278290        build_list.add(Configuration.perl_path);
    279291        build_list.add("-S");
     
    282294    String buildType = (new CollectionMeta( CollectionDesignManager.collect_config.getBuildType() )).getValue(CollectionMeta.TEXT);
    283295    if ( !CollectionDesignManager.isCompleteBuild() && buildType.equals( BuildTypeManager.BUILD_TYPE_LUCENE ) ) {
    284         build_list.add(LocalGreenstone.getBinScriptDirectoryPath() + "incremental-buildcol.pl");
     296        build_list.add(scriptPath + "incremental-buildcol.pl");
    285297    } else {
    286         build_list.add(LocalGreenstone.getBinScriptDirectoryPath() + "full-buildcol.pl");
     298        build_list.add(scriptPath + "full-buildcol.pl");
    287299    }
    288300
    289301    build_list.add("-language");
    290302    build_list.add(Configuration.getLanguage());
    291     build_list.add("-collectdir");
    292     build_list.add(getCollectDirectory());
     303    if(!Gatherer.isGsdlRemote) {
     304        build_list.add("-collectdir");
     305        build_list.add(getCollectDirectory());
     306    }
    293307
    294308    String[] build_options = collection.build_options.getValues();
     
    10231037    // Generate the import.pl command
    10241038    ArrayList command_parts_list = new ArrayList();
    1025     if ((Utility.isWindows()) && (!Gatherer.isGsdlRemote)) {
     1039    if (!Gatherer.isGsdlRemote) {
    10261040        command_parts_list.add(Configuration.perl_path);
    10271041        command_parts_list.add("-S");
     
    10291043
    10301044    if (Configuration.fedora_info.isActive()) {
    1031         command_parts_list.add(LocalGreenstone.getBinScriptDirectoryPath() + "g2f-import.pl");
     1045        command_parts_list.add(scriptPath + "g2f-import.pl");
    10321046
    10331047        command_parts_list.add("-hostname");
     
    10471061    }
    10481062    else {
    1049         String cmdPrefix = null;
    1050         if ( CollectionDesignManager.isCompleteBuild() ) {
    1051             cmdPrefix = "full-";
    1052             CollectionDesignManager.setImportWasFull( true );
    1053         } else {
    1054             cmdPrefix = "incremental-";
    1055             CollectionDesignManager.setImportWasFull( false );
    1056         }
    1057         command_parts_list.add(LocalGreenstone.getBinScriptDirectoryPath() + cmdPrefix + "import.pl");
     1063        String cmdPrefix = null;
     1064        if ( CollectionDesignManager.isCompleteBuild() ) {
     1065        cmdPrefix = "full-";
     1066        CollectionDesignManager.setImportWasFull( true );
     1067        } else {
     1068        cmdPrefix = "incremental-";
     1069        CollectionDesignManager.setImportWasFull( false );
     1070        }
     1071        command_parts_list.add(scriptPath + cmdPrefix + "import.pl"); // scriptPath already set according to local or remote case
    10581072    }
    10591073
     
    10611075    command_parts_list.add("-language");
    10621076    command_parts_list.add(Configuration.getLanguage());
    1063     command_parts_list.add("-collectdir");
    1064     command_parts_list.add(getCollectDirectory());
     1077    if(!Gatherer.isGsdlRemote) {
     1078        command_parts_list.add("-collectdir");
     1079        command_parts_list.add(getCollectDirectory());
     1080    }   
    10651081
    10661082    String[] import_options = collection.import_options.getValues();
     
    14481464    // Generate the mkcol.pl command
    14491465    ArrayList command_parts_list = new ArrayList();
    1450     if (Utility.isWindows() && (!Gatherer.isGsdlRemote)) {
     1466    if (!Gatherer.isGsdlRemote) {
    14511467        command_parts_list.add(Configuration.perl_path);
    14521468        command_parts_list.add("-S");
    14531469    }
    1454     command_parts_list.add(LocalGreenstone.getBinScriptDirectoryPath() + "mkcol.pl");
     1470    command_parts_list.add(scriptPath + "mkcol.pl");
    14551471    if(Gatherer.GS3) {
    14561472        command_parts_list.add(Utility.GS3MODE_ARGUMENT); // add '-gs3mode'
    14571473    }
    1458 
    1459     command_parts_list.add("-collectdir");
    1460     command_parts_list.add(getDefaultCollectDirectory());
    1461    
     1474    if(!Gatherer.isGsdlRemote) {
     1475        command_parts_list.add("-collectdir");
     1476        command_parts_list.add(getDefaultCollectDirectory());
     1477    }
    14621478    command_parts_list.add("-win31compat");
    14631479    command_parts_list.add((Gatherer.isGsdlRemote) ? "false" : "true");
Note: See TracChangeset for help on using the changeset viewer.