aboutsummaryrefslogtreecommitdiffstats
path: root/modules/subversion/templates
diff options
context:
space:
mode:
authorNicolas Vigier <boklm@mageia.org>2010-12-21 19:20:24 +0000
committerNicolas Vigier <boklm@mageia.org>2010-12-21 19:20:24 +0000
commita3082b0aa13b26952e9db674af8f62555615fccf (patch)
treeeba658eb5fbadec35ca241c6fdee83d07fa607c2 /modules/subversion/templates
parent867747110eac381ba4e1aca96dfef9bbe64177c8 (diff)
downloadpuppet-a3082b0aa13b26952e9db674af8f62555615fccf.tar
puppet-a3082b0aa13b26952e9db674af8f62555615fccf.tar.gz
puppet-a3082b0aa13b26952e9db674af8f62555615fccf.tar.bz2
puppet-a3082b0aa13b26952e9db674af8f62555615fccf.tar.xz
puppet-a3082b0aa13b26952e9db674af8f62555615fccf.zip
add pre-commit script to prevent commit of some binary files
Diffstat (limited to 'modules/subversion/templates')
-rw-r--r--modules/subversion/templates/no_binary14
1 files changed, 14 insertions, 0 deletions
diff --git a/modules/subversion/templates/no_binary b/modules/subversion/templates/no_binary
new file mode 100644
index 00000000..5787eae7
--- /dev/null
+++ b/modules/subversion/templates/no_binary
@@ -0,0 +1,14 @@
+#!/bin/sh
+
+REP="$1"
+TXN="$2"
+
+# Filter some binary files based on common filename extentions.
+# It does not fully prevent commit of binary files, this script is only
+# here to avoid simple mistakes
+if svnlook changed -t "$TXN" "$REP" | grep -qi '\.\(gz\|bz2\|xz\|lzma\|Z\|7z\|tar\|tgz\|zip\|jpg\|gif\|png\|ogg\|mp3\|wav\|rar\|pdf\)$'
+then
+ echo 'no binary files allowed on this repository'
+ exit 1
+fi
+