diff options
author | Michael Scherer <misc@mageia.org> | 2011-03-04 12:41:59 +0000 |
---|---|---|
committer | Michael Scherer <misc@mageia.org> | 2011-03-04 12:41:59 +0000 |
commit | 20f0ca588f05d896166fe3b3da7ee1cf5351a3f0 (patch) | |
tree | 4e44583091e19d2022ec166334eaa869f0c51dc5 /modules/subversion | |
parent | 6076ed75a3db69c3a57892c64dc93889bd4acac2 (diff) | |
download | puppet-20f0ca588f05d896166fe3b3da7ee1cf5351a3f0.tar puppet-20f0ca588f05d896166fe3b3da7ee1cf5351a3f0.tar.gz puppet-20f0ca588f05d896166fe3b3da7ee1cf5351a3f0.tar.bz2 puppet-20f0ca588f05d896166fe3b3da7ee1cf5351a3f0.tar.xz puppet-20f0ca588f05d896166fe3b3da7ee1cf5351a3f0.zip |
- fix the subversion post-commit problem ( for good this time )
- also simplify the declaration, by following the DRY principle
Diffstat (limited to 'modules/subversion')
-rw-r--r-- | modules/subversion/manifests/init.pp | 23 |
1 files changed, 9 insertions, 14 deletions
diff --git a/modules/subversion/manifests/init.pp b/modules/subversion/manifests/init.pp index c9478c11..95ce34cd 100644 --- a/modules/subversion/manifests/init.pp +++ b/modules/subversion/manifests/init.pp @@ -111,8 +111,8 @@ class subversion { } - # FIXME ugly - define pre_commit_link($scriptname) { + define pre_commit_link() { + $scriptname = regsubst($name,'^.*/', '') file { "${name}": ensure => "/usr/local/share/subversion/pre-commit.d/$scriptname", owner => root, @@ -217,9 +217,7 @@ class subversion { } if $no_binary { - pre_commit_link { "$name/hooks/pre-commit.d/no_binary": - scriptname => 'no_binary', - } + pre_commit_link { "$name/hooks/pre-commit.d/no_binary": } } if $extract_dir { @@ -233,16 +231,13 @@ class subversion { } } - pre_commit_link { "$name/hooks/pre-commit.d/no_empty_message": - scriptname => 'no_empty_message', - } - pre_commit_link { "$name/hooks/pre-commit.d/no_root_commit": - scriptname => 'no_root_commit', - } + pre_commit_link { "$name/hooks/pre-commit.d/no_empty_message": } + + pre_commit_link { "$name/hooks/pre-commit.d/no_root_commit": } + if $syntax_check { - pre_commit_link { "$name/hooks/pre-commit.d/$syntax_check": - scriptname => $syntax_check, - } + $syntax_check_array = regsubst($syntax_check,'^',"$name/hooks/pre-commit.d/") + pre_commit_link { $syntax_check_array: } } } |