Changeset 25675


Ignore:
Timestamp:
2012-05-25T15:29:30+12:00 (12 years ago)
Author:
ak19
Message:
  1. Can run the ant target to get the library_URL for GS3 from anywhere, thanks to Sam's suggestion of the -buildfile parameter to ant, 2. gs_mode is set to gs2 when a collect.cfg exists even when there's a collectionConfig.xml. Now the presence of a site parameter to the activate.pl script is used to finally decide the version of the Greenstone.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone2/bin/script/activate.pl

    r25597 r25675  
    316316            # see http://stackoverflow.com/questions/799968/whats-the-difference-between-perls-backticks-system-and-exec
    317317       
    318         my $perl_command = "ant get-default-servlet-url"; # assumes activate.pl is run from within the GS3 installation
     318            # The get-default-servlet-url ant target can be run from anywhere by specifying the
     319            # location of GS3's ant build.xml buildfile. Activate.pl can be run from anywhere for GS3
     320            # GSDL3SRCHOME will be set for GS3 by gs3-setup.sh, a step that would have been necessary
     321            # to run the activate.pl script in the first place
     322        my $perl_command = "ant -buildfile \"$ENV{'GSDL3SRCHOME'}/build.xml\" get-default-servlet-url";
    319323       
    320324        if (open(PIN, "$perl_command |")) {
     
    481485    # generated and does $gs_mode=gs3, else collect.cfg gets generated and $gs_mode=gs2
    482486    my ($collect_cfg_filename, $gs_mode) = &colcfg::get_collect_cfg_name(STDERR);
    483    
    484487    my $collectcfg = &colcfg::read_collection_cfg ($collect_cfg_filename,$gs_mode);
    485488
     
    513516    }
    514517   
    515    
     518    # gs_mode is set to gs2 if there's a collect.cfg and regardless of whether there's a collectionConfig.xml
     519    # (this happens especially when a GS2 collection is being converted to GS3).
     520    # override this behaviour here, by looking for whether a site variable was passed in
     521    if(defined $site && $gs_mode eq "gs2") {
     522    $gs_mode="gs3";
     523    }   
     524
    516525    # Now the logic in GLI's CollectionManager.java (processComplete()
    517526    # and installCollection()) and Gatherer.configGS3Server().
     
    532541    my $is_persistent_server = undef;
    533542    if($library_url) { # undef if no valid server URL
    534    
     543   
    535544        &print_msg("Pinging $library_url\n");       
    536545        if(&ping_library($library_url, $gs_mode, $site)) { # server running
Note: See TracChangeset for help on using the changeset viewer.