Changeset 17320


Ignore:
Timestamp:
2008-09-18T12:07:39+12:00 (16 years ago)
Author:
kjdon
Message:

found and fixed what I think is a bug - in the metadata structures for metadata_read, file targets are local to the current subdirectory. But when we look for directory stuff, its using path local to the base dir (import). So when add the file target into the subdir_extrametakeys, need to add on the local dir

File:
1 edited

Legend:

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

    r17313 r17320  
    296296    my $self = shift (@_);
    297297    my ($pluginfo, $base_dir, $file, $block_hash, $in_metadata, $processor, $maxdocs, $total_count, $gli) = @_;
    298    
     298
    299299    my $outhandle = $self->{'outhandle'};
    300300    my $verbosity = $self->{'verbosity'};
     
    412412        my $subdir_rec = { 're' => $subdir_re, 'md' => $md };
    413413
    414         push(@{$subdir_extrametakeys->{$extrakey_dir}},$subdir_rec);
     414        # when its looked up, it must be relative to the base dir
     415        push(@{$subdir_extrametakeys->{"$local_dirname$extrakey_dir"}},$subdir_rec);
     416        #push(@{$subdir_extrametakeys->{"$extrakey_dir"}},$subdir_rec);
    415417    }
    416418    }
     
    512514    # Next add metadata read in XML files (if it is supplied)
    513515    if ($additionalmetadata == 1) {
    514        
    515516        my ($filespec, $mdref);
    516517        foreach $filespec (@extrametakeys) {
    517         #print STDERR "filespec $filespec\n";
    518                 ## use the utf8 encoded filename to do the filename comparison
     518        ## use the utf8 encoded filename to do the filename comparison
    519519        if ($tmpfile =~ /^$filespec$/) {
    520520            print $outhandle "File \"$subfile\" matches filespec \"$filespec\"\n"
Note: See TracChangeset for help on using the changeset viewer.