mirror of
https://github.com/grahampugh/macadmin-scripts.git
synced 2025-12-18 18:26:31 +00:00
Big Sur readiness
This commit is contained in:
parent
9d636923c1
commit
9f72d0c8e6
@ -56,6 +56,9 @@ DEFAULT_SUCATALOGS = {
|
|||||||
"19": "https://swscan.apple.com/content/catalogs/others/"
|
"19": "https://swscan.apple.com/content/catalogs/others/"
|
||||||
"index-10.15-10.14-10.13-10.12-10.11-10.10-10.9"
|
"index-10.15-10.14-10.13-10.12-10.11-10.10-10.9"
|
||||||
"-mountainlion-lion-snowleopard-leopard.merged-1.sucatalog",
|
"-mountainlion-lion-snowleopard-leopard.merged-1.sucatalog",
|
||||||
|
"20": "https://swscan.apple.com/content/catalogs/others/"
|
||||||
|
"index-10.16-10.15-10.14-10.13-10.12-10.11-10.10-10.9"
|
||||||
|
"-mountainlion-lion-snowleopard-leopard.merged-1.sucatalog",
|
||||||
}
|
}
|
||||||
|
|
||||||
SEED_CATALOGS_PLIST = (
|
SEED_CATALOGS_PLIST = (
|
||||||
@ -382,14 +385,12 @@ def replicate_url(
|
|||||||
if show_progress:
|
if show_progress:
|
||||||
options = "-fL"
|
options = "-fL"
|
||||||
else:
|
else:
|
||||||
options = '-sfL'
|
options = "-sfL"
|
||||||
curl_cmd = ['/usr/bin/curl', options,
|
curl_cmd = ["/usr/bin/curl", options, "--create-dirs", "-o", local_file_path]
|
||||||
'--create-dirs',
|
|
||||||
'-o', local_file_path]
|
|
||||||
if not full_url.endswith(".gz"):
|
if not full_url.endswith(".gz"):
|
||||||
# stupid hack for stupid Apple behavior where it sometimes returns
|
# stupid hack for stupid Apple behavior where it sometimes returns
|
||||||
# compressed files even when not asked for
|
# compressed files even when not asked for
|
||||||
curl_cmd.append('--compressed')
|
curl_cmd.append("--compressed")
|
||||||
if not ignore_cache and os.path.exists(local_file_path):
|
if not ignore_cache and os.path.exists(local_file_path):
|
||||||
curl_cmd.extend(["-z", local_file_path])
|
curl_cmd.extend(["-z", local_file_path])
|
||||||
if attempt_resume:
|
if attempt_resume:
|
||||||
@ -492,7 +493,9 @@ def get_board_ids(filename):
|
|||||||
supported_board_ids = ""
|
supported_board_ids = ""
|
||||||
with open(filename) as search:
|
with open(filename) as search:
|
||||||
for line in search:
|
for line in search:
|
||||||
line = line.decode("utf8").rstrip() # remove '\n' at end of line
|
if type(line) == bytes:
|
||||||
|
line = line.decode("utf8")
|
||||||
|
line = line.rstrip() # remove '\n' at end of line
|
||||||
# dist files for macOS 10.* list boardIDs whereas dist files for
|
# dist files for macOS 10.* list boardIDs whereas dist files for
|
||||||
# macOS 11.* list supportedBoardIDs
|
# macOS 11.* list supportedBoardIDs
|
||||||
if "boardIds" in line:
|
if "boardIds" in line:
|
||||||
@ -508,7 +511,9 @@ def get_device_ids(filename):
|
|||||||
supported_device_ids = ""
|
supported_device_ids = ""
|
||||||
with open(filename) as search:
|
with open(filename) as search:
|
||||||
for line in search:
|
for line in search:
|
||||||
line = line.decode("utf8").rstrip() # remove '\n' at end of line
|
if type(line) == bytes:
|
||||||
|
line = line.decode("utf8")
|
||||||
|
line = line.rstrip() # remove '\n' at end of line
|
||||||
if "supportedDeviceIDs" in line:
|
if "supportedDeviceIDs" in line:
|
||||||
supported_device_ids = line.lstrip("var supportedDeviceIDs = ")
|
supported_device_ids = line.lstrip("var supportedDeviceIDs = ")
|
||||||
return supported_device_ids
|
return supported_device_ids
|
||||||
@ -520,7 +525,9 @@ def get_unsupported_models(filename):
|
|||||||
unsupported_models = ""
|
unsupported_models = ""
|
||||||
with open(filename) as search:
|
with open(filename) as search:
|
||||||
for line in search:
|
for line in search:
|
||||||
line = line.decode("utf8").rstrip() # remove '\n' at end of line
|
if type(line) == bytes:
|
||||||
|
line = line.decode("utf8")
|
||||||
|
line = line.rstrip() # remove '\n' at end of line
|
||||||
if "nonSupportedModels" in line:
|
if "nonSupportedModels" in line:
|
||||||
unsupported_models = line.lstrip("var nonSupportedModels = ")
|
unsupported_models = line.lstrip("var nonSupportedModels = ")
|
||||||
return unsupported_models
|
return unsupported_models
|
||||||
@ -813,10 +820,12 @@ def main():
|
|||||||
bad_dirs = ["Documents", "Desktop", "Downloads", "Library"]
|
bad_dirs = ["Documents", "Desktop", "Downloads", "Library"]
|
||||||
for bad_dir in bad_dirs:
|
for bad_dir in bad_dirs:
|
||||||
if bad_dir in os.path.split(current_dir):
|
if bad_dir in os.path.split(current_dir):
|
||||||
print('Running this script from %s may not work as expected. '
|
print(
|
||||||
'If this does not run as expected, please run again from '
|
"Running this script from %s may not work as expected. "
|
||||||
'somewhere else, such as /Users/Shared.'
|
"If this does not run as expected, please run again from "
|
||||||
% current_dir, file=sys.stderr)
|
"somewhere else, such as /Users/Shared." % current_dir,
|
||||||
|
file=sys.stderr,
|
||||||
|
)
|
||||||
|
|
||||||
if args.catalogurl:
|
if args.catalogurl:
|
||||||
su_catalog_url = args.catalogurl
|
su_catalog_url = args.catalogurl
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user