Skip to content

Commit

Permalink
Utilities: Work around partial overwriting of text in macrecovery (ac…
Browse files Browse the repository at this point in the history
…idanthera#297)

Discovered on Windows PowerShell. Fixed by adding spaces at the end of the string.
  • Loading branch information
Mahasvan authored Nov 3, 2021
1 parent 20721dc commit 80d09a6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Utilities/macrecovery/macrecovery.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))

Expand All @@ -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):
"""
Expand Down

0 comments on commit 80d09a6

Please sign in to comment.