aboutsummaryrefslogtreecommitdiffstats
path: root/build
diff options
context:
space:
mode:
authorFelix Lange <fjl@twurst.com>2016-04-15 00:16:51 +0800
committerFelix Lange <fjl@twurst.com>2016-04-15 15:46:54 +0800
commit728ad6f47dde32f73469d3c9f48103d9974a191c (patch)
treeb4f72c929545004ffc55a1fb937c538601e582cc /build
parent499d63f706fcb719eb9b921ce6f2c38d06c8b286 (diff)
downloaddexon-728ad6f47dde32f73469d3c9f48103d9974a191c.tar.gz
dexon-728ad6f47dde32f73469d3c9f48103d9974a191c.tar.zst
dexon-728ad6f47dde32f73469d3c9f48103d9974a191c.zip
build: tweak update-license.go
Diffstat (limited to 'build')
-rw-r--r--build/update-license.go22
1 files changed, 16 insertions, 6 deletions
diff --git a/build/update-license.go b/build/update-license.go
index 04f52a13c..803f7e8fd 100644
--- a/build/update-license.go
+++ b/build/update-license.go
@@ -48,7 +48,7 @@ var (
"Godeps/", "tests/files/", "build/",
// don't relicense vendored sources
"crypto/sha3/", "crypto/ecies/", "logger/glog/",
- "crypto/curve.go",
+ "crypto/secp256k1/curve.go",
"trie/arc.go",
}
@@ -151,14 +151,24 @@ func main() {
writeLicenses(infoc)
}
+func skipFile(path string) bool {
+ if strings.Contains(path, "/testdata/") {
+ return true
+ }
+ for _, p := range skipPrefixes {
+ if strings.HasPrefix(path, p) {
+ return true
+ }
+ }
+ return false
+}
+
func getFiles() []string {
cmd := exec.Command("git", "ls-tree", "-r", "--name-only", "HEAD")
var files []string
err := doLines(cmd, func(line string) {
- for _, p := range skipPrefixes {
- if strings.HasPrefix(line, p) {
- return
- }
+ if skipFile(line) {
+ return
}
ext := filepath.Ext(line)
for _, wantExt := range extensions {
@@ -283,7 +293,7 @@ func getInfo(files <-chan string, out chan<- *info, wg *sync.WaitGroup) {
// fileInfo finds the lowest year in which the given file was commited.
func fileInfo(file string) (*info, error) {
info := &info{file: file, Year: int64(time.Now().Year())}
- cmd := exec.Command("git", "log", "--follow", "--find-copies", "--pretty=format:%ai", "--", file)
+ cmd := exec.Command("git", "log", "--follow", "--find-renames=80", "--find-copies=80", "--pretty=format:%ai", "--", file)
err := doLines(cmd, func(line string) {
y, err := strconv.ParseInt(line[:4], 10, 64)
if err != nil {