svn commit: r341044 - in svnadmin/hooks: . scripts
Mathieu Arnold
mat at FreeBSD.org
Sat Jan 25 15:37:16 UTC 2014
Author: mat
Date: Sat Jan 25 15:37:15 2014
New Revision: 341044
URL: http://svnweb.freebsd.org/changeset/ports/341044
QAT: https://qat.redports.org/buildarchive/r341044/
Log:
Add a hook to forbid committing to vulk.xml and other files at the same time.
With hat: portmgr
Sponsored by: Absolight
Added:
svnadmin/hooks/scripts/vulnxml-unique.sh (contents, props changed)
Modified:
svnadmin/hooks/pre-commit
Modified: svnadmin/hooks/pre-commit
==============================================================================
--- svnadmin/hooks/pre-commit Sat Jan 25 15:35:43 2014 (r341043)
+++ svnadmin/hooks/pre-commit Sat Jan 25 15:37:15 2014 (r341044)
@@ -95,6 +95,9 @@ mergeinfo.sh "$REPO" "$TXN" || exit 1
# check NO_STAGE in commits
stage-only.sh "$REPO" "$TXN" || exit 1
+# check commits to vulk.xml don't have other files
+vulnxml_unique.sh "$REPO" "$TXN" || exit 1
+
# check for merge debris
detect-merge-conflicts.sh "$REPO" "$TXN" || exit 1
Added: svnadmin/hooks/scripts/vulnxml-unique.sh
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ svnadmin/hooks/scripts/vulnxml-unique.sh Sat Jan 25 15:37:15 2014 (r341044)
@@ -0,0 +1,44 @@
+#!/bin/sh
+# $FreeBSD$
+
+# Check that security/vuxml/vuln.xml is not committed together with other files
+
+REPO=$1
+TXN=$2
+
+# check arguments
+if [ -z "$REPO" -o -z "$TXN" ] ; then
+ echo "Syntax: $0 path_to_repos txn_id" >&2
+ exit 1
+fi
+
+# no commit to vuln.xml or other files yet
+VULN_XML=0
+OTHER=0
+
+# see what has changed
+OIFS=${IFS}
+IFS=$'\n'
+for line in $(svnlook changed -t $TXN $REPO) ; do
+ IFS=${OIFS}
+ set -- $line
+ type=$1
+ fpath=$2
+ case $fpath in
+ */security/vuxml/vuln.xml)
+ VULN_XML=1
+ ;;
+ *)
+ OTHER=1
+ ;;
+ esac
+done
+
+# yell
+if [ $VULN_XML -gt 0 -a $OTHER -gt 0 ] ; then
+ echo "Commit to security/vuxml/vuln.xml first, and then other files"
+ exit 1
+fi
+
+# ok
+exit 0
More information about the svn-ports-all
mailing list