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')
|
vfile.write(f'{commit}\n')
|
||||||
except Exception: # get commit from Ubuntu dpkg-parsechangelog
|
except Exception: # get commit from Ubuntu dpkg-parsechangelog
|
||||||
try:
|
try:
|
||||||
version = subprocess.check_output(['dpkg-parsechangelog', '--show-field', 'Version'],
|
commit = subprocess.check_output(['dpkg-parsechangelog', '--show-field', 'Version'],
|
||||||
stderr=subprocess.DEVNULL).strip().decode()
|
stderr=subprocess.DEVNULL).strip().decode()
|
||||||
version = version.split('~')
|
commit = commit.split('~')
|
||||||
with open('lib/solaar/commit', 'w') as vfile:
|
with open('lib/solaar/commit', 'w') as vfile:
|
||||||
vfile.write(f'{version[0]}\n')
|
vfile.write(f'{commit[0]}\n')
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print('Exception using dpkg-parsechangelog', e)
|
print('Exception using dpkg-parsechangelog', e)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue