Changeset 21569


Ignore:
Timestamp:
01/21/10 16:38:50 (11 years ago)
Author:
mdewsnip
Message:

Changed all places explicitly using ".gdb" to use the dbutil::get_infodb_file_path() function... you know, the one that should have been used originally? In preparation for making it possible to use something other than GDBM, and part of making the code less GDBM-specific.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone2/perllib/cgiactions/metadataaction.pm

    r21566 r21569  
    120120
    121121    my $index_text_directory = &util::filename_cat($collect_dir,$collect,"index","text");
    122     my $gdbm_db = &util::filename_cat($index_text_directory,"live-$collect_tail.gdb");
    123 
    124     my $cmd = "gdbmget $gdbm_db $dbkey";
     122    my $infodb_file_path = &dbutil::get_infodb_file_path("gdbm", "live-$collect_tail", $index_text_directory);
     123
     124    my $cmd = "gdbmget $infodb_file_path $dbkey";
    125125
    126126    if (open(GIN,"$cmd |") == 0) {
     
    180180
    181181    my $index_text_directory = &util::filename_cat($collect_dir,$collect,"index","text");
    182     my $gdbm_db = &util::filename_cat($index_text_directory,"$collect_tail.gdb");
    183 
    184     my $doc_rec_string = &dbutil::read_infodb_entry("gdbm", $gdbm_db, $docid);
     182    my $infodb_file_path = &dbutil::get_infodb_file_path("gdbm", $collect_tail, $index_text_directory);
     183    my $doc_rec_string = &dbutil::read_infodb_entry("gdbm", $infodb_file_path, $docid);
    185184    my $doc_rec = &dbutil::convert_infodb_string_to_hash($doc_rec_string);
    186185    foreach my $k (keys %$doc_rec) {
     
    240239
    241240    my $index_text_directory = &util::filename_cat($collect_dir,$collect,"index","text");
    242     my $gdbm_db = &util::filename_cat($index_text_directory,"live-$collect_tail.gdb");
    243 
    244     my $cmd = "gdbmset \"$gdbm_db\" \"$dbkey\" \"$metavalue\"";
     241    my $infodb_file_path = &dbutil::get_infodb_file_path("gdbm", "live-$collect_tail", $index_text_directory);
     242
     243    my $cmd = "gdbmset \"$infodb_file_path\" \"$dbkey\" \"$metavalue\"";
    245244
    246245    my $status = system($cmd);
     
    297296
    298297    my $index_text_directory = &util::filename_cat($collect_dir,$collect,"index","text");
    299     my $gdbm_db = &util::filename_cat($index_text_directory,"$collect_tail.gdb");
    300 
    301     my $doc_rec_string = &dbutil::read_infodb_entry("gdbm", $gdbm_db, $docid);
     298    my $infodb_file_path = &dbutil::get_infodb_file_path("gdbm", $collect_tail, $index_text_directory);
     299    my $doc_rec_string = &dbutil::read_infodb_entry("gdbm", $infodb_file_path, $docid);
    302300    my $doc_rec = &dbutil::convert_infodb_string_to_hash($doc_rec_string);
    303301    foreach my $k (keys %$doc_rec) {
     
    336334    ## print STDERR "**** ser dr\n$serialized_doc_rec\n\n\n";
    337335
    338     my $cmd = "gdbmset \"$gdbm_db\" \"$docid\" \"$serialized_doc_rec\"";
     336    my $cmd = "gdbmset \"$infodb_file_path\" \"$docid\" \"$serialized_doc_rec\"";
    339337
    340338    my $status = system($cmd);
     
    752750
    753751    my $index_text_directory = &util::filename_cat($collect_dir,$collect,"index","text");
    754     my $gdbm_db = &util::filename_cat($index_text_directory,"live-$collect_tail.gdb");
    755 
    756     my $cmd = "gdbmdel \"$gdbm_db\" \"$dbkey\"";
     752    my $infodb_file_path = &dbutil::get_infodb_file_path("gdbm", "live-$collect_tail", $index_text_directory);
     753
     754    my $cmd = "gdbmdel \"$infodb_file_path\" \"$dbkey\"";
    757755
    758756    my $status = system($cmd);
     
    808806
    809807    my $index_text_directory = &util::filename_cat($collect_dir,$collect,"index","text");
    810     my $gdbm_db = &util::filename_cat($index_text_directory,"$collect_tail.gdb");
    811 
    812     my $doc_rec_string = &dbutil::read_infodb_entry("gdbm", $gdbm_db, $docid);
     808    my $infodb_file_path = &dbutil::get_infodb_file_path("gdbm", $collect_tail, $index_text_directory);
     809    my $doc_rec_string = &dbutil::read_infodb_entry("gdbm", $infodb_file_path, $docid);
    813810    my $doc_rec = &dbutil::convert_infodb_string_to_hash($doc_rec_string);
    814811    foreach my $k (keys %$doc_rec) {
     
    849846    my $serialized_doc_rec = &dbutil::convert_infodb_hash_to_string($doc_rec);
    850847
    851     my $cmd = "gdbmset \"$gdbm_db\" \"$docid\" \"$serialized_doc_rec\"";
     848    my $cmd = "gdbmset \"$infodb_file_path\" \"$docid\" \"$serialized_doc_rec\"";
    852849
    853850    my $status = system($cmd);
Note: See TracChangeset for help on using the changeset viewer.