projects
/
puppet_vcsrepo.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f83f798
)
"ensure => latest" support for bzr
author
Hartmut Holzgraefe
<hartmut@php.net>
Fri, 22 Mar 2013 23:44:06 +0000
(
00:44
+0100)
committer
Hartmut Holzgraefe
<hartmut@php.net>
Fri, 22 Mar 2013 23:44:06 +0000
(
00:44
+0100)
lib/puppet/provider/vcsrepo/bzr.rb
patch
|
blob
|
history
diff --git
a/lib/puppet/provider/vcsrepo/bzr.rb
b/lib/puppet/provider/vcsrepo/bzr.rb
index
6169929
..
fff25b3
100644
(file)
--- a/
lib/puppet/provider/vcsrepo/bzr.rb
+++ b/
lib/puppet/provider/vcsrepo/bzr.rb
@@
-45,7
+45,25
@@
Puppet::Type.type(:vcsrepo).provide(:bzr, :parent => Puppet::Provider::Vcsrepo)
end
def revision=(desired)
- bzr('update', '-r', desired, @resource.value(:path))
+ at_path do
+ begin
+ bzr('update', '-r', desired)
+ rescue Puppet::ExecutionFailure
+ bzr('update', '-r', desired, ':parent')
+ end
+ end
+ end
+
+ def latest
+ at_path do
+ bzr('version-info', ':parent')[/^revision-id:\s+(\S+)/, 1]
+ end
+ end
+
+ def latest?
+ at_path do
+ return self.revision == self.latest
+ end
end
private