X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=cdist;h=c9f15a0c79637afe9942ab79ad40a8d3009b2f82;hb=bf0c81dfceed2ce18d0e2d0d3386ef2486d84210;hp=dfada3fd230db224ee448d4b40c9053319c8f954;hpb=b71bd28259d6029e259d675249a88a3bbf5a631b;p=cdist.git diff --git a/cdist b/cdist index dfada3f..c9f15a0 100755 --- a/cdist +++ b/cdist @@ -256,9 +256,12 @@ def rmtree(a): def command(c): log_normal(c) - r = os.system(c) - if (r >> 8): - raise Error('command %s failed' % c) + try: + r = subprocess.run(shlex.split(c)) + if r.returncode != 0: + raise Error(f'command {c} failed ({r.returncode})') + except Exception as e: + raise Error(f'command {c} failed ({e})') def command_and_read(c): log_normal(c) @@ -734,14 +737,13 @@ def notarize(dmg, bundle_id): def string_after(process, key): lines = p.stdout.decode('utf-8').splitlines() - request_uuid = None for i in range(0, len(lines)): if lines[i].find(key) != -1: return lines[i+1].strip().replace('', '').replace('', '') - raise Error("Missing expected response %s from Apple" % key) - request_uuid = string_after(p, "RequestUUID") + if request_uuid is None: + raise Error('No RequestUUID found in response from Apple') for i in range(0, 30): print('Checking up on %s' % request_uuid) @@ -856,7 +858,7 @@ class SourceTarget(Target): 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')