From cf74759af98e4a9d5e2edd923d9eab613feac2c8 Mon Sep 17 00:00:00 2001
From: Jens Steidl <Jens.Steidl@slub-dresden.de>
Date: Wed, 17 Mar 2021 13:19:20 +0100
Subject: [PATCH] - added/updated return values

---
 bin/slubsipbuilderbagit.pl | 19 ++++++++++++++++---
 1 file changed, 16 insertions(+), 3 deletions(-)

diff --git a/bin/slubsipbuilderbagit.pl b/bin/slubsipbuilderbagit.pl
index 3cf56ba..b95f7c2 100644
--- a/bin/slubsipbuilderbagit.pl
+++ b/bin/slubsipbuilderbagit.pl
@@ -437,6 +437,7 @@ PATCH
         if(! -d $path && ! -f $path){
             mkdir($path) or die "Could not mkdir $path: $!";
         }
+        return 1;
     }
 
     sub copyFilesToMeta($$$$$$){
@@ -488,6 +489,8 @@ PATCH
         }else{
             copy($rightsFilePath, $metaPath) or die "Copy failed: $!";
         }
+
+        return 1;
     }
 
     sub validateRightsXML($$){
@@ -543,7 +546,8 @@ PATCH
             my $body = $p . $string;
             printf "%" . length($body) . "s\n", colored($body, "bold $pColor") if $priority >= $VERBOSE;
         }
-        return;
+
+        return 1;
     }
 
     sub create_slub_bagit($$){
@@ -601,6 +605,8 @@ PATCH
         # create slub bagit
         print_scalar_data("", "INFO: building SIP...", "", "white");
         SLUB::LZA::SIPBuilderBagIt::create_slub_bagit($bagPath, \@addBagInfo);
+
+        return 1;
     }
 
     sub buildBagWithMoveOption($$$$$$$$$){
@@ -639,6 +645,8 @@ PATCH
         # create slub bagit
         print_scalar_data("", "INFO: building SIP...", "", "white");
         SLUB::LZA::SIPBuilderBagIt::create_slub_bagit($bagPath, \@addBagInfo);
+
+        return 1;
     }
 
     sub buildBagWithReplaceOption($$$$$$$$$){
@@ -677,6 +685,8 @@ PATCH
         # create slub bagit
         print_scalar_data("", "INFO: building SIP...", "", "white");
         SLUB::LZA::SIPBuilderBagIt::create_slub_bagit($bagPath, \@addBagInfo);
+
+        return 1;
     }
 
     sub checkForTitle($){
@@ -690,8 +700,11 @@ PATCH
             push @keys, keys %{$hash};
         }
         # check for title
-        print_scalar_data("", "WARNING: No Title given. Please consider adding a human-readable title with '--add_key_value=Title:YOUR-TITLE'", "", "yellow")
-            if none { $_ =~ m/^[Tt][Ii][Tt][Ll][Ee]/ } @keys;
+        if (none { $_ =~ m/^[Tt][Ii][Tt][Ll][Ee]/ } @keys) {
+            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 1;
     }
 
 # end package
-- 
GitLab