Ignore:
Timestamp:
2010-12-14T16:16:48+13:00 (13 years ago)
Author:
davidb
Message:

read_infodb_entry now returns a hashmap directly. Code updated to take advantage of this, and in places where the hashmap is not needed, the alternative read_infodb_rawentry is called.

File:
1 edited

Legend:

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

    r23402 r23485  
    944944        # is it modified??
    945945        if (-M $full_curr_file < $archiveinf_timestamp) {
    946             print STDERR "*** Detected a modified metadata file: $full_curr_file\n" if $verbosity > 2;
     946            print STDERR "*** Detected a *modified metadata* file: $full_curr_file\n" if $verbosity >= 2;
    947947            # its newer than last build
    948948            $block_hash->{'new_or_modified_metadata_files'}->{$full_curr_file} = 1;
     
    974974        # Greenstone to always be this)
    975975
    976         print STDERR "***** Detected new metadata file: $full_curr_file\n" if $verbosity > 2;
     976        print STDERR "*** Detected *new* metadata file: $full_curr_file\n" if $verbosity >= 2;
    977977        $block_hash->{'new_or_modified_metadata_files'}->{$full_curr_file} = 1;
    978978        }
     
    10121012   
    10131013        if ($existing_f =~ m/^$situated_dir/) {
     1014
     1015        print STDERR "**** Existing file $existing_f\nis located within\n$situated_dir\n";
     1016
    10141017        push(@$reindex_files,$existing_f);
    10151018        $block_hash->{'reindex_files'}->{$existing_f} = 1;
     
    11071110    # that this file is used in (note in most cases, it's just one OID)
    11081111   
    1109     my $src_rec_string = &dbutil::read_infodb_entry($infodbtype, $arcinfo_src_filename, $file);
    1110     my $src_rec = &dbutil::convert_infodb_string_to_hash($src_rec_string);
     1112    my $src_rec = &dbutil::read_infodb_entry($infodbtype, $arcinfo_src_filename, $file);
    11111113    my $oids = $src_rec->{'oid'};
    11121114    my $file_record_deleted = 0;
     
    11211123
    11221124        # find the source doc (the primary file that becomes this oid)
    1123         my $doc_rec_string = &dbutil::read_infodb_entry($infodbtype, $arcinfo_doc_filename, $oid);
    1124         my $doc_rec = &dbutil::convert_infodb_string_to_hash($doc_rec_string);
     1125        my $doc_rec = &dbutil::read_infodb_entry($infodbtype, $arcinfo_doc_filename, $oid);
    11251126        my $doc_source_file = $doc_rec->{'src-file'}->[0];
    11261127        if (!&util::filename_is_absolute($doc_source_file)) {
     
    11421143        # mark oid for deletion (it will be deleted or reimported)
    11431144        $archive_info->set_status_info($oid,"D");
    1144         my $val = &dbutil::read_infodb_entry($infodbtype, $arcinfo_doc_filename, $oid);
     1145        my $val = &dbutil::read_infodb_rawentry($infodbtype, $arcinfo_doc_filename, $oid);
    11451146        $val =~ s/^<index-status>(.*)$/<index-status>D/m;
    11461147
Note: See TracChangeset for help on using the changeset viewer.