diff options
author | Michael Scherer <misc@mageia.org> | 2010-11-19 00:46:14 +0000 |
---|---|---|
committer | Michael Scherer <misc@mageia.org> | 2010-11-19 00:46:14 +0000 |
commit | 21785e5487d97f6ea61cdfc8ea91c2cce682c1df (patch) | |
tree | 1d645cbdae10e72f85013f0798be6a4daa8f6c5d | |
parent | 50830d1e9be5e6a6cefcbe48e63dd7c8dd9defce (diff) | |
download | puppet-21785e5487d97f6ea61cdfc8ea91c2cce682c1df.tar puppet-21785e5487d97f6ea61cdfc8ea91c2cce682c1df.tar.gz puppet-21785e5487d97f6ea61cdfc8ea91c2cce682c1df.tar.bz2 puppet-21785e5487d97f6ea61cdfc8ea91c2cce682c1df.tar.xz puppet-21785e5487d97f6ea61cdfc8ea91c2cce682c1df.zip |
add check for root and empty commit
-rw-r--r-- | modules/subversion/manifests/init.pp | 16 | ||||
-rw-r--r-- | modules/subversion/templates/no_empty_message | 12 | ||||
-rw-r--r-- | modules/subversion/templates/no_root_commit | 12 |
3 files changed, 40 insertions, 0 deletions
diff --git a/modules/subversion/manifests/init.pp b/modules/subversion/manifests/init.pp index 682f984b..9644ac37 100644 --- a/modules/subversion/manifests/init.pp +++ b/modules/subversion/manifests/init.pp @@ -30,6 +30,22 @@ class subversion { } # mettre tout les scripts dans le repertoire + file { "$local_dir/pre-commit.d/no_root_commit": + ensure => present, + owner => root, + group => root, + mode => 755, + content => template('subversion/no_root_commit') + } + + file { "$local_dir/pre-commit.d/no_empty_message": + ensure => present, + owner => root, + group => root, + mode => 755, + content => template('subversion/no_empty_message') + } + syntax_check{"check_perl": regexp_ext => ".p[lm]$", check_cmd => "perl -c" diff --git a/modules/subversion/templates/no_empty_message b/modules/subversion/templates/no_empty_message new file mode 100644 index 00000000..96d184d9 --- /dev/null +++ b/modules/subversion/templates/no_empty_message @@ -0,0 +1,12 @@ +#!/bin/sh + +REP="$1" +TXN="$2" + +LOG=$(svnlook log -t "$TXN" "$REP") + +if ! echo "$LOG" | grep -qv '^$'; then + echo "no empty commit message allowed" >&2 + exit 1 +fi + diff --git a/modules/subversion/templates/no_root_commit b/modules/subversion/templates/no_root_commit new file mode 100644 index 00000000..5dab449f --- /dev/null +++ b/modules/subversion/templates/no_root_commit @@ -0,0 +1,12 @@ +#!/bin/sh + +REP="$1" +TXN="$2" + +author=$(svnlook author -t "$TXN" "$REP") + +if [ "$author" == 'root' ]; then + echo "no root commit allowed" >&2 + exit 1 +fi + |