mirror of https://gitlab.com/openlp/packaging.git
Fixed the generation of the version string
This commit is contained in:
parent
1f813bcaf3
commit
a1ea10721f
|
@ -318,15 +318,16 @@ class Builder(object):
|
||||||
else:
|
else:
|
||||||
# This is a development build, get the tag and revision
|
# This is a development build, get the tag and revision
|
||||||
output = self._git('tag', self.branch_path, ['--list'], err_msg='Error running git tag')
|
output = self._git('tag', self.branch_path, ['--list'], err_msg='Error running git tag')
|
||||||
lines = output.splitlines()
|
lines = output.strip().splitlines()
|
||||||
if len(lines) == 0:
|
if len(lines) == 0:
|
||||||
tag = '0.0.0'
|
tag = '0.0.0'
|
||||||
else:
|
else:
|
||||||
tmp, ref_tag = lines[-1].split()
|
tag = lines[-1]
|
||||||
tag = ref_tag.split('/')[2]
|
revision_count = self._git('rev-list', self.branch_path, ['--count', 'HEAD'], 'Error running git rev-list')
|
||||||
revision = self._git('rev-list', self.branch_path, ['--count', 'HEAD'], 'Error running git rev-list')
|
revision_count = revision_count.strip()
|
||||||
sha = self._git('rev-parse', self.branch_path, ['--short', 'HEAD'], 'Error running git rev-parse')
|
sha = self._git('rev-parse', self.branch_path, ['--short', 'HEAD'], 'Error running git rev-parse')
|
||||||
self.version = '{tag}.git-{revision}-{sha}'.format(tag=tag, revision=revision, sha=sha)
|
sha = sha.strip()
|
||||||
|
self.version = '{tag}.git-r{revision}-{sha}'.format(tag=tag, revision=revision_count, sha=sha)
|
||||||
# Write the version to the version file
|
# Write the version to the version file
|
||||||
with open(os.path.join(self.dist_path, '.version'), 'w') as version_file:
|
with open(os.path.join(self.dist_path, '.version'), 'w') as version_file:
|
||||||
version_file.write(str(self.version))
|
version_file.write(str(self.version))
|
||||||
|
|
Loading…
Reference in New Issue