check prerequisites

This commit is contained in:
Martin Diehl 2022-03-11 11:39:31 +01:00
parent b1effccafe
commit c5e16e08ae
1 changed files with 9 additions and 1 deletions

View File

@ -1,6 +1,7 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
import os import os
import sys
import glob import glob
import argparse import argparse
import shutil import shutil
@ -49,6 +50,13 @@ matches = {'Marc_tools': [['comp_user','comp_damask_*mp'],
['kill1','kill?']], ['kill1','kill?']],
'Mentat_menus':[['job_run.ms','job_run.ms']]} 'Mentat_menus':[['job_run.ms','job_run.ms']]}
for cmd in ['patch','xvfb-run']:
try:
damask.util.run(f'{cmd} --help')
except FileNotFoundError:
print(f'"{cmd}" not found, please install')
sys.exit()
print('patching files...') print('patching files...')
@ -63,7 +71,7 @@ print('compiling Mentat menu binaries...')
executable = marc_root/f'mentat{marc_version}/bin/mentat' executable = marc_root/f'mentat{marc_version}/bin/mentat'
menu_file = marc_root/f'mentat{marc_version}/menus/linux64/main.msb' menu_file = marc_root/f'mentat{marc_version}/menus/linux64/main.msb'
os.system(f'xvfb-run -a {executable} -compile {menu_file}') damask.util.run(f'xvfb-run -a {executable} -compile {menu_file}')
print('setting file access rights...') print('setting file access rights...')