good morning!!!!
Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
B
bor
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Harbor Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
open
bor
Commits
728ad6f4
Commit
728ad6f4
authored
9 years ago
by
Felix Lange
Browse files
Options
Downloads
Patches
Plain Diff
build: tweak update-license.go
parent
499d63f7
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
build/update-license.go
+16
-6
16 additions, 6 deletions
build/update-license.go
with
16 additions
and
6 deletions
build/update-license.go
+
16
−
6
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
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment