products.py: Better handle Apple Silicon installers

This commit is contained in:
Mykola Grymalyuk
2024-10-31 15:55:19 -06:00
parent 5542f10ea1
commit b561a35ca9
2 changed files with 20 additions and 5 deletions

View File

@@ -55,7 +55,7 @@ class CatalogProducts:
# Ensure Apple Silicon specific Installers are not listed
if "VMM-x86_64" not in data["MobileAssetProperties"]["SupportedDeviceModels"]:
if self.vmm_only:
return {}
return {"Missing VMM Support": True}
version = data["MobileAssetProperties"]["OSVersion"]
build = data["MobileAssetProperties"]["Build"]
@@ -82,7 +82,7 @@ class CatalogProducts:
With macOS Sequoia, the Info.plist is no longer present in the InstallAssistant's assets
"""
_does_support_vmm = False
for entry in data["Assets"]:
if "SupportedDeviceModels" not in entry:
continue
@@ -94,6 +94,8 @@ class CatalogProducts:
if self.vmm_only:
continue
_does_support_vmm = True
build = entry["Build"]
version = entry["OSVersion"]
@@ -109,6 +111,10 @@ class CatalogProducts:
"Catalog": CatalogURL().catalog_url_to_seed(catalog_url),
}
if _does_support_vmm is False:
if self.vmm_only:
return {"Missing VMM Support": True}
return {}
@@ -325,9 +331,18 @@ class CatalogProducts:
if plist_contents:
if Path(package["URL"]).name == "Info.plist":
_product_map.update(self._legacy_parse_info_plist(plist_contents))
result = self._legacy_parse_info_plist(plist_contents)
else:
_product_map.update(self._parse_mobile_asset_plist(plist_contents))
result = self._parse_mobile_asset_plist(plist_contents)
if result == {"Missing VMM Support": True}:
_product_map = {}
break
_product_map.update(result)
if _product_map == {}:
continue
if _product_map["Version"] is not None:
_product_map["Title"] = self._build_installer_name(_product_map["Version"], _product_map["Catalog"])

View File

@@ -366,7 +366,7 @@ class HardwarePatchsetDetection:
logging.error("Stripping out Non-Metal GPUs")
for hardware in list(present_hardware):
if hardware.hardware_variant_graphics_subclass() == HardwareVariantGraphicsSubclass.NON_METAL_GRAPHICS:
print(f" Stripping out {hardware.name()}")
logging.info(f" Stripping out {hardware.name()}")
present_hardware.remove(hardware)
if metal_3802_gpu_present and metal_31001_gpu_present and self._xnu_major >= os_data.sequoia.value: