Skip to content
This repository has been archived by the owner on May 14, 2021. It is now read-only.

Commit

Permalink
Fix the version prefix check to understand RPM epochs.
Browse files Browse the repository at this point in the history
  • Loading branch information
coderanger committed Apr 18, 2018
1 parent 71cb3a4 commit c5db46d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/poise_languages/system/resource.rb
Original file line number Diff line number Diff line change
Expand Up @@ -233,8 +233,8 @@ def patch_load_current_resource!(provider, version)
each_package do |package_name, new_version, current_version, candidate_version|
# In Chef 12.14+, candidate_version is a Chef::Decorator::Lazy object
# so we need the nil? check to see if the object being proxied is
# nil (i.e. there is no version).
unless candidate_version && (!candidate_version.nil?) && (!candidate_version.empty?) && candidate_version.start_with?(version)
# nil (i.e. there is no version). The `\d+:` is for RPM epoch prefixes.
unless candidate_version && (!candidate_version.nil?) && (!candidate_version.empty?) && candidate_version =~ /^(\d+:)?#{Regexp.escape(version)}/
# Don't display a wonky error message if there is no candidate.
candidate_label = if candidate_version && (!candidate_version.nil?) && (!candidate_version.empty?)
candidate_version
Expand Down

0 comments on commit c5db46d

Please sign in to comment.