diff options
author | Péter Szilágyi <peterke@gmail.com> | 2019-07-22 17:57:54 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-07-22 17:57:54 +0800 |
commit | e8141e168560b8b1d2b50658c454adbfa905dacc (patch) | |
tree | 5e2ec58dedd15e1d3cb0b22efb4b818dd0496c5b /build | |
parent | 82985075f7e5de819445ca57c1f9b80894b162b6 (diff) | |
parent | b973eddd2830fb4743e0e69d026eafbb97a40c79 (diff) | |
download | go-tangerine-e8141e168560b8b1d2b50658c454adbfa905dacc.tar go-tangerine-e8141e168560b8b1d2b50658c454adbfa905dacc.tar.gz go-tangerine-e8141e168560b8b1d2b50658c454adbfa905dacc.tar.bz2 go-tangerine-e8141e168560b8b1d2b50658c454adbfa905dacc.tar.lz go-tangerine-e8141e168560b8b1d2b50658c454adbfa905dacc.tar.xz go-tangerine-e8141e168560b8b1d2b50658c454adbfa905dacc.tar.zst go-tangerine-e8141e168560b8b1d2b50658c454adbfa905dacc.zip |
Merge pull request #19873 from karalabe/author-1.9.1
all: update author list and licenses
Diffstat (limited to 'build')
-rw-r--r-- | build/update-license.go | 44 |
1 files changed, 31 insertions, 13 deletions
diff --git a/build/update-license.go b/build/update-license.go index 0ce829233..aa4d6100d 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() @@ -262,27 +275,32 @@ func mailmapLookup(authors []string) []string { } func writeAuthors(files []string) { - merge := make(map[string]bool) - // Add authors that Git reports as contributorxs. + var ( + dedup = make(map[string]bool) + list []string + ) + // Add authors that Git reports as contributors. // This is the primary source of author information. for _, a := range gitAuthors(files) { - merge[a] = true + if la := strings.ToLower(a); !dedup[la] { + list = append(list, a) + dedup[la] = true + } } // Add existing authors from the file. This should ensure that we // never lose authors, even if Git stops listing them. We can also // add authors manually this way. for _, a := range readAuthors() { - merge[a] = true + if la := strings.ToLower(a); !dedup[la] { + list = append(list, a) + dedup[la] = true + } } // Write sorted list of authors back to the file. - var result []string - for a := range merge { - result = append(result, a) - } - sort.Strings(result) + sort.Sort(authors(list)) content := new(bytes.Buffer) content.WriteString(authorsFileHeader) - for _, a := range result { + for _, a := range list { content.WriteString(a) content.WriteString("\n") } |