diff options
author | 5Ub-Z3r0 <5ub-z3r0@nikorasu.net> | 2012-10-10 17:38:03 +0300 |
---|---|---|
committer | Aaron Stone <aaron@serendipity.cx> | 2013-07-19 12:44:23 -0700 |
commit | 481cbe15a83fb397aa023c97aaf5ec19ee2f0632 (patch) | |
tree | e61b549e2c26a43f649a53e75a40dca7b64d9be5 /lib/puppet/provider/vcsrepo | |
parent | 1881688dc0c0ed72002d3f74764435f56f2c2429 (diff) | |
download | puppet-vcsrepo-481cbe15a83fb397aa023c97aaf5ec19ee2f0632.tar.gz puppet-vcsrepo-481cbe15a83fb397aa023c97aaf5ec19ee2f0632.tar.bz2 |
Add support for master svn repositories
Pull request related to issue #8331.
I have added support into the exists? method (actually working_copy_exists?) for checking if the path is a master repository, using svnlook. It should be ok in most cases, since svnlook comes with svnadmin in nearly every distribution.
Diffstat (limited to 'lib/puppet/provider/vcsrepo')
-rw-r--r-- | lib/puppet/provider/vcsrepo/svn.rb | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/lib/puppet/provider/vcsrepo/svn.rb b/lib/puppet/provider/vcsrepo/svn.rb index 7485ff5..0c911bf 100644 --- a/lib/puppet/provider/vcsrepo/svn.rb +++ b/lib/puppet/provider/vcsrepo/svn.rb @@ -4,7 +4,8 @@ Puppet::Type.type(:vcsrepo).provide(:svn, :parent => Puppet::Provider::Vcsrepo) desc "Supports Subversion repositories" optional_commands :svn => 'svn', - :svnadmin => 'svnadmin' + :svnadmin => 'svnadmin', + :svnlook => 'svnlook' has_features :filesystem_types, :reference_tracking, :basic_auth, :configuration @@ -20,7 +21,15 @@ Puppet::Type.type(:vcsrepo).provide(:svn, :parent => Puppet::Provider::Vcsrepo) end def working_copy_exists? - File.directory?(File.join(@resource.value(:path), '.svn')) + if File.directory?(@resource.value(:path)) + if File.directory?(File.join(@resource.value(:path), '.svn')) + return true + end + if svnlook('uuid',@resource.value(:path)) + return true + end + end + return false end def exists? |