diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2015-10-13 15:49:03 -0400 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2015-10-15 10:55:14 -0400 |
commit | a1b4dd09d73d34308435ce6e77c986e6e25ee737 (patch) | |
tree | 7c97d74b388e58857d1f77c975accfac21ac628b /scripts | |
parent | efd70a5006b9d402ba74fd3c49872062cb48667f (diff) | |
download | seabios-hppa-a1b4dd09d73d34308435ce6e77c986e6e25ee737.zip seabios-hppa-a1b4dd09d73d34308435ce6e77c986e6e25ee737.tar.gz seabios-hppa-a1b4dd09d73d34308435ce6e77c986e6e25ee737.tar.bz2 |
build: Generate "reproducible" version strings on "clean" builds
If the build environment looks "clean" then don't add the build
hostname or build time to the version string. This makes the default
build string reproducible across builds.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/buildversion.py | 10 |
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() |