Schema: only require Repo, RepoType and SourceCode
Also fix all schema errors.
The NoSourceSince are added by a script
import yaml
from yaml import SafeLoader
from pathlib import Path
for file in Path(".").glob("metadata/*.yml"):
with file.open("r", encoding="utf-8") as f:
data = yaml.load(f, Loader=SafeLoader)
if not data.get("NoSourceSince") and not data.get("Repo"):
version = data.get("CurrentVersion")
if version:
with file.open("a") as f:
f.write(f"\nNoSourceSince: {version}\n")
and then run fdroid rewritemeta.
Disable auto update when the app is discontinued.
import yaml
from yaml import SafeLoader
from pathlib import Path
import re
subs = [
(r"AutoUpdateMode: .*", "AutoUpdateMode: None"),
(r"UpdateCheckMode: .*", "UpdateCheckMode: None"),
]
for file in Path(".").glob("metadata/*.yml"):
with file.open("r", encoding="utf-8") as f:
data = yaml.load(f, Loader=SafeLoader)
if data and (data.get("NoSourceSince") or data.get("ArchivePolicy") == "0 versions"):
text = file.read_text()
for old, new in subs:
text = re.sub(old, new, text)
file.write_text(text)
@FestplattenSchnitzel @licaon-kter @IzzySoft
Closes #2841 (closed)
Edited by linsui