audit-license: adapt code to use Array of licenses
This commit is contained in:
parent
9a2f84d4a5
commit
b91587d171
@ -330,16 +330,16 @@ module Homebrew
|
|||||||
|
|
||||||
def audit_license
|
def audit_license
|
||||||
if formula.license.present?
|
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
|
return unless @online
|
||||||
|
|
||||||
user, repo = get_repo_data(%r{https?://github\.com/([^/]+)/([^/]+)/?.*}) if @new_formula
|
user, repo = get_repo_data(%r{https?://github\.com/([^/]+)/([^/]+)/?.*}) if @new_formula
|
||||||
return if user.blank?
|
return if user.blank?
|
||||||
|
|
||||||
github_license = GitHub.get_repo_license(user, repo)
|
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}."
|
"but Formulae license states: #{formula.license}."
|
||||||
else
|
else
|
||||||
problem "#{formula.license} is not a standard SPDX license."
|
problem "#{formula.license} is not a standard SPDX license."
|
||||||
|
Loading…
x
Reference in New Issue
Block a user