Changeset 25892 for main/trunk/greenstone2/bin/script/activate.pl
- Timestamp:
- 2012-07-03T19:53:05+12:00 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone2/bin/script/activate.pl
r25889 r25892 430 430 my $build_dir = undef; 431 431 my $index_dir = undef; 432 432 my $site = undef; 433 433 434 434 my $removeold = 0; 435 435 my $keepold = 0; 436 436 my $incremental = 0; # used by solr 437 437 438 my $library_url = undef; # to be specified on the cmdline if not using a GS-included web server 438 439 … … 455 456 elsif ($arg eq "-keepold") { 456 457 $keepold = 1; 458 } 459 elsif ($arg eq "-incremental") { 460 $incremental = 1; 457 461 } 458 462 elsif ($arg eq "-library_url") { … … 595 599 # If keepold: move building's contents into index, where only duplicates will get deleted. 596 600 # removeold and keepold can't both be on at the same time 597 ($removeold, $keepold) = &scriptutil::check_removeold_and_keepold($removeold, $keepold, 598 0, # incremental is irrelevant to what activate.pl does, setting this = 0 601 # incremental becomes relevant for solr, though it was irrelevant to what activate.pl does (moving building to index) 602 my $incremental_mode; 603 ($removeold, $keepold, $incremental, $incremental_mode) = &scriptutil::check_removeold_and_keepold($removeold, $keepold, 604 $incremental, 599 605 $build_dir, # checkdir. Usually archives or export to be deleted. activate.pl deletes building 600 606 $collectcfg); … … 639 645 } 640 646 } 641 elsif ($keepold ) {642 if ($buildtype eq "solr") { ### no building- prefix for keepold incremental case?647 elsif ($keepold || $incremental) { 648 if ($buildtype eq "solr") { 643 649 # if solr, remove any cores that may be using the building_dir before moving this dir onto index 644 650 foreach my $corename (@corenames) { … … 652 658 &util::mv_dir_contents($build_dir, $index_dir); 653 659 } 654 660 655 661 if ($buildtype eq "solr") { 656 # Call CREATE action to get all cores pointing to the index folder, since building is now index 657 ### Should already be using the index_dir directory for $keepold (incremental) case? Then call RELOAD CORE 662 # Call CREATE action to get the old cores pointing to the index folder 658 663 foreach my $corename (@corenames) { 659 664 if($removeold) { 665 # Call CREATE action to get all cores pointing to the index folder, since building is now index 660 666 $solr_server->admin_create_core($corename, $index_dir); 661 } elsif ($keepold) { 662 $solr_server->admin_reload_core($corename); 667 668 } elsif ($keepold || $incremental) { 669 # Call RELOAD core. Should already be using the index_dir directory for $keepold and $incremental case 670 671 # Ping to see if corename exists, if it does, reload, else create 672 if ($solr_server->admin_ping_core($corename)) { 673 $solr_server->admin_reload_core($corename); 674 } else { 675 $solr_server->admin_create_core($corename, $index_dir); 676 } 663 677 } 664 678 }
Note:
See TracChangeset
for help on using the changeset viewer.