Skip to content
Snippets Groups Projects
Commit 6c4eeb77 authored by Andreas Romeyke's avatar Andreas Romeyke
Browse files

- __buildBag() uses signatures now

- simplifed title-check
parent f4fd8299
No related branches found
No related tags found
No related merge requests found
...@@ -334,26 +334,16 @@ sub create_slub_bagit($bagPath,$refAddBagInfo){ ...@@ -334,26 +334,16 @@ sub create_slub_bagit($bagPath,$refAddBagInfo){
return 1; return 1;
} }
sub __buildBag { sub __buildBag ($ppn, $noppn, $rightsFilePath, $aRefAddMetaFile, $refAddBagInfo, $bagPath, $metaPath){
my $ppn = shift;
my $noppn = shift;
my $rightsFilePath = shift;
my $aRefAddMetaFile = shift;
my $refAddBagInfo = shift;
my $bagPath = shift;
my $metaPath = shift;
# create meta dir # create meta dir
SLUB::LZA::SIPBuilderBagIt::createDir($metaPath); SLUB::LZA::SIPBuilderBagIt::createDir($metaPath);
my @addMetaFile = @{ $aRefAddMetaFile }; my @addMetaFile = @{ $aRefAddMetaFile };
my @addBagInfo = @{ $refAddBagInfo }; my @addBagInfo = @{ $refAddBagInfo };
my $marc21; my $marc21;
# get descriptive metadata from catalog # get descriptive metadata from catalog
if ($ppn) { if ($ppn) {
$marc21 = get_marc21_from_catalogue($ppn); $marc21 = get_marc21_from_catalogue($ppn);
} }
# copy not payload files to meta # copy not payload files to meta
SLUB::LZA::SIPBuilderBagIt::copyFilesToMeta($ppn, $metaPath, $rightsFilePath, \@addMetaFile, $marc21); SLUB::LZA::SIPBuilderBagIt::copyFilesToMeta($ppn, $metaPath, $rightsFilePath, \@addMetaFile, $marc21);
# add metadata for bag-info.txt # add metadata for bag-info.txt
...@@ -405,7 +395,7 @@ sub checkForTitle($key_hash_list_aref){ ...@@ -405,7 +395,7 @@ sub checkForTitle($key_hash_list_aref){
push @keys, keys %{$hash}; push @keys, keys %{$hash};
} }
# check for title # check for title
if (none { $_ =~ m/^[Tt][Ii][Tt][Ll][Ee]/ } @keys) { if (none { lc($_) =~ m/^title/ } @keys) {
print_scalar_data("", "WARNING: No Title given. Please consider adding a human-readable title with '--add_key_value=Title:YOUR-TITLE'", "", "yellow"); print_scalar_data("", "WARNING: No Title given. Please consider adding a human-readable title with '--add_key_value=Title:YOUR-TITLE'", "", "yellow");
return 0; return 0;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment