dist: get Ubuntu version from dpkg-parsechangelog
This commit is contained in:
parent
4a9319a4c0
commit
f4b25b2594
8
setup.py
8
setup.py
|
@ -19,11 +19,11 @@ try: # get commit from git describe
|
|||
vfile.write(f'{commit}\n')
|
||||
except Exception: # get commit from Ubuntu dpkg-parsechangelog
|
||||
try:
|
||||
version = subprocess.check_output(['dpkg-parsechangelog', '--show-field', 'Version'],
|
||||
stderr=subprocess.DEVNULL).strip().decode()
|
||||
version = version.split('~')
|
||||
commit = subprocess.check_output(['dpkg-parsechangelog', '--show-field', 'Version'],
|
||||
stderr=subprocess.DEVNULL).strip().decode()
|
||||
commit = commit.split('~')
|
||||
with open('lib/solaar/commit', 'w') as vfile:
|
||||
vfile.write(f'{version[0]}\n')
|
||||
vfile.write(f'{commit[0]}\n')
|
||||
except Exception as e:
|
||||
print('Exception using dpkg-parsechangelog', e)
|
||||
|
||||
|
|
Loading…
Reference in New Issue