dist: print Ubuntu PPA environment

This commit is contained in:
Peter F. Patel-Schneider 2022-11-25 05:24:20 -05:00
parent 0547b1895a
commit a6461d6a6e
1 changed files with 8 additions and 1 deletions

View File

@ -18,15 +18,22 @@ with open('lib/solaar/version', 'r') as vfile:
try: try:
commit = subprocess.check_output(['git', 'describe', '--always'], stderr=subprocess.DEVNULL).strip().decode() commit = subprocess.check_output(['git', 'describe', '--always'], stderr=subprocess.DEVNULL).strip().decode()
print('GIT', commit)
with open('lib/solaar/commit', 'w') as vfile: with open('lib/solaar/commit', 'w') as vfile:
vfile.write(f'{commit}\n') vfile.write(f'{commit}\n')
except Exception: # get commit from Ubuntu PPA directory name except Exception: # get commit from Ubuntu PPA directory name
dir = os.path.basename(sys.path[0]) dir = os.path.basename(sys.path[0])
print('DIRECTORY', dir) print('DIRECTORY', sys.path[0], dir, os.getcwd())
commit_match = re.search(r'git[0-9]*-([0-9a-f]*)~', dir) commit_match = re.search(r'git[0-9]*-([0-9a-f]*)~', dir)
if commit_match: if commit_match:
with open('lib/solaar/commit', 'w') as vfile: with open('lib/solaar/commit', 'w') as vfile:
vfile.write(f'{version}-g{commit_match[1]}\n') vfile.write(f'{version}-g{commit_match[1]}\n')
print(subprocess.check_output(['pwd'], stderr=subprocess.DEVNULL).strip().decode())
try:
print(subprocess.check_output(['dpkg-parsechangelog'], stderr=subprocess.DEVNULL).strip().decode())
except Exception:
pass
print(os.environ)
def _data_files(): def _data_files():