Improved attempts to parse Catalina installer progress messages

This commit is contained in:
Greg Neagle
2020-02-18 15:28:37 -08:00
parent 5bbc657b87
commit d88a0a729f
+4 -3
View File
@@ -366,13 +366,14 @@ class StartOSInstallRunner(object):
startosinstall_output.append(info_output)
# parse output for useful progress info
msg = info_output.rstrip('\n\r')
msg = info_output.strip()
if msg.startswith('Preparing to '):
display.display_status_minor(msg)
elif msg.startswith('Preparing '):
elif msg.startswith(('Preparing ', 'Preparing: ')):
# percent-complete messages
percent_str = msg.split()[-1].rstrip('%')
try:
percent = int(float(msg[10:].rstrip().rstrip('.')))
percent = int(float(percent_str))
except ValueError:
percent = -1
display.display_percent_done(percent, 100)