Date: Thu, 11 Sep 2014 00:10:54 +0000 (UTC) From: Bryan Drewery <bdrewery@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org Subject: svn commit: r271412 - svnadmin/hooks/scripts Message-ID: <201409110010.s8B0AsVK059259@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: bdrewery Date: Thu Sep 11 00:10:54 2014 New Revision: 271412 URL: http://svnweb.freebsd.org/changeset/base/271412 Log: Fix bugzilla dfilter script to handle: 1. Multiple PR per line 2. Multiple PR 3. PR lines with extra stuff after them such as references and (notes) PR: ports/190866 [1] PR: ports/191064 [2] Reported by: many Submitted by: ak, bdrewery Acked by: peter Modified: svnadmin/hooks/scripts/notify_bz.sh Modified: svnadmin/hooks/scripts/notify_bz.sh ============================================================================== --- svnadmin/hooks/scripts/notify_bz.sh Wed Sep 10 22:37:20 2014 (r271411) +++ svnadmin/hooks/scripts/notify_bz.sh Thu Sep 11 00:10:54 2014 (r271412) @@ -14,28 +14,30 @@ if [ -z "$REV" -o -z "$REPO" -o ! -d "$R exit 1 fi -PR="$(svnlook info "$REPO" -r "$REV" | sed -nE -e 's/^[ ]*[pP][rR]:[ ]*[a-zA-Z]+\/([0-9]+)/\1/p' -e 's/^[ ]*[pP][rR]:[ ]*([0-9]+)/\1/p')" +PRS="$(svnlook info "$REPO" -r "$REV" | grep -e '^[[:space:]]*[pP][rR]:[[:space:]]*'|grep -Eo '([a-zA-Z]+\/)*[^[]([0-9]+)[^]]'|sed -Ee 's,[[:space:]],,g' -e 's,[a-zA-Z]+\/,,g')" -if [ -z "$PR" ]; then +if [ -z "$PRS" ]; then exit 0 fi WHO="$(svnlook author "$REPO" -r "$REV")" -( -echo "From: commit-hook@freebsd.org" -echo "To: notify-bz@freebsd.org" -echo "Subject: [Bug $PR]" -echo "" -echo "A commit references this bug:" -echo "" -echo "Author: $WHO" -echo "Date: $(date)" -echo "New revision: $REV" -echo "URL: http://svnweb.freebsd.org/changeset/base/$REV" -echo "" -echo "Log:" -svnlook log "$REPO" -r "$REV" | sed -e 's/^/ /' -echo "" -echo "Changes:" -svnlook changed "$REPO" -r "$REV" | sed -E -e 's/^[A-Z]*[ ]+/ /' -) | sed -e 's/^[ ]*$//' | cat -s | /usr/sbin/sendmail -oi -f commit-hook@freebsd.org notify-bz@freebsd.org +for pr in $PRS; do + ( + echo "From: commit-hook@freebsd.org" + echo "To: notify-bz@freebsd.org" + echo "Subject: [Bug $pr]" + echo "" + echo "A commit references this bug:" + echo "" + echo "Author: $WHO" + echo "Date: $(date)" + echo "New revision: $REV" + echo "URL: http://svnweb.freebsd.org/changeset/ports/$REV" + echo "" + echo "Log:" + svnlook log "$REPO" -r "$REV" | sed -e 's/^/ /' + echo "" + echo "Changes:" + svnlook changed "$REPO" -r "$REV" | sed -E -e 's/^[A-Z]*[ ]+/ /' + ) | sed -e 's/^[ ]*$//' | cat -s | /usr/sbin/sendmail -oi -f commit-hook@freebsd.org notify-bz@freebsd.org +done
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201409110010.s8B0AsVK059259>