- Timestamp:
- 2013-05-14T10:49:29+12:00 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone2/bin/script/activate.pl
r27240 r27325 290 290 291 291 if($gs_mode eq "gs2") { 292 my $llssite_cfg = & util::filename_cat($ENV{'GSDLHOME'}, "llssite.cfg");292 my $llssite_cfg = &FileUtils::filenameConcatenate($ENV{'GSDLHOME'}, "llssite.cfg"); 293 293 294 294 if(-f $llssite_cfg) { … … 514 514 # work out the building and index dirs 515 515 my $collection_dir = &util::resolve_collection_dir($collect_dir, $qualified_collection, $site); 516 $build_dir = & util::filename_cat($collection_dir, "building") unless (defined $build_dir);517 $index_dir = & util::filename_cat($collection_dir, "index") unless (defined $index_dir);516 $build_dir = &FileUtils::filenameConcatenate($collection_dir, "building") unless (defined $build_dir); 517 $index_dir = &FileUtils::filenameConcatenate($collection_dir, "index") unless (defined $index_dir); 518 518 519 519 &print_task_msg("Running Collection Activation Stage"); … … 539 539 540 540 if ($gs_mode eq "gs2") { 541 $build_cfg_filename = & util::filename_cat($build_dir,"build.cfg");541 $build_cfg_filename = &FileUtils::filenameConcatenate($build_dir,"build.cfg"); 542 542 } else { 543 $build_cfg_filename = & util::filename_cat($build_dir, "buildConfig.xml");543 $build_cfg_filename = &FileUtils::filenameConcatenate($build_dir, "buildConfig.xml"); 544 544 # gs_mode is GS3. Set the site now if this was not specified as cmdline argument 545 545 #$site = "localsite" unless defined $site; … … 563 563 # Except if we're (doing incremental) building for solr, where we want to still 564 564 # activate and deactivate collections including for the incremental case 565 if(!& util::dir_exists($build_dir)) {565 if(!&FileUtils::directoryExists($build_dir)) { 566 566 &print_msg("No building folder at $build_dir to move to index.\n"); 567 567 exit -1 unless ($buildtype eq "solr"); #&& $incremental); 568 } elsif (& util::is_dir_empty($build_dir)) {568 } elsif (&FileUtils::isDirectoryEmpty($build_dir)) { 569 569 &print_msg("Nothing in building folder $build_dir to move into index folder.\n"); 570 570 exit -1 unless ($buildtype eq "solr"); #&& $incremental); … … 655 655 if($removeold) { 656 656 657 if(& util::dir_exists($index_dir)) {657 if(&FileUtils::directoryExists($index_dir)) { 658 658 &print_task_msg("Removing \"index\""); 659 659 … … 665 665 } 666 666 667 & util::rm_r($index_dir);667 &FileUtils::removeFilesRecursive($index_dir); 668 668 669 669 # Wait for a couple of seconds, just for luck 670 670 sleep 2; 671 671 672 if (& util::dir_exists($index_dir)) {672 if (&FileUtils::directoryExists($index_dir)) { 673 673 &print_msg("The index directory $index_dir could not be deleted.\n"); # CollectionManager.Index_Not_Deleted 674 674 } … … 687 687 # Move the building directory to become the new index directory 688 688 &print_task_msg("Moving \"building\" -> \"index\""); 689 & util::mv($build_dir, $index_dir);690 if(& util::dir_exists($build_dir) || !&util::dir_exists($index_dir)) {689 &FileUtils::moveFiles($build_dir, $index_dir); 690 if(&FileUtils::directoryExists($build_dir) || !&FileUtils::directoryExists($index_dir)) { 691 691 &print_msg("Could not move $build_dir to $index_dir.\n"); # CollectionManager.Build_Not_Moved 692 692 } … … 703 703 # existing files, but don't replace index with building. 704 704 &print_task_msg("Moving \"building\" -> \"index\""); 705 & util::mv_dir_contents($build_dir, $index_dir);705 &FileUtils::moveDirectoryContents($build_dir, $index_dir); 706 706 } 707 707 … … 732 732 733 733 # Check for success: if building does not exist OR is empty 734 if(!& util::dir_exists($build_dir) || &util::is_dir_empty($build_dir)) {734 if(!&FileUtils::directoryExists($build_dir) || &FileUtils::isDirectoryEmpty($build_dir)) { 735 735 736 736 if($library_url) { # undef if no valid server URL
Note:
See TracChangeset
for help on using the changeset viewer.