Changeset 21543

Show
Ignore:
Timestamp:
20.01.2010 15:35:51 (9 years ago)
Author:
mdewsnip
Message:

Changing arcinfo.pm to use the general dbutil module, instead of being hard-wired to use the dbutil::gdbm module. This is the first stage of converting this to be able to use different infodbtypes.

Files:
1 modified

Legend:

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

    r21412 r21543  
    4242use strict; 
    4343 
    44 use dbutil::gdbm; 
     44use dbutil; 
     45 
    4546 
    4647# File format read in: OID <tab> Filename <tab> Optional-Index-Status 
     
    9293    my $infodb_map = {}; 
    9394 
    94     &dbutil::gdbm::read_infodb_file($filename,$infodb_map); 
     95    &dbutil::read_infodb_file("gdbm", $filename, $infodb_map); 
    9596 
    9697    foreach my $oid ( keys %$infodb_map ) { 
     
    129130    my $infodb_map = {}; 
    130131 
    131     &dbutil::gdbm::read_infodb_keys($filename,$infodb_map); 
     132    &dbutil::read_infodb_keys("gdbm", $filename, $infodb_map); 
    132133 
    133134    foreach my $file ( keys %$infodb_map ) { 
     
    162163    my $rev_infodb_map = {}; 
    163164 
    164     &dbutil::gdbm::read_infodb_file($rev_filename,$rev_infodb_map); 
     165    &dbutil::read_infodb_file("gdbm", $rev_filename, $rev_infodb_map); 
    165166 
    166167    foreach my $srcfile ( keys %$rev_infodb_map ) { 
     
    199200    # read it in 
    200201    my $infodb_map = {}; 
    201     &dbutil::gdbm::read_infodb_file($filename,$infodb_map); 
     202    &dbutil::read_infodb_file("gdbm", $filename, $infodb_map); 
    202203 
    203204    # change index-status values 
     
    217218 
    218219    # write out again 
    219     my $infodb_handle = &dbutil::gdbm::open_infodb_write_handle($filename); 
     220    my $infodb_handle = &dbutil::open_infodb_write_handle("gdbm", $filename); 
    220221    foreach my $oid ( keys %$infodb_map ) { 
    221222    # consider making the following a method in dbutil 
     
    227228    print $infodb_handle '-' x 70, "\n"; 
    228229    } 
    229     &dbutil::gdbm::close_infodb_write_handle($infodb_handle); 
     230    &dbutil::close_infodb_write_handle("gdbm", $infodb_handle); 
    230231 
    231232} 
     
    239240    my $rev_infodb_map = $self->{'reverse-info'}; 
    240241    my $rev_infodb_handle  
    241     = &dbutil::gdbm::open_infodb_write_handle($rev_filename,"append"); 
     242    = &dbutil::open_infodb_write_handle("gdbm", $rev_filename, "append"); 
    242243 
    243244    foreach my $key ( keys %$rev_infodb_map ) { 
    244245    my $val_hash = $rev_infodb_map->{$key}; 
    245     &dbutil::gdbm::write_infodb_entry($rev_infodb_handle,$key,$val_hash); 
    246     } 
    247     &dbutil::gdbm::close_infodb_write_handle($rev_infodb_handle); 
     246    &dbutil::write_infodb_entry("gdbm", $rev_infodb_handle, $key, $val_hash); 
     247    } 
     248    &dbutil::close_infodb_write_handle("gdbm", $rev_infodb_handle); 
    248249 
    249250}