Changeset 10156


Ignore:
Timestamp:
2005-06-23T11:19:53+12:00 (19 years ago)
Author:
davidb
Message:

Extra functionality introduced to support incremental building.

Location:
trunk/gsdl/perllib/plugins
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/perllib/plugins/ArcPlug.pm

    r9853 r10156  
    6363}
    6464
     65sub deinit {
     66    my ($self) = @_;
     67
     68    my $archive_info = $self->{'archive_info'};
     69
     70    if (defined $archive_info) {
     71    my $archive_info_filename = $self->{'archive_info_filename'};
     72
     73        my $file_list = $archive_info->get_file_list();
     74
     75    # change each file to "Been Indexed"
     76
     77    foreach my $subfile (@$file_list) {
     78        my $doc_oid = $subfile->[1];
     79        $index_status = $archive_info->get_status_info($doc_oid);
     80        $archive_info->set_status_info($doc_oid,"B");
     81    }
     82
     83    $archive_info->save_info($archive_info_filename);
     84    }
     85}
     86
    6587# return 1 if this class might recurse using $pluginfo
    6688sub is_recursive {
     
    6991    return 1;
    7092}
     93
     94
     95
    7196
    7297# return number of files processed, undef if can't process
     
    82107    # see if this has a archives information file within it
    83108    my $archive_info_filename = &util::filename_cat($base_dir,$file,"archives.inf");
     109    $self->{'archive_info_filename'} = $archive_info_filename;
    84110
    85111    if (-e $archive_info_filename) {
     
    90116    # read in the archives information file
    91117    my $archive_info = new arcinfo ();
     118    $self->{'archive_info'} = $archive_info;
     119
    92120    $archive_info->load_info ($archive_info_filename);
    93121   
     
    100128        my $tmp = &util::filename_cat ($file, $subfile->[0]);
    101129        next if $tmp eq $file;
    102         # note: metadata is not carried on to the next level
    103         $count += &plugin::read ($pluginfo, $base_dir, $tmp, {}, $processor, $maxdocs, ($total_count+$count), $gli);
     130       
     131        my $doc_oid = $subfile->[1];
     132
     133        $index_status = $archive_info->get_status_info($doc_oid);
     134
     135        my $processor_mode = $processor->get_mode();       
     136
     137        if (($processor_mode eq "infodb") || ($index_status eq "I")) {
     138
     139        # note: metadata is not carried on to the next level
     140        $count += &plugin::read ($pluginfo, $base_dir, $tmp, {}, $processor, $maxdocs, ($total_count+$count), $gli);
     141        }
     142
    104143    }
    105144
  • trunk/gsdl/perllib/plugins/RecPlug.pm

    r9853 r10156  
    166166}
    167167
     168sub begin {
     169    my $self = shift (@_);
     170    my ($pluginfo, $base_dir, $processor, $maxdocs) = @_;
     171
     172    my $proc_package_name = ref $processor;
     173
     174    if ($proc_package_name !~ /buildproc$/) {
     175
     176    # Only lookup timestamp info for import.pl
     177
     178    my $output_dir = $processor->getoutputdir();
     179    my $archives_inf = &util::filename_cat($output_dir,"archives.inf");
     180   
     181    if ( -e $archives_inf ) {
     182        $self->{'inf_timestamp'} = -M $archives_inf;
     183    }
     184    }
     185
     186    $self->SUPER::begin($pluginfo, $base_dir, $processor, $maxdocs);
     187}
     188
     189
    168190# return 1 if this class might recurse using $pluginfo
    169191sub is_recursive {
     
    413435        }
    414436    }
    415    
     437
     438
     439    my $file_subfile = &util::filename_cat($file, $subfile);
     440    my $filename_subfile
     441        = &util::filename_cat($this_file_base_dir,$file_subfile);
     442    if (defined $self->{'inf_timestamp'}) {
     443        my $inf_timestamp = $self->{'inf_timestamp'};
     444
     445        if (! -d $filename_subfile) {
     446        my $filename_timestamp = -M $filename_subfile;
     447        if ($filename_timestamp > $inf_timestamp) {
     448            # filename has been around for longer than inf
     449#####           print $outhandle "**** Skipping $subfile\n";
     450            next;
     451        }
     452        }
     453    }
     454
    416455    # Recursively read each $subfile
    417456    print $outhandle "RecPlug recurring: $subfile\n" if ($verbosity > 2);
    418457   
    419458    $count += &plugin::read ($pluginfo, $this_file_base_dir,
    420                  &util::filename_cat($file, $subfile),
     459                 $file_subfile,
    421460                 $out_metadata, $processor, $maxdocs, ($total_count + $count), $gli);
    422461    }
Note: See TracChangeset for help on using the changeset viewer.