mirror of
https://github.com/Homebrew/brew.git
synced 2025-07-14 16:09:03 +08:00
Merge pull request #19976 from Homebrew/spdx_downcase
utils/spdx: do case insensitive comparison.
This commit is contained in:
commit
2bc642d501
@ -87,7 +87,7 @@ module SPDX
|
|||||||
return ALLOWED_LICENSE_SYMBOLS.include? license if license.is_a? Symbol
|
return ALLOWED_LICENSE_SYMBOLS.include? license if license.is_a? Symbol
|
||||||
|
|
||||||
license = license.delete_suffix "+"
|
license = license.delete_suffix "+"
|
||||||
license_data["licenses"].any? { |spdx_license| spdx_license["licenseId"] == license }
|
license_data["licenses"].any? { |spdx_license| spdx_license["licenseId"].downcase == license.downcase }
|
||||||
end
|
end
|
||||||
|
|
||||||
sig { params(license: T.any(String, Symbol)).returns(T::Boolean) }
|
sig { params(license: T.any(String, Symbol)).returns(T::Boolean) }
|
||||||
@ -97,14 +97,14 @@ module SPDX
|
|||||||
|
|
||||||
license = license.to_s.delete_suffix "+"
|
license = license.to_s.delete_suffix "+"
|
||||||
license_data["licenses"].none? do |spdx_license|
|
license_data["licenses"].none? do |spdx_license|
|
||||||
spdx_license["licenseId"] == license && !spdx_license["isDeprecatedLicenseId"]
|
spdx_license["licenseId"].downcase == license.downcase && !spdx_license["isDeprecatedLicenseId"]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
sig { params(exception: String).returns(T::Boolean) }
|
sig { params(exception: String).returns(T::Boolean) }
|
||||||
def valid_license_exception?(exception)
|
def valid_license_exception?(exception)
|
||||||
exception_data["exceptions"].any? do |spdx_exception|
|
exception_data["exceptions"].any? do |spdx_exception|
|
||||||
spdx_exception["licenseExceptionId"] == exception && !spdx_exception["isDeprecatedLicenseId"]
|
spdx_exception["licenseExceptionId"].downcase == exception.downcase && !spdx_exception["isDeprecatedLicenseId"]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user