formula_auditor: make deprecate license check non-strict in core

Also add some more incompatible licenses. These are all not allowed by
Fedora and have are classified as not OSI and FSF approved on SPDX.
This commit is contained in:
Michael Cho 2024-09-04 11:35:28 -04:00
parent 7683b22b61
commit a618512d7a
No known key found for this signature in database
GPG Key ID: 55E85E28A7CD1E85
2 changed files with 9 additions and 5 deletions

View File

@ -201,8 +201,12 @@ module Homebrew
# The following licenses are non-free/open based on multiple sources (e.g. Debian, Fedora, FSF, OSI, ...) # The following licenses are non-free/open based on multiple sources (e.g. Debian, Fedora, FSF, OSI, ...)
INCOMPATIBLE_LICENSES = [ INCOMPATIBLE_LICENSES = [
"JSON", # https://wiki.debian.org/DFSGLicenses#JSON_evil_license "Aladdin", # https://www.gnu.org/licenses/license-list.html#Aladdin
"OPL-1.0", # https://wiki.debian.org/DFSGLicenses#Open_Publication_License_.28OPL.29_v1.0 "CPOL-1.02", # https://www.gnu.org/licenses/license-list.html#cpol
"gSOAP-1.3b", # https://salsa.debian.org/ellert/gsoap/-/blob/master/debian/copyright
"JSON", # https://wiki.debian.org/DFSGLicenses#JSON_evil_license
"MS-LPL", # https://github.com/spdx/license-list-XML/issues/1432#issuecomment-1077680709
"OPL-1.0", # https://wiki.debian.org/DFSGLicenses#Open_Publication_License_.28OPL.29_v1.0
].freeze ].freeze
INCOMPATIBLE_LICENSE_PREFIXES = [ INCOMPATIBLE_LICENSE_PREFIXES = [
"BUSL", # https://spdx.org/licenses/BUSL-1.1.html#notes "BUSL", # https://spdx.org/licenses/BUSL-1.1.html#notes
@ -222,7 +226,7 @@ module Homebrew
problem <<~EOS problem <<~EOS
Formula #{formula.name} contains incompatible licenses: #{incompatible_licenses}. Formula #{formula.name} contains incompatible licenses: #{incompatible_licenses}.
Formulae in homebrew/core must either use a Debian Free Software Guidelines license Formulae in homebrew/core must either use a Debian Free Software Guidelines license
or be released into the public domain. See https://docs.brew.sh/License-Guidelines or be released into the public domain. See #{Formatter.url("https://docs.brew.sh/License-Guidelines")}
EOS EOS
end end
@ -234,7 +238,7 @@ module Homebrew
EOS EOS
end end
if @strict if @strict || @core_tap
deprecated_licenses = licenses.select do |license| deprecated_licenses = licenses.select do |license|
SPDX.deprecated_license? license SPDX.deprecated_license? license
end end

View File

@ -286,7 +286,7 @@ RSpec.describe Homebrew::FormulaAuditor do
class Cask < Formula class Cask < Formula
url "https://github.com/cask/cask/archive/v0.8.4.tar.gz" url "https://github.com/cask/cask/archive/v0.8.4.tar.gz"
head "https://github.com/cask/cask.git" head "https://github.com/cask/cask.git"
license "GPL-3.0" license "GPL-3.0-or-later"
end end
RUBY RUBY
fa = formula_auditor "cask", formula_text, spdx_license_data:, fa = formula_auditor "cask", formula_text, spdx_license_data:,