import tempfile
import time
-TEMPORARY_DIRECTORY = '/var/tmp'
-
class Error(Exception):
def __init__(self, value):
self.value = value
BoolOption('docker_no_user'),
Option('docker_hub_repository'),
Option('flatpak_state_dir'),
- Option('parallel', multiprocessing.cpu_count()) ]
+ Option('parallel', multiprocessing.cpu_count()),
+ Option('temp', '/var/tmp')]
config_dir = '%s/.config' % os.path.expanduser('~')
if not os.path.exists(config_dir):
def command(c):
log_normal(c)
try:
- r = subprocess.run(shlex.split(c))
+ r = subprocess.run(c, shell=True)
if r.returncode != 0:
- raise Error(f'command {c} failed ({r.returncode})')
+ raise Error('command %s failed (%d)' % (c, r.returncode))
except Exception as e:
- raise Error(f'command {c} failed ({e})')
+ raise Error('command %s failed (%s)' % (c, e))
def command_and_read(c):
log_normal(c)
self.build_dependencies = True
if directory is None:
- self.directory = tempfile.mkdtemp('', 'tmp', TEMPORARY_DIRECTORY)
+ self.directory = tempfile.mkdtemp('', 'tmp', config.get('temp'))
self.rmdir = True
self.set('CCACHE_BASEDIR', os.path.realpath(self.directory))
self.set('CCACHE_NOHASHDIR', '')
elif status == 'success':
subprocess.run(['xcrun', 'stapler', 'staple', dmg])
return
+ elif status != "in progress":
+ print("Could not understand xcrun response")
+ print(p)
time.sleep(30)
raise Error("Notarization timed out")