Changeset 23176

Show
Ignore:
Timestamp:
19.10.2010 15:23:38 (9 years ago)
Author:
kjdon
Message:

added delete_assoc_files. If we are asked to process a deleted or updated document, then delete the old assoc files - index/assoc/archivedir, and index/text/archivedir for lucene

Location:
main/trunk/greenstone2/perllib
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone2/perllib/basebuildproc.pm

    r23165 r23176  
    420420    $self->{'dont_process_reconstructed'}->{$doc_obj->get_OID()} = 1; 
    421421    # we don't need to do anything else for the info database for a deleted document. The infodb starts from scratch each time, so no deletion is necessary 
     422    $self->delete_assoc_files ($archivedir); 
    422423    return; 
    423424    } 
     
    426427    # we don't want to process the reconstructed doc later, but we will process this version now. 
    427428    $self->{'dont_process_reconstructed'}->{$doc_obj->get_OID()} = 1; 
     429    $self->delete_assoc_files ($archivedir); 
    428430    } 
    429431 
     
    814816} 
    815817 
     818sub delete_assoc_files  
     819{ 
     820    my $self = shift (@_); 
     821    my ($archivedir) = @_; 
     822 
     823    my $assoc_dir = &util::filename_cat($self->{'assocdir'}, $archivedir); 
     824    if (-d $assoc_dir) { 
     825    &util::rm_r($assoc_dir); 
     826    } 
     827} 
  • main/trunk/greenstone2/perllib/lucenebuildproc.pm

    r21643 r23176  
    569569} 
    570570 
     571sub delete_assoc_files  
     572{ 
     573    my $self = shift (@_); 
     574    my ($archivedir) = @_; 
     575 
     576    $self->basebuildproc::delete_assoc_files(@_); 
     577     
     578    my $assoc_dir = &util::filename_cat($self->{'build_dir'},"text", $archivedir); 
     579    if (-d $assoc_dir) { 
     580    &util::rm_r($assoc_dir); 
     581    }  
    571582 
    5725831;