]> git.donarmstrong.com Git - bin.git/commitdiff
add buildd sign
authorDon Armstrong <don@donarmstrong.com>
Tue, 6 Mar 2012 23:05:16 +0000 (23:05 +0000)
committerDon Armstrong <don@donarmstrong.com>
Tue, 6 Mar 2012 23:05:16 +0000 (23:05 +0000)
buildd_sign [new file with mode: 0755]

diff --git a/buildd_sign b/buildd_sign
new file mode 100755 (executable)
index 0000000..f202716
--- /dev/null
@@ -0,0 +1,26 @@
+#!/bin/sh
+
+
+#set -x;
+set -e;
+for a in "$@"; do
+    if egrep -q '^Subject: Log.+successful' "$a"; then
+       RETURN_PATH=$(awk -F': ' '/^Return-Path:/{print $2}' "$a")
+       SUBJECT=$(awk -F': ' '/^Subject:/{print $2}' "$a")
+       KEY=9D05D0BE
+       TEMPDIR=$(mktemp -d)
+       cp "$a" "$TEMPDIR/reply"
+       buildd_script "$TEMPDIR/reply"
+       gpg --no-verbose --batch --quiet --default-key $KEY  --armor --output $TEMPDIR/reply.signed --clearsign $TEMPDIR/reply >/dev/null 2>&1
+       mutt -e 'set content_type="text/plain; charset=utf-8; x-action=pgp-signed"' -s "Re: $SUBJECT" "$RETURN_PATH" < $TEMPDIR/reply.signed
+       rm -f $TEMPDIR/reply $TEMPDIR/reply.signed
+       rmdir $TEMPDIR
+       mv "${a}" "${a}RS";
+       if echo "$a"|grep -q 'new/'; then
+           rename 's{new/}{cur/}' "${a}RS";
+       else
+           mv "${a}RS" ../cur/"${a}RS";
+       fi;
+       echo "Handled '${SUBJECT}'";
+    fi
+done;
\ No newline at end of file