Attempt to parse 10.15's softwareupdate -l output

This commit is contained in:
Greg Neagle
2019-08-25 19:20:05 -07:00
parent 4c0449f513
commit 504c47283f
+9 -2
View File
@@ -168,9 +168,16 @@ def run(options_list, catalog_url=None, stop_allowed=False):
# --list-specific output
if mode == 'list':
if output.startswith(' * '):
if output.strip().startswith('*'):
# collect list of items available for install
update_entry = output[5:]
if output.startswith(' * '):
update_entry = output[5:]
elif output.startswith('* Label: '):
# seen in 10.15 betas
update_entry = output[9:]
else:
# unknown format
continue
update_parts = update_entry.split('-')
# version is the bit after the last hyphen
# (let's hope there are no hyphens in the versions!)