Skip to content

Commit

Permalink
Fix for issue: #40
Browse files Browse the repository at this point in the history
regex to catch the apostrophe in filename transformation on disk
improved error handling to provide more details on the error in the log
  • Loading branch information
photomedia committed Feb 21, 2022
1 parent 56fb33a commit ea90570
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/plugins/EPrints/Plugin/Export/Archivematica/EPrint.pm
Expand Up @@ -95,6 +95,7 @@ sub output_dataobj

# and copy the file into the new file dir
my $filename = $file->get_value( "filename" );
$filename =~ s/\x27/=0027/g;
my $local_path = $doc->local_path . "/" . $filename;

my $h = $file->get_value( 'hash' );
Expand All @@ -115,7 +116,10 @@ sub output_dataobj
my $ht = $file->get_value( 'hash_type' );

$hash_cache{ "$file_path/$filename" } = $h if $h && $ht && $ht eq "MD5";
my $ok = copy($local_path, "$file_path/$filename"); # or warn "Copy failed: $!";
my $ok = copy($local_path, "$file_path/$filename");
if (! $ok) {# or warn "Copy failed: $!";
push @results, $self->_log("Error - COPY failed", "$!", 2);
}
push @results, $self->_log("Copy", "'$local_path' '$file_path/$filename'", $ok);
}
}
Expand Down

0 comments on commit ea90570

Please sign in to comment.