fix: run should-update if available when checking for updates

This commit is contained in:
Rudra Saraswat 2026-04-01 21:34:45 +01:00
parent 8085c747cb
commit 3917e4dbb2

View file

@ -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: