fixing versioning
This commit is contained in:
parent
f437391818
commit
23c6cc7101
@ -79,14 +79,13 @@ def parseConfig(confs):
|
|||||||
config_dict['sync']['tftp'] = config['sync'].getboolean('tftp')
|
config_dict['sync']['tftp'] = config['sync'].getboolean('tftp')
|
||||||
config_dict['rsync']['iso'] = config['rsync'].getboolean('iso')
|
config_dict['rsync']['iso'] = config['rsync'].getboolean('iso')
|
||||||
# Get the version...
|
# Get the version...
|
||||||
# Three possibilities.
|
# Two possibilities.
|
||||||
# e.g. 1 commit after tag with short hash: ['v3.10', '1', 'gb4a5e40']
|
# e.g. 1 commit after tag with 7-digit object hex: ['v3.10', '1', 'gb4a5e40']
|
||||||
|
# Or if were sitting on a tag with no commits: ['v3.10']
|
||||||
if config_dict['bdisk']['ver'] == '':
|
if config_dict['bdisk']['ver'] == '':
|
||||||
repo = git.Repo(config_dict['build']['basedir'])
|
repo = git.Repo(config_dict['build']['basedir'])
|
||||||
refs = repo.git.describe(repo.head.commit).split('-')
|
refs = repo.git.describe(repo.head.commit).split('-')
|
||||||
if len(refs) >= 3:
|
if len(refs) >= 2:
|
||||||
config_dict['bdisk']['ver'] = refs[0] + 'r' + refs[2]
|
|
||||||
elif len(refs) == 2:
|
|
||||||
config_dict['bdisk']['ver'] = refs[0] + 'r' + refs[1]
|
config_dict['bdisk']['ver'] = refs[0] + 'r' + refs[1]
|
||||||
else:
|
else:
|
||||||
config_dict['bdisk']['ver'] = refs[0]
|
config_dict['bdisk']['ver'] = refs[0]
|
||||||
|
Loading…
Reference in New Issue
Block a user