Ignore:
Timestamp:
06/30/16 18:46:47 (4 years ago)
Author:
ak19
Message:
  1. activate.pl modified to allow incremental-building with a manifest file. 2. servercontrol.pm modified to allow activating a collection when the gs3-server is set to use another servlet. The halftone-library servlet returns the ping succeeded message nested in a different element than the default library servlet. So the code's no longer getting the element first. Saves extra effort in the code anyway to do one regex instead of 3.
Location:
main/trunk/greenstone2
Files:
2 edited

Legend:

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

    r30527 r30596  
    235235    # Except if we're (doing incremental) building for solr, where we want to still
    236236    # activate and deactivate collections including for the incremental case
    237     if(!&FileUtils::directoryExists($build_dir)) {
    238     $gsserver->print_msg("No building folder at $build_dir to move to index.\n");
    239     exit -1 unless ($buildtype eq "solr"); #&& $incremental);
    240     } elsif (&FileUtils::isDirectoryEmpty($build_dir)) {
    241     $gsserver->print_msg("Nothing in building folder $build_dir to move into index folder.\n");
    242     exit -1 unless ($buildtype eq "solr"); #&& $incremental);
    243     }
    244    
     237
     238    if(!$incremental) { # if (!($incremental && ($build_dir eq $index_dir)))
     239   
     240    if(!&FileUtils::directoryExists($build_dir)) {
     241        $gsserver->print_msg("No building folder at $build_dir to move to index.\n");
     242        exit -1 unless ($buildtype eq "solr"); #&& $incremental);
     243    } elsif (&FileUtils::isDirectoryEmpty($build_dir)) {
     244        $gsserver->print_msg("Nothing in building folder $build_dir to move into index folder.\n");
     245        exit -1 unless ($buildtype eq "solr"); #&& $incremental);
     246    }
     247    }
     248
    245249    # Now the logic in GLI's CollectionManager.java (processComplete()
    246250    # and installCollection()) and Gatherer.configGS3Server().
  • main/trunk/greenstone2/perllib/servercontrol.pm

    r30561 r30596  
    136136    # - with single quotes around it for linux for the cmd to run in bash subshell
    137137    # - with a ^ before it on windows for the cmd to run in a DOS prompt subshell
    138     # - or the entire wget command should be nested double quotes (single quotes don't work on windows)
     138    # - or the entire wget command should be nested in double quotes (single quotes don't work on windows)
    139139    my $wgetCommand = $command;
    140140
     
    149149    $wgetCommand = "\"$wget_file_path\" --output-document=- -T 5 -t 1 \"$library_url$wgetCommand\" 2>&1";   
    150150    #$wgetCommand = "\"$wget_file_path\" --spider -T 5 -t 1 \"$library_url$wgetCommand\" 2>&1"; # won't save page
     151    ##print STDERR "@@@@ $wgetCommand\n";
     152
    151153    my $response_content = `$wgetCommand`;
    152154    my $response_code = undef;
     
    184186        # check the page content is as expected
    185187        my $resultstr = $response_content;
    186         $resultstr =~ s@.*gs_content\"\>@@s;       
    187         $resultstr =~ s@</div>.*@@s;
     188        #$resultstr =~ s@.*gs_content\"\>@@s;   ## only true for default library servlet   
     189        #$resultstr =~ s@</div>.*@@s;
    188190        if($resultstr =~ m/$check_message_against_regex/) {
    189191        $self->print_msg(" Response as expected.\n", 3);
     
    278280    my $expected_error_code = 500;
    279281   
    280     $self->print_msg("*** COMMAND WAS: |$command|***\n", 4);
     282    $self->print_msg("*** COMMAND WAS: |$command| ***\n", 4);
    281283   
    282284    return $self->config($command, $check_responsemsg_against_regex, $expected_error_code, $silent);
Note: See TracChangeset for help on using the changeset viewer.