greenstone.org greenstone wiki greenstone trac planet greenstone

Changeset 16257

Show
Ignore:
Timestamp:
2008-07-01 12:01:11 (6 months ago)
Author:
mdewsnip
Message:

Tidied up the block of code that determines whether each doc.xml file should be processed (based on whether incremental building is enabled) to make it easier to follow.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • gsdl/trunk/perllib/plugins/ArchivesInfPlugin.pm

    r16013 r16257  
    138138            next if $tmp eq $file; 
    139139 
    140             # Decide if file needs to be processed 
    141             my $doc_oid = $subfile->[1]; 
    142             my $index_status = $archive_info->get_status_info($doc_oid); 
     140            # We always process the file... 
     141            my $process_file = 1; 
    143142 
    144             my $process_file = 0; 
    145              
    146             if (!$processor->is_incremental_capable() || !$self->{'incremental'}) { 
    147                 $process_file = 1; 
    148             } 
    149             else { 
    150                 # is incremental 
    151  
    152                 # check to see if file needs to be indexed 
    153                 $index_status = $archive_info->get_status_info($doc_oid); 
    154  
    155                 if ($index_status eq "I") { 
    156                     $process_file = 1; 
     143            # ...unless the build processor is incremental capable and -incremental was specified 
     144            if ($processor->is_incremental_capable() && $self->{'incremental'}) 
     145            { 
     146                # We don't need to process the file if it has already been built 
     147                my $doc_oid = $subfile->[1]; 
     148                my $index_status = $archive_info->get_status_info($doc_oid); 
     149                if ($index_status eq "B") 
     150                { 
     151                    # Don't process this file 
     152                    $process_file = 0; 
    157153                } 
    158154            }