fix: correctly implement AppVersion equality and fix yt-dlp binary signing

This commit is contained in:
nimbold
2026-06-09 08:43:18 +03:30
parent 683eb45d0e
commit 7e185d06d1
2 changed files with 19 additions and 5 deletions
+4 -5
View File
@@ -175,11 +175,6 @@ if command -v codesign &> /dev/null; then
sign_mach_o_file() {
local path="$1"
case "$path" in
*/Python.framework/Python|*/Python.framework/Versions/Current/*)
return
;;
esac
if file "$path" | grep -q 'Mach-O'; then
if ! sign_path "$path"; then
@@ -202,6 +197,10 @@ if command -v codesign &> /dev/null; then
sign_mach_o_file "$executable_path"
done < <(find "$RESOURCES_DIR" -type f -print0)
while IFS= read -r -d '' bundle_path; do
sign_path "$bundle_path"
done < <(find "$RESOURCES_DIR" \( -name "*.xpc" -o -name "*.framework" \) -type d -depth -print0)
sign_path "$MACOS_DIR/$APP_NAME"
sign_path "$APP_DIR"
codesign --verify --deep --verbose=2 "$APP_DIR" || true
@@ -299,6 +299,21 @@ struct AppVersion: Comparable, CustomStringConvertible {
return false
}
static func == (lhs: AppVersion, rhs: AppVersion) -> Bool {
let count = max(lhs.components.count, rhs.components.count)
for index in 0..<count {
let left = index < lhs.components.count ? lhs.components[index] : 0
let right = index < rhs.components.count ? rhs.components[index] : 0
if left != right {
return false
}
}
return true
}
}
private extension JSONDecoder {