diff options
author | Matthew Slowe <M.Slowe@kent.ac.uk> | 2013-07-02 15:59:12 +0100 |
---|---|---|
committer | Aaron Stone <aaron@serendipity.cx> | 2013-07-25 13:57:42 -0700 |
commit | 8036ceca544730d4192ea31b750d200392691166 (patch) | |
tree | 7f4b117f1c41ee28d302fa86add61fc4b432baf6 /lib/puppet | |
parent | 45cb7c1319e79cbfb3ff2bcdadfc275260d557e0 (diff) |
added support for changing upstream repo url
added checks that the URL of the WC matches the URL from the manifest
changed from using "update" to "switch"
Diffstat (limited to 'lib/puppet')
-rw-r--r-- | lib/puppet/provider/vcsrepo/svn.rb | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/puppet/provider/vcsrepo/svn.rb b/lib/puppet/provider/vcsrepo/svn.rb index 3132c36..9de0812 100644 --- a/lib/puppet/provider/vcsrepo/svn.rb +++ b/lib/puppet/provider/vcsrepo/svn.rb @@ -40,7 +40,7 @@ Puppet::Type.type(:vcsrepo).provide(:svn, :parent => Puppet::Provider::Vcsrepo) def latest? at_path do - self.revision >= self.latest + (self.revision >= self.latest) and (@resource.value(:source) == self.sourceurl) end end @@ -70,6 +70,13 @@ Puppet::Type.type(:vcsrepo).provide(:svn, :parent => Puppet::Provider::Vcsrepo) end end + def sourceurl + args = buildargs.push('info') + at_path do + svn(*args)[/^URL:\s+(\S+)/m, 1] + end + end + def revision args = buildargs.push('info') at_path do @@ -78,7 +85,7 @@ Puppet::Type.type(:vcsrepo).provide(:svn, :parent => Puppet::Provider::Vcsrepo) end def revision=(desired) - args = buildargs.push('update', '-r', desired) + args = buildargs.push('switch', '-r', desired, @resource.value(:source)) at_path do svn(*args) end |