Changeset 21309


Ignore:
Timestamp:
2009-12-09T13:24:44+13:00 (14 years ago)
Author:
kjdon
Message:

plugin::removeold renamed to remove_all. deleted_files and reindex_files now get generated by new_vs_old_import_diff, call plugin::remove_some on both lists, and then mark_docs_for_deletion on both

File:
1 edited

Legend:

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

    r21295 r21309  
    577577    if ($removeold) {
    578578        # occasionally, plugins may want to do something on remove old, eg pharos image indexing
    579     &plugin::removeold($pluginfo, $importdir, $processor, $maxdocs, $gli);
     579    &plugin::remove_all($pluginfo, $importdir, $processor, $maxdocs, $gli);
    580580    }
    581581    if ($manifest eq "") {
     
    625625        @deleted_files = @filtered_deleted_files;
    626626       
    627         if (scalar(@deleted_files>0)) {
     627        if (scalar(@deleted_files)>0) {
    628628            print STDERR "Files deleted since last import:\n  ";
    629629            print STDERR join("\n  ",@deleted_files), "\n";
     630       
     631       
     632            &plugin::remove_some($pluginfo, $archivedir, \@deleted_files);
     633           
     634            &inexport::mark_docs_for_deletion($archive_info,$block_hash,\@deleted_files, $archivedir,$verbosity, "delete");
    630635        }
    631636       
    632        
    633         &inexport::mark_docs_for_deletion($archive_info,$block_hash,\@deleted_files,
    634                           $archivedir,$verbosity);
    635        
    636         &inexport::mark_docs_for_reindex($archive_info,$block_hash,
    637                          $archivedir,$verbosity);
    638        
    639637        my @reindex_files = sort keys %{$block_hash->{'reindex_files'}};
    640638       
    641         if (scalar(@reindex_files>0)) {
     639        if (scalar(@reindex_files)>0) {
    642640            print STDERR "Files to reindex since last import:\n  ";
    643641            print STDERR join("\n  ",@reindex_files), "\n";
     642            &plugin::remove_some($pluginfo, $archivedir, \@reindex_files);
     643            &inexport::mark_docs_for_deletion($archive_info,$block_hash,\@reindex_files, $archivedir,$verbosity, "reindex");
    644644        }
    645        
    646        
    647         # not sure if the following will work -- will the metadata data-structure be correctly initialized
    648         # in the right order?
    649 #       foreach my $file (@new_files, @reindex_files) {
    650 #       &plugin::read ($pluginfo, $importdir, $file, $block_hash, $metadata, $processor, $maxdocs, 0, $gli);
    651 #       }
    652        
     645               
    653646        }
    654647       
Note: See TracChangeset for help on using the changeset viewer.