From c5e16e08aed48ccb934f3de15911968aa45a566e Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Fri, 11 Mar 2022 11:39:31 +0100 Subject: [PATCH 1/4] check prerequisites --- install/MarcMentat/apply_DAMASK_modifications.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/install/MarcMentat/apply_DAMASK_modifications.py b/install/MarcMentat/apply_DAMASK_modifications.py index dd5a3a413..7d4bc4094 100755 --- a/install/MarcMentat/apply_DAMASK_modifications.py +++ b/install/MarcMentat/apply_DAMASK_modifications.py @@ -1,6 +1,7 @@ #!/usr/bin/env python3 import os +import sys import glob import argparse import shutil @@ -49,6 +50,13 @@ matches = {'Marc_tools': [['comp_user','comp_damask_*mp'], ['kill1','kill?']], '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...') @@ -63,7 +71,7 @@ print('compiling Mentat menu binaries...') executable = marc_root/f'mentat{marc_version}/bin/mentat' 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...') From 670e614bd747c9a3e8dd7686d31e931f2fe6cba3 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Sat, 12 Mar 2022 22:06:48 +0100 Subject: [PATCH 2/4] avoid reverse patch --- install/MarcMentat/apply_DAMASK_modifications.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install/MarcMentat/apply_DAMASK_modifications.py b/install/MarcMentat/apply_DAMASK_modifications.py index 7d4bc4094..03cf4ae11 100755 --- a/install/MarcMentat/apply_DAMASK_modifications.py +++ b/install/MarcMentat/apply_DAMASK_modifications.py @@ -14,7 +14,7 @@ def copy_and_patch(patch,orig,editor): shutil.copyfile(orig,orig.parent/patch.stem) except shutil.SameFileError: pass - damask.util.run(f'patch {orig.parent/patch.stem} {patch} -b') + damask.util.run(f'patch {orig.parent/patch.stem} {patch} --backup --forward') with open(orig.parent/patch.stem) as f_in: content = f_in.read() with open(orig.parent/patch.stem,'w') as f_out: From 965ba61f11142fc79c492741a4dc9b416bc34647 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Mon, 14 Mar 2022 07:22:09 +0100 Subject: [PATCH 3/4] avoid duplicated brackets --- install/MarcMentat/apply_DAMASK_modifications.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install/MarcMentat/apply_DAMASK_modifications.py b/install/MarcMentat/apply_DAMASK_modifications.py index 03cf4ae11..9ffe187c5 100755 --- a/install/MarcMentat/apply_DAMASK_modifications.py +++ b/install/MarcMentat/apply_DAMASK_modifications.py @@ -26,7 +26,7 @@ parser = argparse.ArgumentParser( formatter_class=argparse.ArgumentDefaultsHelpFormatter) parser.add_argument('--editor', dest='editor', metavar='string', default='vi', - help='Name of the editor for Marc Mentat (executable)') + help='Name of the editor (executable) used by Marc Mentat') parser.add_argument('--marc-root', dest='marc_root', metavar='string', default=damask.solver._marc._marc_root, help='Marc root directory') From af4e8c4975db04658d26726e323aee3d4ecfd2f4 Mon Sep 17 00:00:00 2001 From: Test User Date: Tue, 15 Mar 2022 12:20:03 +0100 Subject: [PATCH 4/4] [skip ci] updated version information after successful test of v3.0.0-alpha6-151-g92bf10cad --- python/damask/VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/damask/VERSION b/python/damask/VERSION index 70733ff68..2622b6f21 100644 --- a/python/damask/VERSION +++ b/python/damask/VERSION @@ -1 +1 @@ -v3.0.0-alpha6-146-g3618e36ab +v3.0.0-alpha6-151-g92bf10cad