From 3917e4dbb23a6801bd9cf584a29fefd1dd1c0ae8 Mon Sep 17 00:00:00 2001 From: Rudra Saraswat Date: Wed, 1 Apr 2026 21:34:45 +0100 Subject: [PATCH] fix: run should-update if available when checking for updates --- usr/lib/akshara/utils/helpers.py | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/usr/lib/akshara/utils/helpers.py b/usr/lib/akshara/utils/helpers.py index 85e8700..8fda7c0 100644 --- a/usr/lib/akshara/utils/helpers.py +++ b/usr/lib/akshara/utils/helpers.py @@ -90,11 +90,22 @@ def is_already_latest() -> bool: if os.path.isfile("/usr/system.json"): with open("/usr/system.json") as system_json_file: contents = system_json_file.read().strip() + system_config = get_system_config() if ( - json.dumps(get_system_config(), ensure_ascii=False).strip() + json.dumps(system_config, ensure_ascii=False).strip() == contents.strip() ): - return True + if isinstance(system_config["distro-config"].get("should-update"), str): + return ( + subprocess.run( + ["bash", "-s"], + text=True, + input=system_config["distro-config"]["should-update"], + ).returncode + != 0 + ) + else: + return True else: return False else: