[DRE-commits] [librarian-puppet] 09/97: Version of forge modules is ignored
Stig Sandbeck Mathisen
ssm at debian.org
Tue Mar 11 12:12:47 UTC 2014
This is an automated email from the git hooks/post-receive script.
ssm pushed a commit to branch master
in repository librarian-puppet.
commit 9a291d8a82b3ba3269e1c89f1771f878c6fc8342
Author: Carlos Sanchez <csanchez at maestrodev.com>
Date: Wed Nov 14 18:07:43 2012 +0100
Version of forge modules is ignored
Always installs the latest version
---
features/install.feature | 13 +++++++++++++
lib/librarian/puppet/source/forge.rb | 7 ++++++-
2 files changed, 19 insertions(+), 1 deletion(-)
diff --git a/features/install.feature b/features/install.feature
index 4587775..a261355 100644
--- a/features/install.feature
+++ b/features/install.feature
@@ -14,6 +14,19 @@ Feature: cli/install
And the file "modules/apt/Modulefile" should match /name *'puppetlabs-apt'/
And the file "modules/stdlib/Modulefile" should match /name *'puppetlabs-stdlib'/
+ Scenario: Installing an exact version of a module
+ Given a file named "Puppetfile" with:
+ """
+ forge "http://forge.puppetlabs.com"
+
+ mod 'puppetlabs/apt', '0.0.4'
+ """
+ When I run `librarian-puppet install`
+ Then the exit status should be 0
+ And the file "modules/apt/Modulefile" should match /name *'puppetlabs-apt'/
+ And the file "modules/apt/Modulefile" should match /version *'0\.0\.4'/
+ And the file "modules/stdlib/Modulefile" should match /name *'puppetlabs-stdlib'/
+
Scenario: Changing the path
Given a directory named "puppet"
And a file named "Puppetfile" with:
diff --git a/lib/librarian/puppet/source/forge.rb b/lib/librarian/puppet/source/forge.rb
index 8ca0421..eb63b86 100644
--- a/lib/librarian/puppet/source/forge.rb
+++ b/lib/librarian/puppet/source/forge.rb
@@ -95,7 +95,8 @@ module Librarian
target = vendored?(name, version) ? vendored_path(name, version) : name
- command = "puppet module install --target-dir '#{path}' --module_repository '#{source}' --modulepath '#{path}' --ignore-dependencies '#{target}'"
+ command = "puppet module install --version #{version} --target-dir '#{path}' --module_repository '#{source}' --modulepath '#{path}' --ignore-dependencies '#{target}'"
+ debug { "Executing puppet module install for #{name} #{version}" }
output = `#{command}`
# Check for bad exit code
@@ -148,6 +149,10 @@ module Librarian
end
end
+ def debug(*args, &block)
+ environment.logger.debug(*args, &block)
+ end
+
private
def api_call(path)
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ruby-extras/librarian-puppet.git
More information about the Pkg-ruby-extras-commits
mailing list