Skip to content

Commit

Permalink
Merge pull request #14618 from Bo98/maximum-req-name-fix
Browse files Browse the repository at this point in the history
formula: fix `to_hash` tampering with requirement names
  • Loading branch information
MikeMcQuaid authored Feb 14, 2023
2 parents aa7a543 + 5619e5c commit 8aa495b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Library/Homebrew/formula.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2156,9 +2156,10 @@ def to_hash
end

hsh["requirements"] = requirements.map do |req|
req.name.prepend("maximum_") if req.try(:comparator) == "<="
req_name = req.name.dup
req_name.prepend("maximum_") if req.try(:comparator) == "<="
{
"name" => req.name,
"name" => req_name,
"cask" => req.cask,
"download" => req.download,
"version" => req.try(:version) || req.try(:arch),
Expand Down

0 comments on commit 8aa495b

Please sign in to comment.