mirror of
https://github.com/dortania/OpenCore-Legacy-Patcher.git
synced 2026-04-24 03:50:14 +10:00
detect.py: Avoid adding patches when hardware’s been removed
This commit is contained in:
@@ -459,7 +459,7 @@ class HardwarePatchsetDetection:
|
|||||||
if self._validation is False:
|
if self._validation is False:
|
||||||
present_hardware = self._strip_incompatible_hardware(present_hardware)
|
present_hardware = self._strip_incompatible_hardware(present_hardware)
|
||||||
|
|
||||||
# Second pass to gather all properties
|
# Second pass to determine requirements
|
||||||
for item in present_hardware:
|
for item in present_hardware:
|
||||||
item: BaseHardware
|
item: BaseHardware
|
||||||
device_properties[item.name()] = True
|
device_properties[item.name()] = True
|
||||||
@@ -478,8 +478,6 @@ class HardwarePatchsetDetection:
|
|||||||
if item.required_amfi_level() > highest_amfi_level:
|
if item.required_amfi_level() > highest_amfi_level:
|
||||||
highest_amfi_level = item.required_amfi_level()
|
highest_amfi_level = item.required_amfi_level()
|
||||||
|
|
||||||
patches.update(item.patches())
|
|
||||||
|
|
||||||
if self._validation is False:
|
if self._validation is False:
|
||||||
if requires_metallib_support_pkg is True:
|
if requires_metallib_support_pkg is True:
|
||||||
missing_metallib_support_pkg = not self._is_cached_metallib_support_pkg_present()
|
missing_metallib_support_pkg = not self._is_cached_metallib_support_pkg_present()
|
||||||
@@ -515,6 +513,13 @@ class HardwarePatchsetDetection:
|
|||||||
if requirements[HardwarePatchsetValidation.MISSING_NETWORK_CONNECTION] is True:
|
if requirements[HardwarePatchsetValidation.MISSING_NETWORK_CONNECTION] is True:
|
||||||
requirements, device_properties = self._handle_missing_network_connection(requirements, device_properties)
|
requirements, device_properties = self._handle_missing_network_connection(requirements, device_properties)
|
||||||
|
|
||||||
|
# Third pass to sync stripped hardware (ie. '_handle_missing_network_connection()')
|
||||||
|
for item in present_hardware:
|
||||||
|
item: BaseHardware
|
||||||
|
if item.name() not in device_properties:
|
||||||
|
continue
|
||||||
|
patches.update(item.patches())
|
||||||
|
|
||||||
_cant_patch = not self._can_patch(requirements)
|
_cant_patch = not self._can_patch(requirements)
|
||||||
|
|
||||||
requirements[HardwarePatchsetValidation.PATCHING_NOT_POSSIBLE] = _cant_patch
|
requirements[HardwarePatchsetValidation.PATCHING_NOT_POSSIBLE] = _cant_patch
|
||||||
|
|||||||
Reference in New Issue
Block a user