From d2d68fd08f4e395dfcbcd801ce9b9bbb9f2ecfd0 Mon Sep 17 00:00:00 2001 From: Mykola Grymalyuk Date: Sun, 30 Oct 2022 14:02:26 -0600 Subject: [PATCH] sys_patch.py: Ensure path is empty when moving --- resources/sys_patch.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/resources/sys_patch.py b/resources/sys_patch.py index baaa1b1b9..6b1342ae9 100644 --- a/resources/sys_patch.py +++ b/resources/sys_patch.py @@ -368,6 +368,8 @@ class PatchSysVolume: for file in Path("/Library/Extensions").glob("*.kext"): if datetime.fromtimestamp(file.stat().st_mtime) < datetime(2021, 10, 1): print(f" - Relocating {file.name} kext to {relocation_path}") + if Path(relocation_path) / Path(file.name).exists(): + utilities.elevated(["rm", "-Rf", relocation_path / Path(file.name)]) utilities.elevated(["mv", file, relocation_path]) def write_patchset(self, patchset):