Merge branch 'main' into ventura-alpha

# Conflicts:
#	resources/os_probe.py
This commit is contained in:
Mykola Grymalyuk
2022-08-19 15:43:23 -06:00
7 changed files with 58 additions and 7 deletions
+21 -1
View File
@@ -187,6 +187,7 @@ def only_list_newest_installers(available_apps):
for version in supported_versions:
remote_version_minor = 0
remote_version_security = 0
os_builds = []
# First determine the largest version
for ia in available_apps:
@@ -221,13 +222,25 @@ def only_list_newest_installers(available_apps):
remote_version.pop(0)
if int(remote_version[0]) < remote_version_minor:
available_apps.pop(ia)
elif int(remote_version[0]) == remote_version_minor:
continue
if int(remote_version[0]) == remote_version_minor:
if len(remote_version) > 1:
if int(remote_version[1]) < remote_version_security:
available_apps.pop(ia)
continue
else:
if remote_version_security > 0:
available_apps.pop(ia)
continue
# Remove duplicate builds
# ex. macOS 12.5.1 has 2 builds in the Software Update Catalog
# ref: https://twitter.com/classicii_mrmac/status/1560357471654379522
if available_apps[ia]["Build"] in os_builds:
available_apps.pop(ia)
continue
os_builds.append(available_apps[ia]["Build"])
return available_apps
@@ -372,6 +385,13 @@ def generate_installer_creation_script(tmp_location, installer_path, disk):
if utilities.check_filesystem_type() != "apfs":
# HFS+ disks do not support CoW
args[1] = "-R"
# Ensure we have enough space for the duplication
space_available = utilities.get_free_space()
space_needed = Path(ia_tmp).stat().st_size
if space_available < space_needed:
print("Not enough free space to create installer.sh")
print(f"{utilities.human_fmt(space_available)} available, {utilities.human_fmt(space_needed)} required")
return False
subprocess.run(args)
# Adjust installer_path to point to the copied installer