summaryrefslogtreecommitdiff
path: root/lib/puppet/provider
diff options
context:
space:
mode:
Diffstat (limited to 'lib/puppet/provider')
-rw-r--r--lib/puppet/provider/vcsrepo/bzr.rb1
-rw-r--r--lib/puppet/provider/vcsrepo/cvs.rb2
-rw-r--r--lib/puppet/provider/vcsrepo/git.rb18
-rw-r--r--lib/puppet/provider/vcsrepo/hg.rb1
-rw-r--r--lib/puppet/provider/vcsrepo/svn.rb2
5 files changed, 18 insertions, 6 deletions
diff --git a/lib/puppet/provider/vcsrepo/bzr.rb b/lib/puppet/provider/vcsrepo/bzr.rb
index a6e12cd..a060562 100644
--- a/lib/puppet/provider/vcsrepo/bzr.rb
+++ b/lib/puppet/provider/vcsrepo/bzr.rb
@@ -5,6 +5,7 @@ Puppet::Type.type(:vcsrepo).provide(:bzr, :parent => Puppet::Provider::Vcsrepo)
commands :bzr => 'bzr'
defaultfor :bzr => :exists
+ has_features :reference_tracking
def create
if !@resource.value(:source)
diff --git a/lib/puppet/provider/vcsrepo/cvs.rb b/lib/puppet/provider/vcsrepo/cvs.rb
index 1cedc8b..e82c23a 100644
--- a/lib/puppet/provider/vcsrepo/cvs.rb
+++ b/lib/puppet/provider/vcsrepo/cvs.rb
@@ -5,7 +5,7 @@ Puppet::Type.type(:vcsrepo).provide(:cvs, :parent => Puppet::Provider::Vcsrepo)
commands :cvs => 'cvs'
defaultfor :cvs => :exists
- has_features :gzip_compression
+ has_features :gzip_compression, :reference_tracking
def create
if !@resource.value(:source)
diff --git a/lib/puppet/provider/vcsrepo/git.rb b/lib/puppet/provider/vcsrepo/git.rb
index 274f25b..ba5065e 100644
--- a/lib/puppet/provider/vcsrepo/git.rb
+++ b/lib/puppet/provider/vcsrepo/git.rb
@@ -5,7 +5,7 @@ Puppet::Type.type(:vcsrepo).provide(:git, :parent => Puppet::Provider::Vcsrepo)
commands :git => 'git'
defaultfor :git => :exists
- has_features :bare_repositories
+ has_features :bare_repositories, :reference_tracking
def create
if !@resource.value(:source)
@@ -37,7 +37,7 @@ Puppet::Type.type(:vcsrepo).provide(:git, :parent => Puppet::Provider::Vcsrepo)
end
def revision=(desired)
- fetch
+ pull
reset(desired)
end
@@ -48,6 +48,16 @@ Puppet::Type.type(:vcsrepo).provide(:git, :parent => Puppet::Provider::Vcsrepo)
def working_copy_exists?
File.directory?(File.join(@resource.value(:path), '.git'))
end
+
+ def exists?
+ working_copy_exists? || bare_exists?
+ end
+
+ def update_references
+ at_path do
+ git('fetch', '--tags', 'origin')
+ end
+ end
private
@@ -68,9 +78,9 @@ Puppet::Type.type(:vcsrepo).provide(:git, :parent => Puppet::Provider::Vcsrepo)
git(*args)
end
- def fetch
+ def pull
at_path do
- git('fetch', 'origin')
+ git('pull', 'origin')
end
end
diff --git a/lib/puppet/provider/vcsrepo/hg.rb b/lib/puppet/provider/vcsrepo/hg.rb
index 928049f..df8b4f0 100644
--- a/lib/puppet/provider/vcsrepo/hg.rb
+++ b/lib/puppet/provider/vcsrepo/hg.rb
@@ -5,6 +5,7 @@ Puppet::Type.type(:vcsrepo).provide(:hg, :parent => Puppet::Provider::Vcsrepo) d
commands :hg => 'hg'
defaultfor :hg => :exists
+ has_features :reference_tracking
def create
if !@resource.value(:source)
diff --git a/lib/puppet/provider/vcsrepo/svn.rb b/lib/puppet/provider/vcsrepo/svn.rb
index 7cdd157..5fa586d 100644
--- a/lib/puppet/provider/vcsrepo/svn.rb
+++ b/lib/puppet/provider/vcsrepo/svn.rb
@@ -7,7 +7,7 @@ Puppet::Type.type(:vcsrepo).provide(:svn, :parent => Puppet::Provider::Vcsrepo)
:svnadmin => 'svnadmin'
defaultfor :svn => :exists
- has_features :filesystem_types
+ has_features :filesystem_types, :reference_tracking
def create
if !@resource.value(:source)