fix: run should-update if available when checking for updates
This commit is contained in:
parent
8085c747cb
commit
3917e4dbb2
1 changed files with 13 additions and 2 deletions
|
|
@ -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
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue