aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/buildversion.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/scripts/buildversion.py b/scripts/buildversion.py
index 56bfcfa..c3a83b0 100755
--- a/scripts/buildversion.py
+++ b/scripts/buildversion.py
@@ -92,14 +92,16 @@ def main():
cleanbuild, toolstr = tool_versions(options.tools)
ver = git_version()
+ cleanbuild = cleanbuild and ver and 'dirty' not in ver
if not ver:
ver = file_version()
if not ver:
ver = "?"
- btime = time.strftime("%Y%m%d_%H%M%S")
- hostname = socket.gethostname()
- ver = "%s-%s-%s%s" % (ver, btime, hostname, options.extra)
- write_version(outfile, ver, toolstr)
+ if not cleanbuild:
+ btime = time.strftime("%Y%m%d_%H%M%S")
+ hostname = socket.gethostname()
+ ver = "%s-%s-%s" % (ver, btime, hostname)
+ write_version(outfile, ver + options.extra, toolstr)
if __name__ == '__main__':
main()