Created the dcp-recent script.
authorFredrik Tolf <fredrik@dolda2000.com>
Sun, 6 Jan 2008 00:57:17 +0000 (01:57 +0100)
committerFredrik Tolf <fredrik@dolda2000.com>
Sun, 6 Jan 2008 00:57:17 +0000 (01:57 +0100)
dcp-recent [new file with mode: 0755]

diff --git a/dcp-recent b/dcp-recent
new file mode 100755 (executable)
index 0000000..951ce25
--- /dev/null
@@ -0,0 +1,36 @@
+#!/bin/sh
+
+set -e
+
+usage() {
+    echo "usage: dcp-recent REPODIR"
+}
+
+rungit() {
+    (
+       cd "$repodir"
+       git "$@"
+    ) || false
+}
+
+if [ $# -lt 1 ]; then
+    usage >&2
+    exit 1
+fi
+
+repodir="$1"
+shift
+
+if [ ! -d "$repodir" ]; then
+    echo "dcp-recent: cannot find $repodir" >&2
+    exit 1
+fi
+
+if ! rungit tag -l | grep -q ^lastbuild$; then
+    exit 1
+fi
+
+lastbuild="$(rungit rev-parse lastbuild)"
+master="$(rungit rev-parse master)"
+
+[ "$master" = "$lastbuild" ]