diff options
author | mikeknox <mike@hfnix.net> | 2010-07-07 21:10:56 +1000 |
---|---|---|
committer | James Turnbull <james@lovedthanlost.net> | 2010-07-22 09:19:38 +1000 |
commit | dd31bce5655d7417cb4685ec6740898929a0b10c (patch) | |
tree | 9055d719e490a6c6716535180fe27aa3e626c4aa /lib/puppet/provider | |
parent | 6112583f15d6db63adca1e58593be7427422c2bd (diff) |
When ensure => latest, svn didn't update.
svn provider now gets the latest revision from the repo, rather than the checkout
Test with revision => <some value> as well
now when ensure => latest, only refresh dependent resources if the
repo is actually updated
Tidied up debug messages
Diffstat (limited to 'lib/puppet/provider')
-rw-r--r-- | lib/puppet/provider/vcsrepo/svn.rb | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/lib/puppet/provider/vcsrepo/svn.rb b/lib/puppet/provider/vcsrepo/svn.rb index f712bf5..e856220 100644 --- a/lib/puppet/provider/vcsrepo/svn.rb +++ b/lib/puppet/provider/vcsrepo/svn.rb @@ -26,6 +26,22 @@ Puppet::Type.type(:vcsrepo).provide(:svn, :parent => Puppet::Provider::Vcsrepo) def destroy FileUtils.rm_rf(@resource.value(:path)) end + + def latest? + at_path do + if self.revision < self.latest then + return false + else + return true + end + end + end + + def latest + at_path do + svn('info', '-r', 'HEAD')[/^Revision:\s+(\d+)/m, 1] + end + end def revision at_path do @@ -59,4 +75,4 @@ Puppet::Type.type(:vcsrepo).provide(:svn, :parent => Puppet::Provider::Vcsrepo) svnadmin(*args) end -end +end
\ No newline at end of file |