Merge pull request #8208 from MikeMcQuaid/public_domain_license
license: handle "Public Domain".
This commit is contained in:
commit
590669c568
@ -211,7 +211,13 @@ module Homebrew
|
||||
|
||||
puts "From: #{Formatter.url(github_info(f))}"
|
||||
|
||||
puts "License: #{f.license.join(", ")}" if f.license
|
||||
if f.license.present?
|
||||
licenses = f.license
|
||||
.map(&:to_s)
|
||||
.join(", ")
|
||||
.sub("public_domain", "Public Domain")
|
||||
puts "License: #{licenses}"
|
||||
end
|
||||
|
||||
unless f.deps.empty?
|
||||
ohai "Dependencies"
|
||||
|
||||
@ -337,12 +337,12 @@ module Homebrew
|
||||
|
||||
def audit_license
|
||||
if formula.license.present?
|
||||
non_standard_licenses = []
|
||||
formula.license.each do |license|
|
||||
non_standard_licenses = formula.license.map do |license|
|
||||
next if license == :public_domain
|
||||
next if @spdx_data["licenses"].any? { |spdx| spdx["licenseId"] == license }
|
||||
|
||||
non_standard_licenses << license
|
||||
end
|
||||
license
|
||||
end.compact
|
||||
|
||||
if non_standard_licenses.present?
|
||||
problem "Formula #{formula.name} contains non-standard SPDX licenses: #{non_standard_licenses}."
|
||||
|
||||
@ -2221,6 +2221,8 @@ class Formula
|
||||
# Multiple licenses means that the software is licensed under multiple licenses.
|
||||
# Do not use multiple licenses if e.g. different parts are under different licenses.
|
||||
# <pre>license "BSD-2-Clause"</pre>
|
||||
# <pre>license ["MIT", "GPL-2.0"]</pre>
|
||||
# <pre>license :public_domain</pre>
|
||||
def license(args = nil)
|
||||
if args.nil?
|
||||
@licenses
|
||||
|
||||
@ -1129,14 +1129,17 @@ class FormulaInstaller
|
||||
end
|
||||
|
||||
def forbidden_license_check
|
||||
forbidden_licenses = Homebrew::EnvConfig.forbidden_licenses.to_s.split(" ")
|
||||
forbidden_licenses = Homebrew::EnvConfig.forbidden_licenses
|
||||
.to_s
|
||||
.sub("Public Domain", "public_domain")
|
||||
.split(" ")
|
||||
return if forbidden_licenses.blank?
|
||||
|
||||
compute_dependencies.each do |dep, _|
|
||||
next if @ignore_deps
|
||||
|
||||
dep_f = dep.to_formula
|
||||
next unless dep_f.license.all? { |license| forbidden_licenses.include? license }
|
||||
next unless dep_f.license.all? { |license| forbidden_licenses.include?(license.to_s) }
|
||||
|
||||
raise CannotInstallFormulaError, <<~EOS
|
||||
The installation of #{formula.name} has a dependency on #{dep.name} where all its licenses are forbidden: #{dep_f.license}.
|
||||
@ -1144,7 +1147,7 @@ class FormulaInstaller
|
||||
end
|
||||
return if @only_deps
|
||||
|
||||
return unless formula.license.all? { |license| forbidden_licenses.include? license }
|
||||
return unless formula.license.all? { |license| forbidden_licenses.include?(license.to_s) }
|
||||
|
||||
raise CannotInstallFormulaError, <<~EOS
|
||||
#{formula.name}'s licenses are all forbidden: #{formula.license}.
|
||||
|
||||
@ -91,7 +91,9 @@ Try to summarise from the [`homepage`](https://rubydoc.brew.sh/Formula#homepage%
|
||||
|
||||
**We don’t accept new formulae into Homebrew/homebrew-core without a [`license`](https://rubydoc.brew.sh/Formula#license-class_method)!**
|
||||
|
||||
Find the license identifier from the [SPDX License List](https://spdx.org/licenses/). We only accept licenses from this list that are a [Debian Free Software Guidelines license](https://wiki.debian.org/DFSGLicenses).
|
||||
We only accept formulae that use a [Debian Free Software Guidelines license](https://wiki.debian.org/DFSGLicenses) or are released into the public domain following [DFSG Guidelines on Public Domain software](https://wiki.debian.org/DFSGLicenses#Public_Domain).
|
||||
|
||||
Use the license identifier from the [SPDX License List](https://spdx.org/licenses/) e.g. `license "BSD-2-Clause"`, or use `license :public_domain` for public domain software.
|
||||
|
||||
If the software is available under multiple licenses, you should list them all in an array:
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user