From c4fd10f85b66ee31f424128beb9b351103ccbd02 Mon Sep 17 00:00:00 2001 From: Arjun Suresh Date: Mon, 25 Nov 2024 21:23:27 +0530 Subject: [PATCH] Cleanup for validate cache in get-generic-python-lib --- automation/script/module.py | 19 ++++++++++++------- script/get-generic-python-lib/customize.py | 3 --- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/automation/script/module.py b/automation/script/module.py index fb0007d64..648b56507 100644 --- a/automation/script/module.py +++ b/automation/script/module.py @@ -1184,6 +1184,7 @@ def _run(self, i): 'recursion_spaces': recursion_spaces, 'script_tags': script_tags, 'found_script_tags': found_script_tags, + 'found_script_path': path, 'variation_tags': variation_tags, 'explicit_variation_tags': explicit_variation_tags, 'version': version, @@ -5019,23 +5020,27 @@ def find_cached_script(i): skip_cached_script = True continue - if os.path.exists(os.path.join(cached_script.path, "validate.sh")): - os_info = self_obj.os_info + os_info = self_obj.os_info - # Bat extension for this host OS - bat_ext = os_info['bat_ext'] + # Bat extension for this host OS + bat_ext = os_info['bat_ext'] + script_path = i['found_script_path'] + + if os.path.exists(os.path.join(script_path, f"validate_cache{bat_ext}")): run_script_input = { - 'path': cached_script.path, + 'path': script_path, 'bat_ext': bat_ext, 'os_info': os_info, 'recursion_spaces': recursion_spaces, 'tmp_file_run': self_obj.tmp_file_run, 'self': self_obj, - 'meta': i['meta'] + 'meta': meta } - ii = {'run_script_input': run_script_input, 'env': env, 'script_name': 'validate'} + ii = {'run_script_input': run_script_input, 'env': env, 'script_name': 'validate_cache'} r = self_obj.run_native_script(ii) + if r['return'] > 0: + #return r continue if not skip_cached_script: diff --git a/script/get-generic-python-lib/customize.py b/script/get-generic-python-lib/customize.py index f352ff87b..60308605e 100644 --- a/script/get-generic-python-lib/customize.py +++ b/script/get-generic-python-lib/customize.py @@ -1,7 +1,6 @@ from cmind import utils import os import cmind as cm -import shutil def preprocess(i): @@ -179,6 +178,4 @@ def postprocess(i): if pip_version and len(pip_version) > 1 and int(pip_version[0]) >= 23: env['CM_PYTHON_PIP_COMMON_EXTRA'] = " --break-system-packages" - shutil.copyfile(os.path.join(env['CM_TMP_CURRENT_SCRIPT_PATH'], "run.sh"), "validate.sh") - return {'return': 0, 'version': version}