File earlier_execute_precommand.patch of Package storeBackup

--- bin/storeBackup.pl	2014-04-24 06:47:17.000000000 +0200
+++ bin/storeBackup_new.pl	2015-12-05 10:13:56.775693955 +0100
@@ -2677,6 +2677,8 @@
 	unless exists $suppressWarning{'use_DB_File'};
 }
 
+
+
 # OS-Typ feststellen, um ARG_MAX zu setzen
 # Default wird vorsichtshalber auf 4 KB gesetzt!
 {
@@ -2728,6 +2730,48 @@
 	      '-str' => ["preserve Perms is not set"])
     if $preservePerms eq 'no';
 
+
+#
+# precommand ausführen
+#
+if (defined $precommand)
+{
+    $prLog->print('-kind' => 'I',
+		  '-str' => ["starting pre command <@$precommand> ..."]);
+    my ($preComm, @preParam) = (@$precommand);
+    my $preco = forkProc->new('-exec' => $preComm,
+			      '-param' => \@preParam,
+			      '-workingDir' => '.',
+			      '-outRandom' => "$tmpdir/precomm-",
+			      '-prLog' => $prLog);
+    $preco->wait();
+    my $out = $preco->getSTDOUT();
+    $prLog->print('-kind' => 'W',
+		  '-str' => ["STDOUT of <@$precommand>:", @$out])
+	if (@$out > 0);
+    $out = $preco->getSTDERR();
+    $prLog->print('-kind' => 'E',
+		  '-str' => ["STDERR of <@$precommand>:", @$out])
+	if (@$out > 0);
+
+    my $status = $preco->get('-what' => 'status');
+    if ($status == 0)
+    {
+	$prLog->print('-kind' => 'I',
+		      '-str' =>
+		      ["pre command <@$precommand> finished with status 0"]);
+    }
+    else
+    {
+	$prLog->print('-kind' => 'E',
+		      '-str' => ["pre command <@$precommand> finished with " .
+				 "status $status, exiting"]);
+	unlink $lockFile if $lockFile;
+	exit 1;
+    }
+}
+
+
 #
 # initialise include, exclude and checkBlocks rules
 #
@@ -3238,45 +3282,7 @@
     $exTypes{$et} = 0;         # this is a flag and and also a counter
 }
 
-#
-# precommand ausführen
-#
-if (defined $precommand)
-{
-    $prLog->print('-kind' => 'I',
-		  '-str' => ["starting pre command <@$precommand> ..."]);
-    my ($preComm, @preParam) = (@$precommand);
-    my $preco = forkProc->new('-exec' => $preComm,
-			      '-param' => \@preParam,
-			      '-workingDir' => '.',
-			      '-outRandom' => "$tmpdir/precomm-",
-			      '-prLog' => $prLog);
-    $preco->wait();
-    my $out = $preco->getSTDOUT();
-    $prLog->print('-kind' => 'W',
-		  '-str' => ["STDOUT of <@$precommand>:", @$out])
-	if (@$out > 0);
-    $out = $preco->getSTDERR();
-    $prLog->print('-kind' => 'E',
-		  '-str' => ["STDERR of <@$precommand>:", @$out])
-	if (@$out > 0);
 
-    my $status = $preco->get('-what' => 'status');
-    if ($status == 0)
-    {
-	$prLog->print('-kind' => 'I',
-		      '-str' =>
-		      ["pre command <@$precommand> finished with status 0"]);
-    }
-    else
-    {
-	$prLog->print('-kind' => 'E',
-		      '-str' => ["pre command <@$precommand> finished with " .
-				 "status $status, exiting"]);
-	unlink $lockFile if $lockFile;
-	exit 1;
-    }
-}
 
 
 #
openSUSE Build Service is sponsored by