1 require File.join(File.dirname(__FILE__), '..', 'vcsrepo')
3 Puppet::Type.type(:vcsrepo).provide(:svn, :parent => Puppet::Provider::Vcsrepo) do
4 desc "Supports Subversion repositories"
6 commands :svn => 'svn',
7 :svnadmin => 'svnadmin'
9 defaultfor :svn => :exists
10 has_features :filesystem_types
13 if !@resource.value(:source)
14 create_repository(@resource.value(:path))
16 checkout_repository(@resource.value(:source),
17 @resource.value(:path),
18 @resource.value(:revision))
23 File.directory?(@resource.value(:path))
27 FileUtils.rm_rf(@resource.value(:path))
32 svn('info')[/^Revision:\s+(\d+)/m, 1]
36 def revision=(desired)
38 svn('update', '-r', desired)
44 def checkout_repository(source, path, revision = nil)
47 args.push('-r', revision)
49 args.push(source, path)
53 def create_repository(path)
55 if @resource.value(:fstype)
56 args.push('--fs-type', @resource.value(:fstype))