From 20f0ca588f05d896166fe3b3da7ee1cf5351a3f0 Mon Sep 17 00:00:00 2001 From: Michael Scherer Date: Fri, 4 Mar 2011 12:41:59 +0000 Subject: - fix the subversion post-commit problem ( for good this time ) - also simplify the declaration, by following the DRY principle --- modules/subversion/manifests/init.pp | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-) (limited to 'modules/subversion/manifests') 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: } } } -- cgit v1.2.1