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,10 +90,21 @@ def is_already_latest() -> bool:
if os.path.isfile("/usr/system.json"): if os.path.isfile("/usr/system.json"):
with open("/usr/system.json") as system_json_file: with open("/usr/system.json") as system_json_file:
contents = system_json_file.read().strip() contents = system_json_file.read().strip()
system_config = get_system_config()
if ( if (
json.dumps(get_system_config(), ensure_ascii=False).strip() json.dumps(system_config, ensure_ascii=False).strip()
== contents.strip() == contents.strip()
): ):
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 return True
else: else:
return False return False