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
1d05027b
Commit
1d05027b
authored
Jan 07, 2015
by
Felix Lange
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
a few fixes for the license tool
parent
ec7cb998
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
5 deletions
+4
-5
update-license.go
update-license.go
+4
-5
No files found.
update-license.go
View file @
1d05027b
// +build none
// +build none
/*
/*
This command generates GPL license headers on top of all source files.
This command generates GPL license headers on top of all source files.
You can run it once per month, before cutting a release or just
You can run it once per month, before cutting a release or just
whenever you feel like it.
whenever you feel like it.
go run update-license
s
.go
go run update-license.go
The copyright in each file is assigned to any authors for which git
The copyright in each file is assigned to any authors for which git
can find commits in the file's history. It will try to follow renames
can find commits in the file's history. It will try to follow renames
...
@@ -199,12 +198,13 @@ func fileInfo(file string) (*info, error) {
...
@@ -199,12 +198,13 @@ func fileInfo(file string) (*info, error) {
return
info
,
err
return
info
,
err
}
}
func
writeLicenses
(
infos
<-
chan
*
info
)
error
{
func
writeLicenses
(
infos
<-
chan
*
info
)
{
buf
:=
new
(
bytes
.
Buffer
)
buf
:=
new
(
bytes
.
Buffer
)
for
info
:=
range
infos
{
for
info
:=
range
infos
{
content
,
err
:=
ioutil
.
ReadFile
(
info
.
file
)
content
,
err
:=
ioutil
.
ReadFile
(
info
.
file
)
if
err
!=
nil
{
if
err
!=
nil
{
fmt
.
Printf
(
"ERROR: couldn't read %s: %v
\n
"
,
info
.
file
,
err
)
fmt
.
Printf
(
"ERROR: couldn't read %s: %v
\n
"
,
info
.
file
,
err
)
continue
}
}
// construct new file content
// construct new file content
...
@@ -219,11 +219,10 @@ func writeLicenses(infos <-chan *info) error {
...
@@ -219,11 +219,10 @@ func writeLicenses(infos <-chan *info) error {
if
!
bytes
.
Equal
(
content
,
buf
.
Bytes
())
{
if
!
bytes
.
Equal
(
content
,
buf
.
Bytes
())
{
fmt
.
Println
(
"writing"
,
info
.
ShortLicense
(),
info
.
file
)
fmt
.
Println
(
"writing"
,
info
.
ShortLicense
(),
info
.
file
)
if
err
:=
ioutil
.
WriteFile
(
info
.
file
,
buf
.
Bytes
(),
info
.
mode
);
err
!=
nil
{
if
err
:=
ioutil
.
WriteFile
(
info
.
file
,
buf
.
Bytes
(),
info
.
mode
);
err
!=
nil
{
return
err
fmt
.
Printf
(
"ERROR: couldn't write %s: %v"
,
info
.
file
,
err
)
}
}
}
}
}
}
return
nil
}
}
func
doLines
(
cmd
*
exec
.
Cmd
,
f
func
(
string
))
error
{
func
doLines
(
cmd
*
exec
.
Cmd
,
f
func
(
string
))
error
{
...
...
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