[Pkg-puppet-devel] [SCM] Puppet packaging for Debian branch, upstream, updated. 0.25.5-639-g8f94f35
test branch
puppet-dev at googlegroups.com
Wed Jul 14 10:33:35 UTC 2010
The following commit has been merged in the upstream branch:
commit 2fae0bded559a23dcab5338dd899e272e0d0678e
Author: Paul Lathrop <plathrop at digg.com>
Date: Tue Apr 6 16:23:03 2010 -0700
Fixes #1999 - Allows the 'apt' provider to downgrade packages.
This is accomplished by adding the --force-yes option to the apt-get
command line when a package version is specified.
Signed-off-by: Paul Lathrop <plathrop at digg.com>
diff --git a/lib/puppet/provider/package/apt.rb b/lib/puppet/provider/package/apt.rb
index 7bbbcfe..c43bb4d 100755
--- a/lib/puppet/provider/package/apt.rb
+++ b/lib/puppet/provider/package/apt.rb
@@ -64,8 +64,9 @@ Puppet::Type.type(:package).provide :apt, :parent => :dpkg, :source => :dpkg do
when true, false, Symbol
# pass
else
- # Add the package version
+ # Add the package version and --force-yes option
str += "=%s" % should
+ cmd << "--force-yes"
end
cmd << :install << str
diff --git a/spec/unit/provider/package/apt.rb b/spec/unit/provider/package/apt.rb
index 25d74bf..8610298 100755
--- a/spec/unit/provider/package/apt.rb
+++ b/spec/unit/provider/package/apt.rb
@@ -109,6 +109,13 @@ Version table:
@provider.install
end
+ it "should use --force-yes if a package version is specified" do
+ @resource.expects(:[]).with(:ensure).returns "1.0"
+ @provider.expects(:aptget).with { |*command| command.include?("--force-yes") }
+
+ @provider.install
+ end
+
it "should do a quiet install" do
@provider.expects(:aptget).with { |*command| command.include?("-q") }
--
Puppet packaging for Debian
More information about the Pkg-puppet-devel
mailing list