Ignore:
Timestamp:
2010-01-25T17:11:53+13:00 (14 years ago)
Author:
mdewsnip
Message:

Changed plugin::remove_some() to take the infodbtype as the second parameter, so it can find the archiveinf-src database. Part of making the code less GDBM-specific.

Location:
main/trunk/greenstone2
Files:
2 edited

Legend:

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

    r21613 r21618  
    634634       
    635635       
    636             &plugin::remove_some($pluginfo, $archivedir, \@deleted_files);
     636            &plugin::remove_some($pluginfo, $collectcfg->{'infodbtype'}, $archivedir, \@deleted_files);
    637637           
    638638            &inexport::mark_docs_for_deletion($archive_info,$block_hash,\@deleted_files, $archivedir,$verbosity, "delete");
     
    644644            print STDERR "Files to reindex since last import:\n  ";
    645645            print STDERR join("\n  ",@reindex_files), "\n";
    646             &plugin::remove_some($pluginfo, $archivedir, \@reindex_files);
     646            &plugin::remove_some($pluginfo, $collectcfg->{'infodbtype'}, $archivedir, \@reindex_files);
    647647            &inexport::mark_docs_for_deletion($archive_info,$block_hash,\@reindex_files, $archivedir,$verbosity, "reindex");
    648648        }
  • main/trunk/greenstone2/perllib/plugin.pm

    r21617 r21618  
    221221 
    222222sub remove_some {
    223     my ($pluginfo, $archivedir, $deleted_files) = @_;
     223    my ($pluginfo, $infodbtype, $archivedir, $deleted_files) = @_;
    224224    print STDERR "in remove some\n";
    225225    return if (scalar(@$deleted_files)==0);
    226     my $arcinfo_src_filename = &dbutil::get_infodb_file_path("gdbm", "archiveinf-src", $archivedir);
     226    my $arcinfo_src_filename = &dbutil::get_infodb_file_path($infodbtype, "archiveinf-src", $archivedir);
    227227
    228228    foreach my $file (@$deleted_files) {
     
    230230    # that this file is used in (note in most cases, it's just one OID)
    231231   
    232     my $src_rec_string = &dbutil::read_infodb_entry("gdbm", $arcinfo_src_filename, $file);
     232    my $src_rec_string = &dbutil::read_infodb_entry($infodbtype, $arcinfo_src_filename, $file);
    233233    my $src_rec = &dbutil::convert_infodb_string_to_hash($src_rec_string);
    234234    my $oids = $src_rec->{'oid'};
Note: See TracChangeset for help on using the changeset viewer.