Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
P
Platform-independent core collection
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
18
Issues
18
List
Board
Labels
Milestones
Merge Requests
5
Merge Requests
5
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
Platform-independent core collection
Commits
b7b7485b
Commit
b7b7485b
authored
May 06, 2020
by
Tristan Gingold
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gen_buildinfo.py: add tag and dirty flag.
parent
c465b482
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
1 deletion
+12
-1
gen_buildinfo.py
tools/gen_buildinfo.py
+12
-1
No files found.
tools/gen_buildinfo.py
View file @
b7b7485b
...
...
@@ -8,6 +8,16 @@ with open("buildinfo_pkg.vhd", "w") as f:
[
"git"
,
"log"
,
"-1"
,
"--format=
%
H"
])
.
decode
()
.
strip
()
except
:
commitid
=
"unknown"
try
:
tag
=
subprocess
.
check_output
(
[
"git"
,
"describe"
,
"--dirty"
,
"--always"
])
.
decode
()
.
strip
()
if
tag
.
endswith
(
'-dirty'
):
dirty
=
'-dirty'
else
:
dirty
=
''
except
:
tag
=
'unknown'
dirty
=
"-??"
try
:
userid
=
subprocess
.
check_output
(
[
"git"
,
"config"
,
"--get"
,
"user.name"
])
.
decode
()
.
strip
()
...
...
@@ -27,7 +37,8 @@ with open("buildinfo_pkg.vhd", "w") as f:
f
.
write
(
" constant buildinfo : string :=
\n
"
)
f
.
write
(
' "buildinfo:1" & LF
\n
'
)
f
.
write
(
' & "module:{}" & LF
\n
'
.
format
(
top
))
f
.
write
(
' & "commit:{}" & LF
\n
'
.
format
(
commitid
))
f
.
write
(
' & "commit:{}" & LF
\n
'
.
format
(
commitid
+
dirty
))
f
.
write
(
' & "tag:{}" & LF
\n
'
.
format
(
tag
))
f
.
write
(
' & "syntool:{}" & LF
\n
'
.
format
(
tool
))
f
.
write
(
' & "syndate:{}" & LF
\n
'
.
format
(
time
.
strftime
(
"
%
F,
%
H:
%
M
%
Z"
,
time
.
localtime
())))
...
...
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