aboutsummaryrefslogtreecommitdiffstats
path: root/modules/subversion/templates/syntax_check.sh
blob: 76141e549850b376688b7c07e3a5a1e6c561fad4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/sh

REPOS="$1"
TXN="$2"
export PATH="/bin/:/sbin/:/usr/bin/:/usr/sbin/:/usr/local/bin:/usr/local/sbin/"

changed=`svnlook changed -t "$TXN" "$REPOS"`
files=`echo $changed | awk '{print $2}'`
if echo $files | grep "<%= @regexp_ext %>"
then
   svnlook cat -t "$TXN" "$REPOS" "$files" | <%= @check_cmd %>
   if [ $? -ne 0 ]
       then
       echo "Syntax error in $files." 1>&2
       echo "Check it with <%= @check_cmd %>" 1>&2 
       exit 1
   fi
fi

# All checks passed, so allow the commit.
exit 0