Bug 1369630 - Fix `mach artifact toolchain --from-build` after
bug 1345863 and
bug 1351010. r?gps
The former removed the /opt from the toolchain job names, and the latter
made optimize_task() return a single value.
--- a/python/mozbuild/mozbuild/mach_commands.py
+++ b/python/mozbuild/mozbuild/mach_commands.py
@@ -1743,30 +1743,27 @@ class PackageFrontend(MachCommandBase):
for task in tasks
}
toolchains = tasks('toolchain')
for b in from_build:
user_value = b
- if '/' not in b:
- b = '{}/opt'.format(b)
-
if not b.startswith('toolchain-'):
b = 'toolchain-{}'.format(b)
task = toolchains.get(b)
if not task:
self.log(logging.ERROR, 'artifact', {'build': user_value},
'Could not find a toolchain build named `{build}`')
return 1
- optimized, task_id = optimize_task(task, {})
- if not optimized:
+ task_id = optimize_task(task, {})
+ if task_id in (True, False):
self.log(logging.ERROR, 'artifact', {'build': user_value},
'Could not find artifacts for a toolchain build '
'named `{build}`')
return 1
for artifact in list_artifacts(task_id):
name = artifact['name']
if not name.startswith('public/'):