#!/bin/bash REPOS="$1" TXN="$2" PHP="/usr/local/php/bin/php" SVNLOOK="/usr/bin/svnlook" RUNSCRIPT="/path/to/run/php/script" CHANGED=`$SVNLOOK changed -t "$TXN" "$REPOS" | grep '^[U|A]' | awk '{print $2}'` for FILE in $CHANGED; do if [[ "$FILE" =~ \.php$ ]]; then TEMPFILE=`mktemp` $SVNLOOK cat -t "$TXN" "$REPOS" "$FILE" > $TEMPFILE MESSAGE=`$PHP $RUNSCRIPT --format console --src $TEMPFILE | head -n -2` if [ ! -z "$MESSAGE" ]; then rm -rf $TEMPFILE echo "$MESSAGE" | sed -e "s|$TEMPFILE|$FILE|" 1>&2 exit 1 fi rm -rf $TEMPFILE fi done