Ignore:
Timestamp:
2011-04-21T21:06:54+12:00 (13 years ago)
Author:
ak19
Message:

Xiaofeng found that the OAI-related changes to do with earliestDatestamp were causing problems for him when a die statement got executed. It just prints a warning now.

File:
1 edited

Legend:

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

    r23939 r23946  
    565565    if(!-d $archivedir) {
    566566    $archivedir = &util::filename_cat ($ENV{'GSDLCOLLECTDIR'}, "export");
    567     }   
    568     if(-d $archivedir) {
    569     my $earliestDatestampFile = &util::filename_cat ($archivedir, "earliestDatestamp");
    570     open(FIN,"<$earliestDatestampFile") || die "{common.cannot_open} $earliestDatestampFile: $!\n";
    571     my $earliestDatestamp;
     567    }
     568    my $earliestDatestampFile = &util::filename_cat ($archivedir, "earliestDatestamp");
     569    my $earliestDatestamp = 0;
     570    if (open(FIN,"<$earliestDatestampFile")) {
    572571    {
    573572        # slurp in file as a single line
     
    576575        #&unicode::ensure_utf8(\$earliestDatestamp); # turn any high bytes that aren't valid utf-8 into utf-8.
    577576    }
    578     close(FIN);
    579     $build_cfg->{'earliestDatestamp'} = $earliestDatestamp;
    580     }
    581 
     577    close(FIN);
     578    }
     579    else {
     580    print $outhandle "Warning: unable to read collection's earliestDatestamp from $earliestDatestampFile.\n";
     581    print $outhandle "Setting value to 0.\n";
     582    }
     583    $build_cfg->{'earliestDatestamp'} = $earliestDatestamp;
     584   
    582585    $self->build_cfg_extra($build_cfg);
    583586
Note: See TracChangeset for help on using the changeset viewer.