From 81787d494012f969e10d4af34193c8e81a6dc8b7 Mon Sep 17 00:00:00 2001 From: Brett Lentz Date: Mon, 13 Sep 2010 16:20:58 -0700 Subject: new features for vcsrepo. * support recursive chown on repo * support checking out tags (git) * support adding excludes/ignored files * dropped a few unused methods * rework git provider logic a bit --- lib/puppet/provider/vcsrepo.rb | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'lib/puppet/provider/vcsrepo.rb') diff --git a/lib/puppet/provider/vcsrepo.rb b/lib/puppet/provider/vcsrepo.rb index c560e93..2c026ba 100644 --- a/lib/puppet/provider/vcsrepo.rb +++ b/lib/puppet/provider/vcsrepo.rb @@ -1,11 +1,22 @@ require 'tmpdir' require 'digest/md5' +require 'fileutils' # Abstract class Puppet::Provider::Vcsrepo < Puppet::Provider private + def set_ownership + owner = @resource.value(:owner) || nil + group = @resource.value(:group) || nil + FileUtils.chown_R(owner, group, @resource.value(:path)) + end + + def path_exists? + File.directory?(@resource.value(:path)) + end + # Note: We don't rely on Dir.chdir's behavior of automatically returning the # value of the last statement -- for easier stubbing. def at_path(&block) #:nodoc: -- cgit v1.2.3