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)
- r = os.system(c)
- if (r >> 8):
- raise Error('command %s failed' % c)
+ try:
+ r = subprocess.run(c, shell=True)
+ if r.returncode != 0:
+ raise Error('command %s failed (%d)' % (c, r.returncode))
+ except Exception as 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")
def cleanup(self):
rmtree(self.directory)
- def package(self, project, checkout, output_dir, options):
+ def package(self, project, checkout, output_dir, options, no_notarize):
tree = globals.trees.get(project, checkout, self)
with TreeDirectory(tree):
name = read_wscript_variable(os.getcwd(), 'APPNAME')
parser_manual = subparsers.add_parser("manual", help="build the project's manual")
parser_doxygen = subparsers.add_parser("doxygen", help="build the project's Doxygen documentation")
parser_latest = subparsers.add_parser("latest", help="print out the latest version")
- parser_latest.add_argument('--latest-major', help='major version to return', type=int)
- parser_latest.add_argument('--latest-minor', help='minor version to return', type=int)
+ parser_latest.add_argument('--major', help='major version to return', type=int)
+ parser_latest.add_argument('--minor', help='minor version to return', type=int)
parser_test = subparsers.add_parser("test", help="build the project and run its unit tests")
parser_test.add_argument('--no-implicit-build', help='do not build first', action='store_true')
parser_test.add_argument('--test', help="name of test to run, defaults to all")
t = s[1]
if len(t) > 0 and t[0] == 'v':
v = Version(t[1:])
- if (args.latest_major is None or v.major == args.latest_major) and (args.latest_minor is None or v.minor == args.latest_minor):
+ if (args.major is None or v.major == args.major) and (args.minor is None or v.minor == args.minor):
latest = v
print(latest)