Now there is no convenient way to set the version number in the required format if we build SeaBIOS from the repository. It is proposed first of all to get the version number from the .version file if it exists, if it is absent, from git. This approach will allow you to safely specify the version manually and will not affect existing builds.
Alexey Kirillov (1): build: increase .version priority over git
scripts/buildversion.py | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-)
To simplify the process of building release versions in a directory under git, we will give priority to the file .version and not the version in git.
Signed-off-by: Alexey Kirillov lekiravi@yandex-team.ru --- scripts/buildversion.py | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-)
diff --git a/scripts/buildversion.py b/scripts/buildversion.py index 8875497..8e5c17b 100755 --- a/scripts/buildversion.py +++ b/scripts/buildversion.py @@ -113,17 +113,22 @@ def main():
cleanbuild, toolstr = tool_versions(options.tools)
- ver = git_version() - cleanbuild = cleanbuild and 'dirty' not in ver - if not ver: - ver = file_version() + # If there are correct .version file, use it. + # Othervise look for version in git. + ver = file_version() + if ver: # We expect the "extra version" to contain information on the - # distributor and distribution package version (if - # applicable). It is a "clean" build if this is a build from + # distributor and distribution package version (if applicable). + # It is a "clean" build if this is a build from # an official release tarball and the above info is present. cleanbuild = cleanbuild and ver and options.extra != "" - if not ver: + else: + ver = git_version() + if ver: + cleanbuild = cleanbuild and 'dirty' not in ver + else: ver = "?" + if not cleanbuild: btime = time.strftime("%Y%m%d_%H%M%S") hostname = socket.gethostname()
Hi,
This approach will allow you to safely specify the version manually and will not affect existing builds.
We don't want an easy way to override the version. It's useful to have the exact version in the logs for bug reports etc.
We might change the way the version string is built though. For starters scripts/tarball.sh and scripts/buildversion.py are not consistent, it makes sense to fix that. For example scripts/tarball.sh detects that a release tag is checked out and generated a shorter version string without git hash included then.
So, what exactly do you need?
cheers, Gerd