diff --git a/Library/Homebrew/formula_installer.rb b/Library/Homebrew/formula_installer.rb index f8b2d12887..d80004daea 100644 --- a/Library/Homebrew/formula_installer.rb +++ b/Library/Homebrew/formula_installer.rb @@ -1139,10 +1139,10 @@ class FormulaInstaller end def forbidden_license_check - forbidden_licenses = Homebrew::EnvConfig.forbidden_licenses.to_s + forbidden_licenses = Homebrew::EnvConfig.forbidden_licenses.dup SPDX::ALLOWED_LICENSE_SYMBOLS.each do |s| pattern = /#{s.to_s.tr("_", " ")}/i - forbidden_licenses = forbidden_licenses.sub(pattern, s.to_s) + forbidden_licenses.sub!(pattern, s.to_s) end forbidden_licenses = forbidden_licenses.split(" ").to_h do |license| [license, SPDX.license_version_info(license)]