5 if echo "$1"|grep -q 'RS$'; then
8 elif echo "$1"|grep -q 'S$'; then
12 if echo "$1"|grep -q 'new/'; then
13 rename 's{new/}{cur/}' "${1}RS";
14 elif echo "$1"|grep -q 'cur' || pwd|egrep -q 'cur/?$'; then
18 mv "${1}RS" ../cur/"${1}RS";
26 RETURN_PATH=$(awk -F': ' '/^Return-Path:/{print $2}' "$a")
27 SUBJECT=$(awk -F': ' '/^Subject:/{print $2}' "$a")
29 if egrep -q '^Subject: Log.+successful' "$a"; then
31 cp "$a" "$TEMPDIR/reply"
32 buildd_script "$TEMPDIR/reply"
33 gpg --no-verbose --batch --quiet --default-key $KEY --armor --output $TEMPDIR/reply.signed --clearsign $TEMPDIR/reply >/dev/null 2>&1
34 mutt -e 'set content_type="text/plain; charset=utf-8; x-action=pgp-signed"' -s "Re: $SUBJECT" "$RETURN_PATH" < $TEMPDIR/reply.signed
35 rm -f $TEMPDIR/reply $TEMPDIR/reply.signed
38 echo "Handled '${SUBJECT}'";
39 elif egrep -q '^Subject: Log.+attempted' "$a" &&
40 egrep -q "ERROR: a 'NAMESPACE' file is required" "$a"; then
41 echo 'fail no namespace'| \
42 mutt -e 'set content_type="text/plain; charset=utf-8"' -s "Re: $SUBJECT" "$RETURN_PATH";
44 echo "Handled '${SUBJECT}'";
45 elif egrep -q '^Subject: Should I build' "$a"; then
47 mutt -e 'set content_type="text/plain; charset=utf-8"' -s "Re: $SUBJECT" "$RETURN_PATH";
49 echo "Handled '${SUBJECT}'";
50 elif egrep -q '^Subject: Log.+attempted' "$a" &&
51 egrep -q "ERROR: dependency .* is not available for package .*" "$a"; then
52 (echo -n 'fail '; egrep "ERROR: dependency .* is not available for package .*" "$a")| \
53 mutt -e 'set content_type="text/plain; charset=utf-8"' -s "Re: $SUBJECT" "$RETURN_PATH";
55 echo "Handled '${SUBJECT}'";
56 elif egrep -q '^Subject: Log.+attempted' "$a" &&
57 egrep -q "ERROR: compilation failed for package .*" "$a"; then
58 (echo -n 'fail '; grep "error|fail" "$a"|sed 's/\n//g')| \
59 mutt -e 'set content_type="text/plain; charset=utf-8"' -s "Re: $SUBJECT" "$RETURN_PATH";
61 echo "Handled '${SUBJECT}'";
62 elif egrep -q '^Subject: Log.+attempted' "$a" &&
63 egrep -q "ERROR: configuration failed for package .*" "$a"; then
64 (echo -n 'fail '; grep "error|fail" "$a"|sed 's/\n//g')| \
65 mutt -e 'set content_type="text/plain; charset=utf-8"' -s "Re: $SUBJECT" "$RETURN_PATH";
67 echo "Handled '${SUBJECT}'";
68 elif egrep -q '^Subject: Log.+attempted' "$a" &&
69 (egrep -q "Error *: package .* was found, but .* is required" "$a" ||
70 egrep -q "Error *: package .* was built before R" "$a"
73 mutt -e 'set content_type="text/plain; charset=utf-8"' -s "Re: $SUBJECT" "$RETURN_PATH";
75 echo "Handled '${SUBJECT}'";
76 elif egrep -q '^Subject: Log.+attempted' "$a"; then
77 echo "Unsure about '$SUBJECT'; giving back";
80 mutt -e 'set content_type="text/plain; charset=utf-8"' -s "Re: $SUBJECT" "$RETURN_PATH";
82 echo "Handled '${SUBJECT}'";
84 echo "Marking '$SUBJECT' read";
86 echo "Handled '${SUBJECT}'";