Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
Geth-Modification
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
张蕾
Geth-Modification
Commits
728ad6f4
Commit
728ad6f4
authored
Apr 14, 2016
by
Felix Lange
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
build: tweak update-license.go
parent
499d63f7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
6 deletions
+16
-6
update-license.go
build/update-license.go
+16
-6
No files found.
build/update-license.go
View file @
728ad6f4
...
...
@@ -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
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment