From 5ca1b0fb3f2c05bddd8fc777714290e37db5af45 Mon Sep 17 00:00:00 2001 From: Jens Steidl <Jens.Steidl@slub-dresden.de> Date: Fri, 9 Oct 2020 18:18:50 +0200 Subject: [PATCH] - fix: getFileName fails on Windows paths, replaced with core function --- bin/slubsipbuilderbagit.pl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/bin/slubsipbuilderbagit.pl b/bin/slubsipbuilderbagit.pl index 96805ae..2bfe13c 100644 --- a/bin/slubsipbuilderbagit.pl +++ b/bin/slubsipbuilderbagit.pl @@ -45,6 +45,7 @@ package SLUB::LZA::SIPBuilderBagIt; use Encode; use File::Copy; use File::Copy::Recursive qw(dircopy dirmove); + use File::Basename; use File::Find; use LWP::UserAgent; # to get MARC data use MARC::Record; @@ -7868,8 +7869,8 @@ PATCH write_file("$metaPath/mods.xml", $mods); # rights.xml - if(getFileName($rightsFilePath) ne "rights.xml"){ - my $rights_name = getFileName($rightsFilePath); + if(basename($rightsFilePath) ne "rights.xml"){ + my $rights_name = basename($rightsFilePath); print_scalar_data("", "WARNING: Renaming " . $rights_name . " to rights.xml, because meta filename <rights.xml> is required.", "", "yellow"); print_scalar_data("", "INFO: Read Docu for more information at https://slubarchiv.slub-dresden.de/technische-standards-fuer-die-ablieferung-von-digitalen-dokumenten/", "", "white"); copy($rightsFilePath, $metaPath) or die "Copy failed: $!"; -- GitLab