Changeset 21581

Show
Ignore:
Timestamp:
22.01.2010 15:57:09 (9 years ago)
Author:
mdewsnip
Message:

Changed import.pl and export.pl so instead of explicitly using "archiveinf-doc.gdb" or "archiveinf-src.gdb" they 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.

Location:
main/trunk/greenstone2/bin/script
Files:
2 modified

Legend:

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

    r21580 r21581  
    525525    # the plugouts should be doing this!! 
    526526##  $expinfo_doc_filename = &util::filename_cat ($exportdir, "export.inf"); 
    527     $expinfo_doc_filename = &util::filename_cat ($exportdir,"archiveinf-doc" ); 
    528     &util::rename_gdbm_file($expinfo_doc_filename); # ensures gdb in case we have an existing legacy ldb one - can this happen? 
    529     $expinfo_doc_filename .= ".gdb"; 
    530      
    531     $expinfo_src_filename = &util::filename_cat ($exportdir,"archiveinf-src" ); 
    532     &util::rename_gdbm_file($expinfo_src_filename); # ensures gdb in case we have an existing legacy ldb one - can this happen? 
    533     $expinfo_src_filename .= ".gdb"; 
    534  
     527 
     528    # BACKWARDS COMPATIBILITY: Just in case there are old .ldb/.bdb files (won't do anything for other infodbtypes) 
     529    &util::rename_gdbm_file(&util::filename_cat($exportdir, "archiveinf-doc")); 
     530    &util::rename_gdbm_file(&util::filename_cat($exportdir, "archiveinf-src")); 
     531 
     532    $expinfo_doc_filename = &dbutil::get_infodb_file_path($collectcfg->{'infodbtype'}, "archiveinf-doc", $exportdir); 
     533    $expinfo_src_filename = &dbutil::get_infodb_file_path($collectcfg->{'infodbtype'}, "archiveinf-src", $exportdir); 
    535534         
    536535    $export_info = new arcinfo($collectcfg->{'infodbtype'}); 
  • main/trunk/greenstone2/bin/script/import.pl

    r21580 r21581  
    527527    # read the archive information file 
    528528##  $arcinfo_doc_filename = &util::filename_cat ($archivedir, "archives.inf"); 
    529      
    530     $arcinfo_doc_filename = &util::filename_cat ($archivedir, "archiveinf-doc"); 
    531     &util::rename_gdbm_file($arcinfo_doc_filename); # ensures gdb 
    532     $arcinfo_doc_filename .= ".gdb"; 
    533      
    534     $arcinfo_src_filename = &util::filename_cat ($archivedir, "archiveinf-src");    
    535     &util::rename_gdbm_file($arcinfo_src_filename); # ensures gdb 
    536     $arcinfo_src_filename .= ".gdb"; 
    537  
     529 
     530    # BACKWARDS COMPATIBILITY: Just in case there are old .ldb/.bdb files (won't do anything for other infodbtypes) 
     531    &util::rename_gdbm_file(&util::filename_cat($archivedir, "archiveinf-doc")); 
     532    &util::rename_gdbm_file(&util::filename_cat($archivedir, "archiveinf-src")); 
     533 
     534    $arcinfo_doc_filename = &dbutil::get_infodb_file_path($collectcfg->{'infodbtype'}, "archiveinf-doc", $archivedir); 
     535    $arcinfo_src_filename = &dbutil::get_infodb_file_path($collectcfg->{'infodbtype'}, "archiveinf-src", $archivedir); 
    538536                             
    539537    $archive_info = new arcinfo ($collectcfg->{'infodbtype'});