diff options
author | Péter Szilágyi <peterke@gmail.com> | 2019-07-22 17:16:51 +0800 |
---|---|---|
committer | Péter Szilágyi <peterke@gmail.com> | 2019-07-22 17:16:51 +0800 |
commit | 364e485e5134843c9f6abc0ff51096bb4c8655c8 (patch) | |
tree | 5c51cb624d3625468a04f50ed83b0bfedc3ac374 | |
parent | 57fc1d21e18c0c698cd5ca86bcbbbaef352cad50 (diff) | |
download | go-tangerine-364e485e5134843c9f6abc0ff51096bb4c8655c8.tar go-tangerine-364e485e5134843c9f6abc0ff51096bb4c8655c8.tar.gz go-tangerine-364e485e5134843c9f6abc0ff51096bb4c8655c8.tar.bz2 go-tangerine-364e485e5134843c9f6abc0ff51096bb4c8655c8.tar.lz go-tangerine-364e485e5134843c9f6abc0ff51096bb4c8655c8.tar.xz go-tangerine-364e485e5134843c9f6abc0ff51096bb4c8655c8.tar.zst go-tangerine-364e485e5134843c9f6abc0ff51096bb4c8655c8.zip |
build: update license exclusions, case insensitive author list
-rw-r--r-- | build/update-license.go | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/build/update-license.go b/build/update-license.go index 0ce829233..1bad7585d 100644 --- a/build/update-license.go +++ b/build/update-license.go @@ -62,16 +62,22 @@ var ( skipPrefixes = []string{ // boring stuff "vendor/", "tests/testdata/", "build/", + // don't relicense vendored sources "cmd/internal/browser", + "common/bitutil/bitutil", + "common/prque/", "consensus/ethash/xor.go", "crypto/bn256/", "crypto/ecies/", - "crypto/secp256k1/curve.go", - "crypto/sha3/", + "graphql/graphiql.go", "internal/jsre/deps", "log/", - "common/bitutil/bitutil", + "metrics/", + "signer/rules/deps", + + // skip special licenses + "crypto/secp256k1", // Relicensed to BSD-3 via https://github.com/ethereum/go-ethereum/pull/17225 } // paths with this prefix are licensed as GPL. all other files are LGPL. @@ -144,6 +150,13 @@ func (i info) gpl() bool { return false } +// authors implements the sort.Interface for strings in case-insensitive mode. +type authors []string + +func (as authors) Len() int { return len(as) } +func (as authors) Less(i, j int) bool { return strings.ToLower(as[i]) < strings.ToLower(as[j]) } +func (as authors) Swap(i, j int) { as[i], as[j] = as[j], as[i] } + func main() { var ( files = getFiles() @@ -263,7 +276,7 @@ func mailmapLookup(authors []string) []string { func writeAuthors(files []string) { merge := make(map[string]bool) - // Add authors that Git reports as contributorxs. + // Add authors that Git reports as contributors. // This is the primary source of author information. for _, a := range gitAuthors(files) { merge[a] = true @@ -279,7 +292,7 @@ func writeAuthors(files []string) { for a := range merge { result = append(result, a) } - sort.Strings(result) + sort.Sort(authors(result)) content := new(bytes.Buffer) content.WriteString(authorsFileHeader) for _, a := range result { |