- Timestamp:
- 2015-06-05T21:01:32+12:00 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone2/bin/script/activate.pl
r29640 r29948 172 172 173 173 # check the page content is as expected 174 my $response_content = $response_obj->content; 174 my $response_content = $response_obj->content; 175 my $resultstr = $response_content; 176 $resultstr =~ s@.*gs_content\"\>@@s; 177 $resultstr =~ s@</div>.*@@s; 178 175 179 if($response_content =~ m/$check_message_against_regex/) { 176 180 &print_msg(" Response as expected.\n", 3); 181 &print_msg("@@@@@@ Got result:\n$resultstr\n", 4); 177 182 return 1; 178 183 } else { … … 185 190 &print_msg("\n\tBUT: command $library_url$command response UNEXPECTED.\n", 3); 186 191 &print_msg("*** Got message:\n$response_content.\n", 4); 192 &print_msg("*** Got result:\n$resultstr\n", 3); 187 193 } 188 194 return 0; # ping on a collection may "not succeed." … … 246 252 my $check_responsemsg_against_regex = q/(succeeded)/; 247 253 my $expected_error_code = 500; 254 255 &print_msg("*** COMMAND WAS: |$command|***\n", 4); 256 248 257 return config($library_url, $command, $check_responsemsg_against_regex, $site, $expected_error_code, $silent); 249 258 } … … 469 478 470 479 print STDERR "\n"; 471 print STDERR "Usage: $progname [-collectdir c -builddir b -indexdir i -site s - removeold -keepold -verbosity v\n";480 print STDERR "Usage: $progname [-collectdir c -builddir b -indexdir i -site s -skipactivation -removeold -keepold -verbosity v\n"; 472 481 print STDERR "\t-library_url URL] <[colgroup/]collection>\n"; 473 482 print STDERR "\n"; … … 478 487 # get the collection details 479 488 my $qualified_collection = pop @argv; # qualified collection 480 489 481 490 my $collect_dir = undef; #"collect"; # can't be "collect" when only -site is provided for GS3 482 491 my $build_dir = undef; … … 484 493 my $site = undef; 485 494 495 # if run from server (java code), it will handle deactivation and activation to prevent open file handles when java launches this script and exits: 496 my $skipactivation = 0; 486 497 my $removeold = 0; 487 498 my $keepold = 0; … … 503 514 elsif ($arg eq "-site") { 504 515 $site = shift @argv; 516 } 517 elsif ($arg eq "-skipactivation") { 518 $skipactivation = 1; 505 519 } 506 520 elsif ($arg eq "-removeold") { … … 601 615 602 616 my $is_persistent_server = undef; 603 if( $library_url) { # undef if no valid server URL604 617 if(!$skipactivation && $library_url) { # undef if no valid server URL 618 605 619 &print_msg("Pinging $library_url\n"); 606 620 if (&ping_library($library_url, $gs_mode, $site)) { # server running … … 758 772 if(!&FileUtils::directoryExists($build_dir) || &FileUtils::isDirectoryEmpty($build_dir)) { 759 773 760 if( $library_url) { # undef if no valid server URL774 if(!$skipactivation && $library_url) { # undef if no valid server URL 761 775 762 776 &print_msg("Pinging $library_url\n");
Note:
See TracChangeset
for help on using the changeset viewer.