File clusterssh-fix-docgen.patch of Package clusterssh

Author: Bernhard M. Wiedemann <bmwiedemann@opensuse.org>
Date: 2018-03-02

_build_docs is called 6 times - once for each file in bin

because of that, the old code was racy when using make -j
which is the default in openSUSE

https://bugzilla.opensuse.org/show_bug.cgi?id=1083835

Index: App-ClusterSSH-4.07/bin_PL/_build_docs
===================================================================
--- App-ClusterSSH-4.07.orig/bin_PL/_build_docs
+++ App-ClusterSSH-4.07/bin_PL/_build_docs
@@ -16,16 +16,15 @@ if(! -d $bindir) {
 print "Using perl binary: $^X",$/;
 print "Using perl version $^V",$/;
 
-for my $source (glob("*")) {
-    my $dest="$bindir/$source";
+my $dest = shift;
+my $source = $dest;
+$source =~ s{bin/}{};
+$dest = "../$dest";
 
-    next if($source =~ m/$Script/);
-    next if($source =~ m/\.x$/);
-
-    print "Generating: $source",$/;
+print "Generating: $dest from $source",$/;
 
     if(-f $dest) {
-        chmod(0777, $dest) || die "Could not chmod $dest for removing: $!";
+        chmod(0755, $dest) || die "Could not chmod $dest for removing: $!";
     }
 
     open(my $sfh, '<', $source) || die "Could not open $source for reading: $!";
@@ -44,4 +43,3 @@ for my $source (glob("*")) {
     close($dfh);
 
     chmod(0555, $dest) || die "Could not chmod $dest: $!";
-}
openSUSE Build Service is sponsored by