summaryrefslogtreecommitdiffstats
path: root/krebs/5pkgs/Reaktor/scripts/random-issue.sh
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2016-01-14 16:39:34 +0100
committertv <tv@krebsco.de>2016-01-14 16:39:34 +0100
commit2ae2bdc586177f674a987e354940765ad86cbaa2 (patch)
tree0ba9baf9ff358a9eb2bb1111090d513b93268df7 /krebs/5pkgs/Reaktor/scripts/random-issue.sh
parent780ddec4ab268fbfd43ea9bf511ed4b3b0d35783 (diff)
parent49b6fd9c87678893ed47794b116660700994b1bc (diff)
Merge remote-tracking branch 'gum/master'
Diffstat (limited to 'krebs/5pkgs/Reaktor/scripts/random-issue.sh')
-rw-r--r--krebs/5pkgs/Reaktor/scripts/random-issue.sh20
1 files changed, 20 insertions, 0 deletions
diff --git a/krebs/5pkgs/Reaktor/scripts/random-issue.sh b/krebs/5pkgs/Reaktor/scripts/random-issue.sh
new file mode 100644
index 000000000..5c47c6156
--- /dev/null
+++ b/krebs/5pkgs/Reaktor/scripts/random-issue.sh
@@ -0,0 +1,20 @@
+#! /bin/sh
+set -eu
+# requires env:
+# $state_dir
+# $origin
+
+# in PATH: git,lentil,coreutils
+subdir=`echo "$1" | tr -dc "[:alnum:]"`
+name=`echo "$origin" | tr -dc "[:alnum:]"`
+track="$state_dir/$name-checkout"
+(if test -e "$track" ;then
+ cd "$track"
+ git fetch origin master
+ git reset --hard origin/master
+else
+ git clone "$origin" "$track"
+fi) >&2
+
+cd "$track"
+lentil "${subdir:-.}" -f csv | sed 1d | shuf | head -1