Show
Ignore:
Timestamp:
05.05.2016 18:18:40 (4 years ago)
Author:
ak19
Message:

First commit to do with incremental-rebuild. Getting incremental-rebuild.pl to work with activate.pl.

Location:
main/trunk/greenstone2/bin/script
Files:
2 modified

Legend:

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

    r29983 r30499  
    594594    } else { 
    595595    $buildtype = "mg"; #mg is the default 
    596     }     
     596    } 
    597597     
    598598    # can't do anything without a build directory with something in it to move into index 
     
    747747        } 
    748748         
    749         # Copy just the contents of building dir into the index dir, overwriting  
    750         # existing files, but don't replace index with building. 
    751         &print_task_msg("Moving \"building\" -> \"index\""); 
    752         &FileUtils::moveDirectoryContents($build_dir, $index_dir); 
     749        if($build_dir eq $index_dir) { # building_dir can have been set to "index" folder, see incremental-buildcol.pl 
     750            &print_task_msg("building folder is index folder, not moving"); 
     751        } else { 
     752            # Copy just the contents of building dir into the index dir, overwriting  
     753            # existing files, but don't replace index with building. 
     754            &print_task_msg("Moving \"building\" -> \"index\"");         
     755            &FileUtils::moveDirectoryContents($build_dir, $index_dir); 
     756        } 
    753757    } 
    754758 
     
    778782    # 4. Ping the library URL, and if it's a persistent server and running, activate the collection again    
    779783     
    780     # Check for success: if building does not exist OR is empty  
    781     if(!&FileUtils::directoryExists($build_dir) || &FileUtils::isDirectoryEmpty($build_dir)) { 
     784    # Check for success: if building does not exist OR is empty OR if building is index (in which case there was no move)    
     785    if($build_dir eq $index_dir || !&FileUtils::directoryExists($build_dir) || &FileUtils::isDirectoryEmpty($build_dir)) { 
    782786     
    783787        if(!$skipactivation && $library_url) { # undef if no valid server URL 
  • main/trunk/greenstone2/bin/script/incremental-rebuild.pl

    r26913 r30499  
    134134    print STDERR "* Running Buildcol Stage\n"; 
    135135    print STDERR "************************\n"; 
    136      
    137136 
    138     my $buildcol_cmd = $launch_cmd . "incremental-buildcol.pl $quoted_buildcol_argv \"$collect\""; 
     137    # run incremental buildcol with activate flag 
     138    my $buildcol_cmd = $launch_cmd . "incremental-buildcol.pl -activate $quoted_buildcol_argv \"$collect\""; 
    139139    my $buildcol_status = system($buildcol_cmd)/256; 
    140140    if ($buildcol_status != 0) {