summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2021-11-29 18:51:23 -0800
committerLamont Granquist <lamont@scriptkiddie.org>2021-11-29 18:51:23 -0800
commit00f1d2ebb6fdeccf6ba085eec4310f312cd183c3 (patch)
tree6877acca51ca4c60e185ee5b7d460ad325342fbe
parent79a247f1a539b454cef4eaf8942f523a5b8ed531 (diff)
downloadchef-lcg/add-allow-downgrade-to-dnf-package.tar.gz
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
-rw-r--r--lib/chef/provider/package.rb9
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/chef/provider/package.rb b/lib/chef/provider/package.rb
index db1aaeaf7b..82d7ed00cf 100644
--- a/lib/chef/provider/package.rb
+++ b/lib/chef/provider/package.rb
@@ -500,8 +500,13 @@ class Chef
logger.trace("#{new_resource} #{package_name} #{current_version} satisfies #{new_version} requirement")
target_version_array.push(nil)
else
- logger.trace("#{new_resource} #{package_name} #{current_version} needs updating to #{candidate_version}")
- target_version_array.push(candidate_version)
+ # XXX: some subclasses seem to depend on this behavior where the new_version can be different from the
+ # candidate_version and we install the new_version, it seems like the candidate_version should be fixed to
+ # be resolved correctly to the new_version for those providers. although it may just be unit test bugs.
+ # it would be more correct to use the candidate_version here, but then it needs to be the correctly resolved
+ # candidate_version against the new_version constraint.
+ logger.trace("#{new_resource} #{package_name} #{current_version} needs updating to #{new_version}")
+ target_version_array.push(new_version)
end
elsif magic_version.nil?
# This is for when we have a "magic version using" subclass and where the installed version does not match the