Ignore:
Timestamp:
2009-02-17T15:36:44+13:00 (15 years ago)
Author:
davidb
Message:

OIDmetadata wasn't supported in collect.cfg, but OIDtype was. Now rectified. Also introduced OIDcount as a file saved in the archives folder to help doc.pm use the correct value when working incrementally

File:
1 edited

Legend:

Unmodified
Added
Removed
  • gsdl/trunk/perllib/inexport.pm

    r18508 r18528  
    3232use util;
    3333use GDBMUtils;
     34
     35
     36sub prime_doc_oid_count
     37{
     38    my ($archivedir) = @_;
     39    my $oid_count_filename = &util::filename_cat ($archivedir, "OIDcount");
     40
     41    if (-e $oid_count_filename) {
     42    if (open(OIDIN,"<$oid_count_filename")) {
     43        my $OIDcount = <OIDIN>;
     44        chomp $OIDcount;       
     45        close(OIDIN);
     46
     47        $doc::OIDcount = $OIDcount;     
     48    }
     49    else {
     50       
     51        print STDERR "Warning: unable to read document OID count from $oid_count_filename\n";
     52        print STDERR "Setting value to 0\n";
     53    }
     54    }
     55   
     56}
     57
     58sub store_doc_oid_count
     59{
     60    # Use the file "OIDcount" in the archives directory to record
     61    # what value doc.pm got up to
     62
     63    my ($archivedir) = @_;
     64    my $oid_count_filename = &util::filename_cat ($archivedir, "OIDcount");
     65
     66
     67    if (open(OIDOUT,">$oid_count_filename")) {
     68    print OIDOUT $doc::OIDcount, "\n";
     69       
     70    close(OIDOUT);
     71    }
     72    else {
     73    print STDERR "Warning: unable to store document OID count\n";
     74    }
     75}
     76
     77
    3478
    3579sub new_vs_old_import_diff
     
    160204   
    161205        if ($verbosity>1) {
    162             print STDERR "$oid marked to be deleted from index on next buildcol.pl\n";
     206            print STDERR "$oid ($file) marked to be deleted from index on next buildcol.pl\n";
    163207        }
    164208        $archive_info->set_status_info($oid,"D");
Note: See TracChangeset for help on using the changeset viewer.