2022-12-13 22:22:04 +00:00
|
|
|
#!/usr/bin/env python3
|
2023-04-04 09:59:25 +01:00
|
|
|
# vim: ft=python
|
|
|
|
|
# -*- mode: python -*-
|
|
|
|
|
|
2022-12-13 22:22:04 +00:00
|
|
|
import subprocess
|
|
|
|
|
import sys
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def is_arg_set(name):
|
|
|
|
|
for arg in sys.argv:
|
|
|
|
|
if arg == '--{}'.format(name):
|
|
|
|
|
return True
|
|
|
|
|
|
|
|
|
|
return False
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def get_arg(name):
|
|
|
|
|
ret_next = False
|
|
|
|
|
for arg in sys.argv:
|
|
|
|
|
if ret_next:
|
|
|
|
|
return arg
|
|
|
|
|
|
|
|
|
|
if arg == '--{}'.format(name):
|
|
|
|
|
ret_next = True
|
|
|
|
|
|
|
|
|
|
return ''
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
arch = get_arg('arch')
|
|
|
|
|
|
|
|
|
|
build_type = 'debug'
|
|
|
|
|
if is_arg_set('release'):
|
|
|
|
|
build_type = 'release'
|
|
|
|
|
|
|
|
|
|
current_tag = subprocess.check_output(['git', 'describe', '--tags', '--abbrev=0']).decode('utf-8').strip()
|
|
|
|
|
current_tag = current_tag[1:]
|
|
|
|
|
|
|
|
|
|
build_id = '{}/{}_{}'.format(current_tag, build_type, arch)
|
|
|
|
|
print('{}'.format(build_id.upper()))
|