Changeset 31459
- Timestamp:
- 2017-03-06T13:54:36+13:00 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone2/perllib/plugins/DirectoryPlugin.pm
r30681 r31459 31 31 32 32 use extrametautil; 33 use PrintInfo;33 use EncodingUtil; 34 34 use plugin; 35 35 use util; … … 47 47 48 48 BEGIN { 49 @DirectoryPlugin::ISA = (' PrintInfo');49 @DirectoryPlugin::ISA = ('EncodingUtil'); 50 50 } 51 51 … … 81 81 push(@{$hashArgOptLists->{"OptList"}},$options); 82 82 83 my $self = new PrintInfo($pluginlist, $inputargs, $hashArgOptLists);83 my $self = new EncodingUtil($pluginlist, $inputargs, $hashArgOptLists); 84 84 85 85 if ($self->{'info_only'}) { … … 395 395 } 396 396 397 398 397 # Recur over directory contents. 399 398 my (@dir, $subfile); … … 435 434 # but with URL style slashes. 436 435 my $local_dirname = &util::filename_within_directory_url_format($dirname, $base_dir); 436 ### need it in perl unicode, not raw filesystem 437 my $filename_encoding = $self->guess_filesystem_encoding(); 438 439 # copied this from set_Source_metadata in BasePlugin 440 if ((defined $filename_encoding) && ($filename_encoding ne "ascii")) { 441 # Use filename_encoding to map raw filename to a Perl unicode-aware string 442 $local_dirname = decode($filename_encoding,$local_dirname); 443 } 444 else { 445 # otherwise generate %xx encoded version of filename for char > 127 446 $local_dirname = &unicode::raw_filename_to_url_encoded($local_dirname); 447 } 437 448 438 449 # if we are in import folder, then local_dirname will be empty … … 451 462 } 452 463 delete($self->{'subdir_extrametakeys'}->{$local_dirname}); 453 } 464 } 454 465 } 455 466 # apply metadata pass for each of the files in the directory -- ignore … … 487 498 488 499 my ($subdir_re,$extrakey_dir) = &util::url_fileparse($ek); 489 490 500 if ($extrakey_dir ne "") { 491 501 # a subdir was specified … … 555 565 next; 556 566 } 557 print STDERR "** DirectoryPlugin processing $raw_full_filename\n"; 567 558 568 # Follow Windows shortcuts 559 569 if ($raw_subfile =~ m/(?i)\.lnk$/ && (($ENV{'GSDLOS'} =~ m/^windows$/i) && ($^O ne "cygwin"))) {
Note:
See TracChangeset
for help on using the changeset viewer.