linux/update-mainline: fix oldest version check

(cherry picked from commit 6a2e37b318)
This commit is contained in:
K900 2024-11-08 22:01:52 +03:00 committed by github-actions[bot]
parent 825f46549e
commit eebc0198e2

View File

@ -87,9 +87,8 @@ def get_hash(kernel: KernelRelease):
return f"sha256:{hash}"
def get_oldest_branch() -> Version:
with open(VERSIONS_FILE) as f:
return parse_version(sorted(json.load(f).keys())[0])
def get_oldest_branch(kernels) -> Version:
return min(parse_version(v) for v in kernels.keys() if v != "testing")
def predates_oldest_branch(oldest: Version, to_compare: str) -> bool:
@ -118,8 +117,7 @@ def main():
if (parsed := parse_release(release)) is not None
]
all_kernels = json.load(VERSIONS_FILE.open())
oldest_branch = get_oldest_branch()
oldest_branch = get_oldest_branch(all_kernels)
for (branch, kernels) in groupby(parsed_releases, lambda kernel: kernel.branch):
kernel = max(kernels, key=lambda kernel: kernel.parsed_version)