diff options
author | Felix Lange <fjl@twurst.com> | 2017-04-14 16:29:00 +0800 |
---|---|---|
committer | Felix Lange <fjl@twurst.com> | 2017-04-14 16:29:00 +0800 |
commit | 0cc492f81595c28caa24964a105446e362164539 (patch) | |
tree | 438835ab21a0eba74aef9c43fe4d5f35cd2f5d85 /build | |
parent | b35aa21f9f8561c09cfe4d3b0548eda6cff8604e (diff) | |
download | go-tangerine-0cc492f81595c28caa24964a105446e362164539.tar go-tangerine-0cc492f81595c28caa24964a105446e362164539.tar.gz go-tangerine-0cc492f81595c28caa24964a105446e362164539.tar.bz2 go-tangerine-0cc492f81595c28caa24964a105446e362164539.tar.lz go-tangerine-0cc492f81595c28caa24964a105446e362164539.tar.xz go-tangerine-0cc492f81595c28caa24964a105446e362164539.tar.zst go-tangerine-0cc492f81595c28caa24964a105446e362164539.zip |
all: update license information
Diffstat (limited to 'build')
-rw-r--r-- | build/update-license.go | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/build/update-license.go b/build/update-license.go index ee5281410..81b1a507d 100644 --- a/build/update-license.go +++ b/build/update-license.go @@ -49,11 +49,13 @@ var ( // don't relicense vendored sources "crypto/sha3/", "crypto/ecies/", "log/", "crypto/secp256k1/curve.go", + "consensus/ethash/xor.go", + "internal/jsre/deps", + "cmd/internal/browser", // don't license generated files "contracts/chequebook/contract/", "contracts/ens/contract/", "contracts/release/contract.go", - "p2p/discv5/nodeevent_string.go", } // paths with this prefix are licensed as GPL. all other files are LGPL. @@ -284,6 +286,9 @@ func getInfo(files <-chan string, out chan<- *info, wg *sync.WaitGroup) { if !stat.Mode().IsRegular() { continue } + if isGenerated(file) { + continue + } info, err := fileInfo(file) if err != nil { fmt.Printf("ERROR %s: %v\n", file, err) @@ -294,6 +299,23 @@ func getInfo(files <-chan string, out chan<- *info, wg *sync.WaitGroup) { wg.Done() } +func isGenerated(file string) bool { + fd, err := os.Open(file) + if err != nil { + return false + } + defer fd.Close() + buf := make([]byte, 2048) + n, _ := fd.Read(buf) + buf = buf[:n] + for _, l := range bytes.Split(buf, []byte("\n")) { + if bytes.HasPrefix(l, []byte("// Code generated")) { + return true + } + } + return false +} + // fileInfo finds the lowest year in which the given file was committed. func fileInfo(file string) (*info, error) { info := &info{file: file, Year: int64(time.Now().Year())} |