Ignore:
Timestamp:
2010-10-20T13:12:24+13:00 (11 years ago)
Author:
kjdon
Message:

fixed up bug with deleting assoc files. Was fine for a delete, but for an update, need to delete the old ones *before* adding the new ones. And also, don't delete the lucene text doc when updating. Presumably it has already been overwritten with the correct version

File:
1 edited

Legend:

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

    r23181 r23182  
    572572{
    573573    my $self = shift (@_);
    574     my ($archivedir) = @_;
     574    my ($archivedir, $edit_mode) = @_;
    575575
    576576    $self->basebuildproc::delete_assoc_files(@_);
    577577   
    578     my $assoc_dir = &util::filename_cat($self->{'build_dir'},"text", $archivedir);
    579     if (-d $assoc_dir) {
    580     &util::rm_r($assoc_dir);
    581     }
     578    if ($edit_mode eq "delete") {
     579    # if we are deleting the doc, then also delete the lucene text  version
     580    my $assoc_dir = &util::filename_cat($self->{'build_dir'},"text", $archivedir);
     581    if (-d $assoc_dir) {
     582        &util::rm_r($assoc_dir);
     583    }
     584    }
    582585}
    583586
Note: See TracChangeset for help on using the changeset viewer.