diff --git a/tools/genlicenses/modules.go b/tools/genlicenses/modules.go index 6eb5b55..8f9212e 100644 --- a/tools/genlicenses/modules.go +++ b/tools/genlicenses/modules.go @@ -167,9 +167,13 @@ func licenseFiles(dir string) ([]string, error) { // isLicenseFile reports whether a file name, in any letter case, is that of // a license: LICENSE, LICENCE, COPYING or UNLICENSE, perhaps with a suffix -// such as -MIT, and with no extension or that of a text file. +// such as -MIT, and with no extension or that of a text file. LICENSE-LOGO +// is not one: it covers a project's logo image, which no package links. func isLicenseFile(name string) bool { stem := textStem(name) + if stem == "license-logo" || stem == "licence-logo" { + return false + } for _, base := range []string{"license", "licence", "copying", "unlicense"} { if stem == base || strings.HasPrefix(stem, base+"-") { return true diff --git a/tools/genlicenses/notices.go b/tools/genlicenses/notices.go index 971426a..548c072 100644 --- a/tools/genlicenses/notices.go +++ b/tools/genlicenses/notices.go @@ -91,6 +91,7 @@ var licenseMarkers = []struct{ id, phrase string }{ {"MPL-2.0", "mozilla public license version 2.0"}, {"MPL-2.0", "mozilla public license, version 2.0"}, {"Unlicense", "this is free and unencumbered software released into the public domain"}, + {"public domain", "all of the code and documentation in sqlite has been dedicated to the public domain"}, } // bsdThirdClause is in BSD-3-Clause and not in BSD-2-Clause. diff --git a/tools/genlicenses/notices_test.go b/tools/genlicenses/notices_test.go index 7037834..8cb5442 100644 --- a/tools/genlicenses/notices_test.go +++ b/tools/genlicenses/notices_test.go @@ -48,6 +48,7 @@ func TestClassify(t *testing.T) { {"ISC", "Permission to use, copy, modify, and/or distribute this software for any\npurpose with or without fee is hereby granted", []string{"ISC"}}, {"MPL-2.0", "Mozilla Public License Version 2.0\n==================================", []string{"MPL-2.0"}}, {"Unlicense", "This is free and unencumbered software released into the public domain.", []string{"Unlicense"}}, + {"SQLite's dedication", "SQLite Is Public Domain\n\nAll of the code and documentation in SQLite has been dedicated to the public\ndomain by the authors.", []string{"public domain"}}, {"in the order given", mitText + "\n\n" + apacheText, []string{"MIT", "Apache-2.0"}}, {"each named once", mitText + "\n\n" + bsd3Text + "\n\n" + mitText, []string{"MIT", "BSD-3-Clause"}}, {"BSD clauses read up to the next license", bsd2Text + "\n\n" + apacheText + "\n\n" + bsd3Text, []string{"BSD-2-Clause", "Apache-2.0", "BSD-3-Clause"}}, @@ -80,6 +81,8 @@ func TestFileNames(t *testing.T) { {"licenses_test.go", false, false}, {"README.md", false, false}, {"PATENTS", false, false}, + {"LICENSE-LOGO", false, false}, + {"license-logo.txt", false, false}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) {