formula: fix to_hash tampering with requirement names

This commit is contained in:
Bo Anderson 2023-02-14 02:31:12 +00:00
parent 2a417f1416
commit 5619e5cc2c
No known key found for this signature in database
GPG Key ID: 3DB94E204E137D65

View File

@ -2156,9 +2156,10 @@ class Formula
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),