summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2015-02-19 08:48:42 -0800
committerLamont Granquist <lamont@scriptkiddie.org>2015-02-19 08:48:42 -0800
commit1468c85d1374986ffd5590f6653ff6a64bbdf4c9 (patch)
tree2c5f7272ce094b125a2a6deae2e72dac9e95d96f
parent44ecf5c00960fb20dae43425929f2dfedf7a067c (diff)
parent32bc9839a8a7c24c6250744875238683e57ac870 (diff)
downloadchef-1468c85d1374986ffd5590f6653ff6a64bbdf4c9.tar.gz
Merge pull request #2942 from chef/lcg/dpkg-regression
fix dpkg regression
-rw-r--r--lib/chef/provider/package/dpkg.rb2
-rw-r--r--spec/unit/provider/package/dpkg_spec.rb1
2 files changed, 3 insertions, 0 deletions
diff --git a/lib/chef/provider/package/dpkg.rb b/lib/chef/provider/package/dpkg.rb
index 1500aa9a7e..11691a2479 100644
--- a/lib/chef/provider/package/dpkg.rb
+++ b/lib/chef/provider/package/dpkg.rb
@@ -61,10 +61,12 @@ class Chef
if @source_exists
# Get information from the package if supplied
Chef::Log.debug("#{@new_resource} checking dpkg status")
+
shell_out("dpkg-deb -W #{@new_resource.source}").stdout.each_line do |line|
if pkginfo = DPKG_INFO.match(line)
@current_resource.package_name(pkginfo[1])
@new_resource.version(pkginfo[2])
+ @candidate_version = pkginfo[2]
end
end
else
diff --git a/spec/unit/provider/package/dpkg_spec.rb b/spec/unit/provider/package/dpkg_spec.rb
index c838306c35..3fd86218d2 100644
--- a/spec/unit/provider/package/dpkg_spec.rb
+++ b/spec/unit/provider/package/dpkg_spec.rb
@@ -55,6 +55,7 @@ describe Chef::Provider::Package::Dpkg do
@provider.load_current_resource
expect(@provider.current_resource.package_name).to eq("wget")
expect(@new_resource.version).to eq(version)
+ expect(@provider.candidate_version).to eq(version)
end
it 'if short version provided' do