mirror of
https://github.com/dortania/OpenCore-Legacy-Patcher.git
synced 2026-06-20 14:10:51 +10:00
sys_patch.py: Add partial download error handling
Closes https://github.com/dortania/OpenCore-Legacy-Patcher/issues/873
This commit is contained in:
@@ -709,15 +709,17 @@ set million colour before rebooting"""
|
|||||||
print("- Removing old Apple Binaries zip")
|
print("- Removing old Apple Binaries zip")
|
||||||
Path(self.constants.payload_apple_root_path_zip).unlink()
|
Path(self.constants.payload_apple_root_path_zip).unlink()
|
||||||
|
|
||||||
|
download_result = None
|
||||||
local_zip = Path(self.constants.payload_path) / f"{os_ver}.zip"
|
local_zip = Path(self.constants.payload_path) / f"{os_ver}.zip"
|
||||||
if Path(local_zip).exists():
|
if Path(local_zip).exists():
|
||||||
print(f"- Found local {os_ver} zip, skipping download")
|
print(f"- Found local {os_ver} zip, skipping download")
|
||||||
print(f"- Duplicating into Apple.zip")
|
print(f"- Duplicating into Apple.zip")
|
||||||
shutil.copy(local_zip, self.constants.payload_apple_root_path_zip)
|
shutil.copy(local_zip, self.constants.payload_apple_root_path_zip)
|
||||||
|
download_result = True
|
||||||
else:
|
else:
|
||||||
utilities.download_file(link, self.constants.payload_apple_root_path_zip)
|
download_result = utilities.download_file(link, self.constants.payload_apple_root_path_zip)
|
||||||
|
|
||||||
if self.constants.payload_apple_root_path_zip.exists():
|
if download_result and self.constants.payload_apple_root_path_zip.exists():
|
||||||
print("- Download completed")
|
print("- Download completed")
|
||||||
print("- Unzipping download...")
|
print("- Unzipping download...")
|
||||||
try:
|
try:
|
||||||
|
|||||||
Reference in New Issue
Block a user