mirror of
https://github.com/dortania/OpenCore-Legacy-Patcher.git
synced 2026-06-20 14:10:51 +10:00
sys_patch.py: Add additional error handling for LE
This commit is contained in:
+10
-5
@@ -366,11 +366,16 @@ class PatchSysVolume:
|
|||||||
utilities.elevated(["mkdir", relocation_path])
|
utilities.elevated(["mkdir", relocation_path])
|
||||||
|
|
||||||
for file in Path("/Library/Extensions").glob("*.kext"):
|
for file in Path("/Library/Extensions").glob("*.kext"):
|
||||||
if datetime.fromtimestamp(file.stat().st_mtime) < datetime(2021, 10, 1):
|
try:
|
||||||
print(f" - Relocating {file.name} kext to {relocation_path}")
|
if datetime.fromtimestamp(file.stat().st_mtime) < datetime(2021, 10, 1):
|
||||||
if Path(relocation_path) / Path(file.name).exists():
|
print(f" - Relocating {file.name} kext to {relocation_path}")
|
||||||
utilities.elevated(["rm", "-Rf", relocation_path / Path(file.name)])
|
if Path(relocation_path) / Path(file.name).exists():
|
||||||
utilities.elevated(["mv", file, relocation_path])
|
utilities.elevated(["rm", "-Rf", relocation_path / Path(file.name)])
|
||||||
|
utilities.elevated(["mv", file, relocation_path])
|
||||||
|
except:
|
||||||
|
# Some users have the most cursed /L*/E* folders
|
||||||
|
# ex. Symlinks pointing to symlinks pointing to dead files
|
||||||
|
pass
|
||||||
|
|
||||||
def write_patchset(self, patchset):
|
def write_patchset(self, patchset):
|
||||||
destination_path = f"{self.mount_location}/System/Library/CoreServices"
|
destination_path = f"{self.mount_location}/System/Library/CoreServices"
|
||||||
|
|||||||
Reference in New Issue
Block a user