mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 01:58:19 +00:00
Retry hdiutil create if it fails (fixes #3711)
This commit is contained in:
parent
30d3aedc19
commit
8fc1fe3811
|
@ -4,6 +4,7 @@ import os
|
|||
import shlex
|
||||
import subprocess
|
||||
import tempfile
|
||||
import time
|
||||
|
||||
ConfigDmgtools = namedtuple('Config', 'dmg hfsplus newfs_hfs verbose')
|
||||
ConfigHdiutil = namedtuple('Config', 'hdiutil verbose')
|
||||
|
@ -72,7 +73,16 @@ class Hdiutil(Dmg):
|
|||
def create(self, dmg, volume_name, directory, symlinks):
|
||||
if symlinks:
|
||||
raise NotImplementedError("symlinks are not yet implemented")
|
||||
for i in range(5):
|
||||
try:
|
||||
self._hdiutil('create', '-volname', volume_name, '-srcdir', directory, dmg)
|
||||
except subprocess.CalledProcessError as e:
|
||||
if i == 4:
|
||||
raise e
|
||||
print("Retrying hdiutil create")
|
||||
time.sleep(5)
|
||||
else:
|
||||
break
|
||||
|
||||
def main():
|
||||
p = argparse.ArgumentParser(description="Manipulate dmg archives")
|
||||
|
|
Loading…
Reference in a new issue