diff --git a/bin/slubsipbuilderbagit.pl b/bin/slubsipbuilderbagit.pl index 109418fbe509758e7d24b406cd51023169f20bec..68e2bf7fba2c65bdaec6d720746252bcc4000ae9 100644 --- a/bin/slubsipbuilderbagit.pl +++ b/bin/slubsipbuilderbagit.pl @@ -585,6 +585,11 @@ PATCH my @addBagInfo = @{ $refAddBagInfo }; my ($mods, $marc21); + # get descriptive metadata from catalog + if ($ppn) { + $marc21 = get_marc21_from_catalogue($ppn); + $mods = get_mods_from_marc21($marc21); + } # create bag dir SLUB::LZA::SIPBuilderBagIt::createDir($bagPath); # create data dir @@ -592,11 +597,6 @@ PATCH # copy payload files to data print_scalar_data("", "INFO: copying original data...", "", "white"); dircopy($ieDirectory, $dataPath) || die ("Error coping $ieDirectory to $dataPath"); - # get descriptive metadata from catalog - if ($ppn) { - $marc21 = get_marc21_from_catalogue($ppn); - $mods = get_mods_from_marc21($marc21); - } # create meta dir SLUB::LZA::SIPBuilderBagIt::createDir($metaPath); # copy not payload files to meta @@ -627,16 +627,16 @@ PATCH my @addBagInfo = @{ $refAddBagInfo }; my ($mods, $marc21); - # create bag dir - SLUB::LZA::SIPBuilderBagIt::createDir($bagPath); - # move payloads to data dir (which is automatically renamed from IE Directory) - print_scalar_data("", "INFO: moving original data...", "", "white"); - dirmove($ieDirectory, $dataPath) || die ("Error moving $ieDirectory to $dataPath"); # get descriptive metadata from catalog if ($ppn) { $marc21 = get_marc21_from_catalogue($ppn); $mods = get_mods_from_marc21($marc21); } + # create bag dir + SLUB::LZA::SIPBuilderBagIt::createDir($bagPath); + # move payloads to data dir (which is automatically renamed from IE Directory) + print_scalar_data("", "INFO: moving original data...", "", "white"); + dirmove($ieDirectory, $dataPath) || die ("Error moving $ieDirectory to $dataPath"); # create meta dir SLUB::LZA::SIPBuilderBagIt::createDir($metaPath); # copy not payload files to meta @@ -667,16 +667,16 @@ PATCH my @addBagInfo = @{ $refAddBagInfo }; my ($mods, $marc21); - # create bag dir - SLUB::LZA::SIPBuilderBagIt::createDir($bagPath); - # move payloads to data dir (which is automatically renamed from IE Directory) - print_scalar_data("", "INFO: moving original data...", "", "white"); - dirmove($ieDirectory, $dataPath) || die ("Error moving $ieDirectory to $dataPath"); # get descriptive metadata from catalog if ($ppn) { $marc21 = get_marc21_from_catalogue($ppn); $mods = get_mods_from_marc21($marc21); } + # create bag dir + SLUB::LZA::SIPBuilderBagIt::createDir($bagPath); + # move payloads to data dir (which is automatically renamed from IE Directory) + print_scalar_data("", "INFO: moving original data...", "", "white"); + dirmove($ieDirectory, $dataPath) || die ("Error moving $ieDirectory to $dataPath"); # create meta dir SLUB::LZA::SIPBuilderBagIt::createDir($metaPath); # copy not payload files to meta