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: