From 23c6cc7101f956990844e6d52b1027a3d89d7ce6 Mon Sep 17 00:00:00 2001 From: r00t Date: Wed, 14 Dec 2016 00:52:05 -0500 Subject: [PATCH] fixing versioning --- bdisk/host.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/bdisk/host.py b/bdisk/host.py index 6a5ca70..12a9466 100755 --- a/bdisk/host.py +++ b/bdisk/host.py @@ -79,14 +79,13 @@ def parseConfig(confs): config_dict['sync']['tftp'] = config['sync'].getboolean('tftp') config_dict['rsync']['iso'] = config['rsync'].getboolean('iso') # Get the version... - # Three possibilities. - # e.g. 1 commit after tag with short hash: ['v3.10', '1', 'gb4a5e40'] + # Two possibilities. + # 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'] == '': repo = git.Repo(config_dict['build']['basedir']) refs = repo.git.describe(repo.head.commit).split('-') - if len(refs) >= 3: - config_dict['bdisk']['ver'] = refs[0] + 'r' + refs[2] - elif len(refs) == 2: + if len(refs) >= 2: config_dict['bdisk']['ver'] = refs[0] + 'r' + refs[1] else: config_dict['bdisk']['ver'] = refs[0]