svn commit: r271412 - svnadmin/hooks/scripts

Bryan Drewery bdrewery at FreeBSD.org
Thu Sep 11 00:10:55 UTC 2014


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 at freebsd.org"
-echo "To: notify-bz at 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 at freebsd.org notify-bz at freebsd.org
+for pr in $PRS; do
+	(
+		echo "From: commit-hook at freebsd.org"
+		echo "To: notify-bz at 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 at freebsd.org notify-bz at freebsd.org
+done


More information about the svn-src-svnadmin mailing list