diff options
Diffstat (limited to 'lib/puppet/provider/vcsrepo')
-rw-r--r-- | lib/puppet/provider/vcsrepo/svn.rb | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/lib/puppet/provider/vcsrepo/svn.rb b/lib/puppet/provider/vcsrepo/svn.rb index 7485ff5..3132c36 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,13 @@ 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)) + # :path is an svn checkout + return true if File.directory?(File.join(@resource.value(:path), '.svn')) + # :path is an svn server + return true if svnlook('uuid', @resource.value(:path)) + end + false end def exists? @@ -33,11 +40,7 @@ Puppet::Type.type(:vcsrepo).provide(:svn, :parent => Puppet::Provider::Vcsrepo) def latest? at_path do - if self.revision < self.latest then - return false - else - return true - end + self.revision >= self.latest end end @@ -57,7 +60,7 @@ Puppet::Type.type(:vcsrepo).provide(:svn, :parent => Puppet::Provider::Vcsrepo) args.push('--config-dir', @resource.value(:configuration)) end - return args + args end def latest |