From: Don Armstrong Date: Tue, 6 Mar 2012 23:05:16 +0000 (+0000) Subject: add buildd sign X-Git-Url: https://git.donarmstrong.com/?p=bin.git;a=commitdiff_plain;h=6dabeed9dce105a6b227a0e86549cdb51206e415 add buildd sign --- diff --git a/buildd_sign b/buildd_sign new file mode 100755 index 0000000..f202716 --- /dev/null +++ b/buildd_sign @@ -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