brew audit: check if license data exists

This commit is contained in:
lionellloh 2020-06-13 02:43:02 +08:00
parent c10b6bcc3c
commit 803f9dd4a3
2 changed files with 2053 additions and 2 deletions

View File

@ -346,8 +346,12 @@ module Homebrew
path = File.join(File.dirname(__FILE__),"spdx.json")
file = File.open(File.expand_path(path))
valid_licenses = JSON.load(file)
return if valid_licenses.key?(formula.license)
problem "#{formula.license} is not an SPDX license."
unless formula.license.nil?
return if valid_licenses.key?(formula.license)
problem "#{formula.license} is not an SPDX license."
else
problem "No license specified for package."
end
end
def audit_deps

File diff suppressed because it is too large Load Diff