From 4e6f59c2ad373baa2352f1d791d931f54300f5c2 Mon Sep 17 00:00:00 2001 From: "Peter F. Patel-Schneider" Date: Sun, 27 Nov 2022 09:37:30 -0500 Subject: [PATCH] dist: get Ubuntu version from dpkg-parsechangelog --- setup.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/setup.py b/setup.py index 588ba335..b6229934 100755 --- a/setup.py +++ b/setup.py @@ -21,14 +21,15 @@ try: # get commit from git describe except Exception: # get commit from Ubuntu dpkg-parsechangelog try: dpkg = subprocess.check_output(['dpkg-parsechangelog'], stderr=subprocess.DEVNULL).strip().decode() - print(dpkg) + print('DPKG', dpkg) match = re.search(r'\nVersion: (.*)~', dpkg) print('VERSION', match.group(0), match.group(1)) with open('lib/solaar/commit', 'w') as vfile: vfile.write(f'{match.group[1]}\n') - commit = subprocess.check_output(['dpkg-parsechangelog', '--show-field', 'Version'], - stderr=subprocess.DEVNULL).strip().decode() - print('DPKG VERSION', commit) + print('Version', subprocess.check_output(['dpkg-parsechangelog', '--show-field', 'Version']).strip().decode()) + print('version', subprocess.check_output(['dpkg-parsechangelog', '--show-field', 'version']).strip().decode()) + print('Version', subprocess.check_output(['dpkg-parsechangelog', '--show-field=Version']).strip().decode()) + print('version', subprocess.check_output(['dpkg-parsechangelog', '--show-field=version']).strip().decode()) # with open('lib/solaar/commit', 'w') as vfile: # vfile.write(f'{commit]}\n') except Exception: