Skip to content

Commit

Permalink
Merge pull request psychopy#6656 from peircej/PKG-better-info-during-…
Browse files Browse the repository at this point in the history
…code-sign

PKG: allow 5 attempts at hdiutil convert
  • Loading branch information
peircej committed Jul 2, 2024
2 parents 7b97587 + 64ae50e commit 31dd3a3
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions building/apple_sign.py
Original file line number Diff line number Diff line change
Expand Up @@ -361,15 +361,15 @@ def dmgCompress(self):
if Path(dmgFinalFilename).exists():
os.remove(dmgFinalFilename)

cmdStr = f"hdiutil convert {dmgFilename} " \
f"-format UDZO " \
f"-o {dmgFinalFilename}"
exitcode, output = subprocess.getstatusoutput(cmdStr)
print(output)
if exitcode != 0:
print(f'****Failed to compress {dmgFilename} to {dmgFinalFilename} (is it not ejected?) ****')
exit(1)
return dmgFinalFilename
cmdStr = f"hdiutil convert {dmgFilename} -format UDZO -o {dmgFinalFilename}"
for attemptN in range(5):
print(f"Attempt {attemptN}: {cmdStr}")
exitcode, output = subprocess.getstatusoutput(cmdStr)
print(output)
if exitcode == 0:
return dmgFinalFilename

raise RuntimeError(f'****Failed to compress {dmgFilename} to {dmgFinalFilename} (is it not ejected?) ****')


def main():
Expand Down Expand Up @@ -476,7 +476,7 @@ def main():
print(f'Signer.awaitNotarized()'); sys.stdout.flush()
signer.awaitNotarized()
print(f'Signer.staple(dmgFile)'); sys.stdout.flush()
signer.staple()
signer.staple(dmgFile)


if __name__ == "__main__":
Expand Down

0 comments on commit 31dd3a3

Please sign in to comment.