summaryrefslogtreecommitdiff
path: root/wscript
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2024-04-27 17:41:52 +0200
committerCarl Hetherington <cth@carlh.net>2024-04-27 23:26:51 +0200
commita7b389a2e2ddbb41c15a0a87392c48ca4ded3bca (patch)
tree3dc49546daf9ea54b1617757aa5248d49652e27f /wscript
parentd40d196a777666206f39094c39956bb654b9b64c (diff)
Use plain git hash for VERSION when there is no exact tag.
Diffstat (limited to 'wscript')
-rw-r--r--wscript12
1 files changed, 6 insertions, 6 deletions
diff --git a/wscript b/wscript
index 3c2e0bb00..27b554df4 100644
--- a/wscript
+++ b/wscript
@@ -38,17 +38,17 @@ APPNAME = 'dcpomatic'
libdcp_version = '1.8.73'
libsub_version = '1.6.42'
-this_version = subprocess.Popen(shlex.split('git tag -l --points-at HEAD'), stdout=subprocess.PIPE).communicate()[0]
-last_version = subprocess.Popen(shlex.split('git describe --tags --match v* --abbrev=0'), stdout=subprocess.PIPE).communicate()[0]
+this_version = subprocess.Popen(['git', 'tag', '-l', '--points-at', 'HEAD'], stdout=subprocess.PIPE).communicate()[0]
+git_head = subprocess.Popen(['git', 'rev-parse', '--short', 'HEAD'], stdout=subprocess.PIPE).communicate()[0]
# Python 2/3 compatibility; I don't really understand what's going on here
if not isinstance(this_version, str):
this_version = this_version.decode('utf-8')
-if not isinstance(last_version, str):
- last_version = last_version.decode('utf-8')
+if not isinstance(git_head, str):
+ git_head = git_head.decode('utf-8')
-if this_version == '' or this_version == 'merged-to-main':
- VERSION = '%sdevel' % last_version[1:].strip()
+if this_version == '':
+ VERSION = git_head.strip()
else:
VERSION = this_version[1:].strip()