From b91587d1716636b345f13e6829e04ab3a684d5ed Mon Sep 17 00:00:00 2001 From: lionellloh Date: Sun, 12 Jul 2020 11:40:02 +0800 Subject: [PATCH] audit-license: adapt code to use Array of licenses --- Library/Homebrew/dev-cmd/audit.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Library/Homebrew/dev-cmd/audit.rb b/Library/Homebrew/dev-cmd/audit.rb index 2b17297200..4655594847 100644 --- a/Library/Homebrew/dev-cmd/audit.rb +++ b/Library/Homebrew/dev-cmd/audit.rb @@ -330,16 +330,16 @@ module Homebrew def audit_license if formula.license.present? - if @spdx_data["licenses"].any? { |lic| lic["licenseId"] == formula.license } + if formula.license.any? { |lic| @spdx_data["licenses"].any? { |standard_lic| standard_lic["licenseId"] == lic } } return unless @online user, repo = get_repo_data(%r{https?://github\.com/([^/]+)/([^/]+)/?.*}) if @new_formula return if user.blank? github_license = GitHub.get_repo_license(user, repo) - return if github_license && [formula.license, "NOASSERTION"].include?(github_license) + return if github_license && (formula.license + ["NOASSERTION"]).include?(github_license) - problem "License mismatch - GitHub license is: #{github_license}, "\ + problem "License mismatch - GitHub license is: #{Array(github_license)}, "\ "but Formulae license states: #{formula.license}." else problem "#{formula.license} is not a standard SPDX license."