Ignore:
Timestamp:
12/12/16 19:45:39 (4 years ago)
Author:
ak19
Message:

Changes to get new perl code to work on the Mac Mountain Lion.

File:
1 edited

Legend:

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

    r31216 r31218  
    236236    # all the while ensuring all PDs are changed back to E for OIDs that exist in both arcinfo and oaiinfo db. 
    237237
    238     foreach my $OID (keys $archive_info->{'info'}) {
     238    my $arcinfo_map = $archive_info->{'info'};
     239
     240    foreach my $OID (keys %$arcinfo_map) {
    239241    my $arcinf_tuple = $archive_info->{'info'}->{$OID};
    240242    my $indexing_status = $arcinf_tuple->[arcinfo::INFO_STATUS_INDEX];
     
    306308    print STDERR "@@@@@ oaiinfo::mark_all_E_as_PD(): Marking the E entries as PD\n";
    307309
    308     foreach my $OID (keys $self->{'info'}) {
     310    my $infomap = $self->{'info'};
     311
     312    foreach my $OID (keys %$infomap) { # Mac Mountain Lion wants %$map, won't accept %$self->{'info'}
    309313    my $OID_info = $self->{'info'}->{$OID};
    310314    my $curr_status = $OID_info->[INFO_STATUS_INDEX];
     
    322326    print STDERR "@@@@@ oaiinfo::mark_all_PD_as_D(): Marking the PD entries as D\n";
    323327
    324     foreach my $OID (keys $self->{'info'}) {
     328    my $infomap = $self->{'info'};
     329
     330    foreach my $OID (keys %$infomap) {
    325331    my $OID_info = $self->{'info'}->{$OID};
    326332    my $curr_status = $OID_info->[INFO_STATUS_INDEX];
     
    340346    print STDERR "@@@@@ oaiinfo::print_info(): oaidb in memory contains: \n";
    341347   
    342     foreach my $OID (keys $self->{'info'}) {
     348    my $infomap = $self->{'info'};
     349
     350    foreach my $OID (keys %$infomap) {
    343351    print STDERR "OID: $OID";
    344352    print STDERR " status: " . $self->{'info'}->{$OID}->[INFO_STATUS_INDEX];
     
    460468    &dbutil::read_infodb_file($self->{'infodbtype'}, $filename, $infodb_map);
    461469
    462     foreach my $oid ( keys $infodb_map ) {
     470    foreach my $oid ( keys %$infodb_map ) {
    463471    my $vals = $infodb_map->{$oid};
    464472    # interested in oid, timestamp, deletion status
     
    522530    # Then write out data structure $self->{'info'} that's been maintaining the data in-memory.
    523531    my $infodb_handle = &dbutil::open_infodb_write_handle($infodbtype, $filename);
    524     foreach my $oid ( keys $self->{'info'} ) {
     532
     533    my $infomap = $self->{'info'};
     534    foreach my $oid ( keys %$infomap ) {
    525535    my $OID_info = $self->{'info'}->{$oid};
    526536    my $val = "<status>".$OID_info->[INFO_STATUS_INDEX];
     
    576586
    577587    my @list = ();
    578 
    579     foreach my $OID (keys $self->{'info'}) {   
     588   
     589    my $infomap = $self->{'info'};
     590    foreach my $OID (keys %$infomap) { 
    580591    my $OID_info = $self->{'info'}->{$OID};
    581592
     
    594605sub size {
    595606    my $self = shift (@_);
    596     return (scalar keys $self->{'info'});
     607    my $infomap = $self->{'info'};
     608    return (scalar keys %$infomap);
    597609}
    598610
Note: See TracChangeset for help on using the changeset viewer.