Utilities: Work around partial overwriting of text in macrecovery (#297)

Discovered on Windows PowerShell. Fixed by adding spaces at the end of the string.
This commit is contained in:
Mahas1 2021-11-03 19:59:25 +05:30 committed by GitHub
parent 20721dc99f
commit 80d09a602b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -223,7 +223,7 @@ def save_image(url, sess, filename='', dir=''):
size += len(chunk)
print('\r{} MBs downloaded...'.format(size / (2**20)), end='')
sys.stdout.flush()
print('\rDownload complete!')
print('\rDownload complete! ')
return os.path.join(dir, os.path.basename(filename))
@ -240,10 +240,10 @@ def verify_image(dmgpath, cnkpath):
if len(cnk) != cnksize:
raise RuntimeError('Invalid chunk {} size: expected {}, read {}'.format(cnkcount, cnksize, len(cnk)))
if hashlib.sha256(cnk).digest() != cnkhash:
raise RuntimeError('Invalid chunk {}: hash mismatch'.format(cnkcount))
raise RuntimeError('Invalid chunk {}: hash mismatch'.format(cnkcount))
if dmgf.read(1) != b'':
raise RuntimeError('Invalid image: larger than chunklist')
print('\rImage verification complete!')
print('\rImage verification complete! ')
def action_download(args):
"""