From 4adfb0bd4cef7c132a51b5e24c93be4367877ae0 Mon Sep 17 00:00:00 2001 From: Arjun Suresh Date: Sat, 5 Oct 2024 22:50:40 +0530 Subject: [PATCH] Fixed recursion bug in get-sys-utils-min --- script/detect-os/_cm.json | 5 +++++ script/get-generic-sys-util/customize.py | 13 ++++++------- script/get-sys-utils-min/_cm.yaml | 2 ++ 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/script/detect-os/_cm.json b/script/detect-os/_cm.json index 383b7f9302..7d64c9397b 100644 --- a/script/detect-os/_cm.json +++ b/script/detect-os/_cm.json @@ -25,6 +25,11 @@ "windows" ] }, + "skip_if_env": { + "CM_WINDOWS_SYS_UTILS_MIN_INSTALL": [ + "yes" + ] + }, "tags": "get,sys-utils-min" } ], diff --git a/script/get-generic-sys-util/customize.py b/script/get-generic-sys-util/customize.py index 648f139159..3263acf4f0 100644 --- a/script/get-generic-sys-util/customize.py +++ b/script/get-generic-sys-util/customize.py @@ -29,8 +29,13 @@ def preprocess(i): # Only "install" mode reaches here pm = env.get('CM_HOST_OS_PACKAGE_MANAGER') + util = env.get('CM_SYS_UTIL_NAME', '') + if util == '': + return {'return': 1, 'error': 'Please select a variation specifying the sys util name'} - if os_info['platform'] == 'windows': + package = state.get(util) + + if os_info['platform'] == 'windows' and not package: print ('') print ('WARNING: for now skipping get-generic-sys-util on Windows ...') print ('') @@ -40,12 +45,6 @@ def preprocess(i): if not pm: return {'return': 1, 'error': 'Package manager not detected for the given OS'} - util = env.get('CM_SYS_UTIL_NAME', '') - if util == '': - return {'return': 1, 'error': 'Please select a variation specifying the sys util name'} - - - package = state.get(util) if not package: return {'return': 1, 'error': 'No package name specified for {} and util name {}'.format(pm, util)} diff --git a/script/get-sys-utils-min/_cm.yaml b/script/get-sys-utils-min/_cm.yaml index 6623d9a79d..c07f46eb57 100644 --- a/script/get-sys-utils-min/_cm.yaml +++ b/script/get-sys-utils-min/_cm.yaml @@ -9,6 +9,7 @@ cache: true category: Detection or installation of tools and artifacts deps: + - tags: detect,os - tags: get,generic,sys-util,_xz enable_if_env: CM_HOST_OS_TYPE: @@ -20,6 +21,7 @@ deps: env: CM_CLEAN_DIRS: bin + CM_WINDOWS_SYS_UTILS_MIN_INSTALL: yes CM_PACKAGE_WIN_URL: https://zenodo.org/records/13868077/files/cm-artifact-os-windows-32.zip?download=1 CM_SUDO: sudo