Changeset 18456 for gsdl/trunk/perllib/plugins/ArchivesInfPlugin.pm
- Timestamp:
- 2009-02-03T09:48:19+13:00 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
gsdl/trunk/perllib/plugins/ArchivesInfPlugin.pm
r18441 r18456 87 87 my ($self) = @_; 88 88 89 print STDERR "*** Running ArchivesInf deinit\n";90 91 89 my $archive_info = $self->{'archive_info'}; 92 90 93 91 if (defined $archive_info) { 92 print STDERR "********* have parsed and processed an archive info file\n"; 93 94 94 my $archive_info_filename = $self->{'archive_info_filename'}; 95 95 96 96 my $file_list = $archive_info->get_file_list(); 97 97 98 foreach my $subfile (@$file_list) { 98 foreach my $subfile (@$file_list) { 99 99 my $doc_oid = $subfile->[1]; 100 100 101 101 my $index_status = $archive_info->get_status_info($doc_oid); 102 print STDERR "*** Updating $doc_oid $index_status\n"; 103 102 104 if ($index_status eq "D") { 103 105 # delete … … 203 205 my $tmp = &util::filename_cat ($file, $subfile->[0]); 204 206 next if $tmp eq $file; 205 206 # We always process the file... 207 208 my $doc_oid = $subfile->[1]; 209 my $index_status = $archive_info->get_status_info($doc_oid); 210 211 my $curr_mode = $processor->get_mode(); 212 my $new_mode = $curr_mode; 213 214 # Start by assuming we want to process the file... 207 215 my $process_file = 1; 208 216 … … 211 219 { 212 220 # Check to see if the file needs indexing 213 my $doc_oid = $subfile->[1];214 my $index_status = $archive_info->get_status_info($doc_oid);215 221 if ($index_status eq "B") 216 222 { … … 218 224 $process_file = 0; 219 225 } 226 elsif ($index_status eq "D") { 227 # Need to be delete it from the index. 228 $new_mode = $curr_mode."delete"; 229 $process_file = 1; 230 } 231 elsif ($index_status eq "R") { 232 # Need to be delete it from the index. 233 $new_mode = $curr_mode."reindex"; 234 $process_file = 1; 235 } 236 } 237 # ... or we're being asked to delete it (in which case skip it) 238 elsif ($index_status eq "D") { 239 # Delete it somehow from archives dir!! 240 # => get short name, lop off filename, concat archivedir 241 # move to recyle bin 242 243 $process_file = 0; 220 244 } 221 245 222 246 if ($process_file) { 223 247 # note: metadata is not carried on to the next level 248 249 $processor->set_mode($new_mode) if ($new_mode ne $curr_mode); 250 224 251 $count += &plugin::read ($pluginfo, $base_dir, $tmp, $block_hash, {}, $processor, $maxdocs, ($total_count+$count), $gli); 225 } 226 252 253 $processor->set_mode($curr_mode) if ($new_mode ne $curr_mode); 254 } 227 255 } 228 256
Note:
See TracChangeset
for help on using the changeset viewer.