kdk_handler: Fix fallback logic

This commit is contained in:
Mykola Grymalyuk
2022-12-15 20:41:08 -07:00
parent 90310fcaca
commit 6c6ae6145d
2 changed files with 2 additions and 1 deletions
+1
View File
@@ -13,6 +13,7 @@
- Resolve silent auto patcher crash when new OCLP version is available
- Implement [`py_sip_xnu`](https://github.com/khronokernel/py_sip_xnu) module
- Resolve Content Caching Patch Regression
- Resolve KDK Versioning Fallback crashing when primary KDK site is down
- Increment Binaries:
- OpenCorePkg 0.8.7 - release
- FeatureUnlock 1.1.1 - release
+1 -1
View File
@@ -62,7 +62,7 @@ class kernel_debug_kit_handler:
macos_builds = [i for i in results.json()["ios"] if i["osType"] == "macOS"]
# If the version is borked, put it at the bottom of the list
# Would omit it, but can't do that in this lambda
macos_builds.sort(key=lambda x: (packaging.version.parse(VERSION_PATTERN.match(x["version"]).group() if VERSION_PATTERN.match(x["version"]) else "0.0.0"), datetime.datetime.fromisoformat(x["released"])), reverse=True) # type: ignore
macos_builds.sort(key=lambda x: (packaging.version.parse(VERSION_PATTERN.match(x["version"]).group() if VERSION_PATTERN.match(x["version"]) else "0.0.0"), datetime.datetime.fromisoformat(x["released"] if x["released"] != "" else "1984-01-01")), reverse=True) # type: ignore
# Iterate through, find build that is closest to the host version
# Use date to determine which is closest