aboutsummaryrefslogtreecommitdiffstats
path: root/modules/subversion/templates
diff options
context:
space:
mode:
authorMichael Scherer <misc@mageia.org>2010-11-19 00:46:13 +0000
committerMichael Scherer <misc@mageia.org>2010-11-19 00:46:13 +0000
commit50830d1e9be5e6a6cefcbe48e63dd7c8dd9defce (patch)
tree90c6007b08847206ef71b0cfb65f38d361c7d8c5 /modules/subversion/templates
parent090867e1a559885b11c914c977cfd2843c5ee746 (diff)
downloadpuppet-50830d1e9be5e6a6cefcbe48e63dd7c8dd9defce.tar
puppet-50830d1e9be5e6a6cefcbe48e63dd7c8dd9defce.tar.gz
puppet-50830d1e9be5e6a6cefcbe48e63dd7c8dd9defce.tar.bz2
puppet-50830d1e9be5e6a6cefcbe48e63dd7c8dd9defce.tar.xz
puppet-50830d1e9be5e6a6cefcbe48e63dd7c8dd9defce.zip
- add a type to handle syntax check script
Diffstat (limited to 'modules/subversion/templates')
-rw-r--r--modules/subversion/templates/syntax_check.sh21
1 files changed, 21 insertions, 0 deletions
diff --git a/modules/subversion/templates/syntax_check.sh b/modules/subversion/templates/syntax_check.sh
new file mode 100644
index 00000000..2fe1671c
--- /dev/null
+++ b/modules/subversion/templates/syntax_check.sh
@@ -0,0 +1,21 @@
+#!/bin/sh
+
+REPOS="$1"
+TXN="$2"
+
+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 %>"
+ exit 1
+ fi
+fi
+
+# All checks passed, so allow the commit.
+exit 0
+