From 4a89ed4d3b8348a53e2f27429b59a28c81b29fd3 Mon Sep 17 00:00:00 2001 From: James Turnbull Date: Mon, 29 Aug 2011 01:15:51 -0700 Subject: Fixed Bug #9219 - vcsrepo updates too often MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If vcsrepo is used with ensure => latest to keep something from a larger repository checked out it will trigger an update every time something changes anywhere in the repository, not just in the part that’s actually checked out. In combination with a busy development team and a vcsrepo resource with notify => Service[foo] this means frequent restarts of a service for no good reason. The attached patch solves the issue by looking at the “Last Changed Rev” line from svn info instead of “Revision”. Patch thanks to: Knut Arne Bjørndal --- lib/puppet/provider/vcsrepo/svn.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/puppet/provider/vcsrepo/svn.rb b/lib/puppet/provider/vcsrepo/svn.rb index 5590a71..6ec4612 100644 --- a/lib/puppet/provider/vcsrepo/svn.rb +++ b/lib/puppet/provider/vcsrepo/svn.rb @@ -55,14 +55,14 @@ Puppet::Type.type(:vcsrepo).provide(:svn, :parent => Puppet::Provider::Vcsrepo) def latest args = buildargs.push('info', '-r', 'HEAD') at_path do - svn(*args)[/^Revision:\s+(\d+)/m, 1] + svn(*args)[/^Last Changed Rev:\s+(\d+)/m, 1] end end def revision args = buildargs.push('info') at_path do - svn(*args)[/^Revision:\s+(\d+)/m, 1] + svn(*args)[/^Last Changed Rev:\s+(\d+)/m, 1] end end -- cgit v1.2.3