]> git.donarmstrong.com Git - bin.git/blob - buildd_sign
add buildd sign
[bin.git] / buildd_sign
1 #!/bin/sh
2
3
4 #set -x;
5 set -e;
6 for a in "$@"; do
7     if egrep -q '^Subject: Log.+successful' "$a"; then
8         RETURN_PATH=$(awk -F': ' '/^Return-Path:/{print $2}' "$a")
9         SUBJECT=$(awk -F': ' '/^Subject:/{print $2}' "$a")
10         KEY=9D05D0BE
11         TEMPDIR=$(mktemp -d)
12         cp "$a" "$TEMPDIR/reply"
13         buildd_script "$TEMPDIR/reply"
14         gpg --no-verbose --batch --quiet --default-key $KEY  --armor --output $TEMPDIR/reply.signed --clearsign $TEMPDIR/reply >/dev/null 2>&1
15         mutt -e 'set content_type="text/plain; charset=utf-8; x-action=pgp-signed"' -s "Re: $SUBJECT" "$RETURN_PATH" < $TEMPDIR/reply.signed
16         rm -f $TEMPDIR/reply $TEMPDIR/reply.signed
17         rmdir $TEMPDIR
18         mv "${a}" "${a}RS";
19         if echo "$a"|grep -q 'new/'; then
20             rename 's{new/}{cur/}' "${a}RS";
21         else
22             mv "${a}RS" ../cur/"${a}RS";
23         fi;
24         echo "Handled '${SUBJECT}'";
25     fi
26 done;