Supply a 'modern' run_cron (written in perl)
authorHeiko Schlittermann <hs@schlittermann.de>
Tue, 1 Nov 2016 14:54:48 +0000 (15:54 +0100)
committerHeiko Schlittermann <hs@schlittermann.de>
Tue, 1 Nov 2016 15:20:07 +0000 (16:20 +0100)
This should avoid problems that arise from different shells.
Additionally start using comand names w/o script specfing extensions.

run_branches [new symlink]
run_build [new symlink]
run_cron [new file with mode: 0755]

diff --git a/run_branches b/run_branches
new file mode 120000 (symlink)
index 0000000..cfa3bcc
--- /dev/null
@@ -0,0 +1 @@
+run_branches.pl
\ No newline at end of file
diff --git a/run_build b/run_build
new file mode 120000 (symlink)
index 0000000..59b4a19
--- /dev/null
+++ b/run_build
@@ -0,0 +1 @@
+run_build.pl
\ No newline at end of file
diff --git a/run_cron b/run_cron
new file mode 100755 (executable)
index 0000000..caadf4b
--- /dev/null
+++ b/run_cron
@@ -0,0 +1,24 @@
+#!/usr/bin/env perl
+
+use 5.010;
+use strict;
+use warnings;
+use FindBin qw($Bin);
+
+chdir $Bin or die "$0: Can't chdir '$Bin': $!\n";
+
+# check if we've git available and if we've a cloned
+# client installation. FIXME: What to do, if we have
+# a 'detached' .git?
+if (-d '.git') {
+    my ($git) = grep { -x } map { "$_/git" } split /:/, $ENV{PATH};
+    system('git pull >/dev/null') == 0 or die $? >> 8;
+}
+
+# the process building the documentation seems to break
+# if PERL_UNICODE is set.
+delete $ENV{PERL_UNICODE};
+
+exec './run_branches', @ARGV;
+
+# vim:ts=8 et sw=4 ai si: