| OLD | NEW |
| 1 # Copyright 2013 The Chromium Authors. All rights reserved. | 1 # Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 import json | 5 import json |
| 6 import optparse | 6 import optparse |
| 7 import os | 7 import os |
| 8 import subprocess | 8 import subprocess |
| 9 import sys | 9 import sys |
| 10 | 10 |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 return ['--factory-properties=%s' % json.dumps(options.factory_properties), | 89 return ['--factory-properties=%s' % json.dumps(options.factory_properties), |
| 90 '--build-properties=%s' % json.dumps(options.build_properties)] | 90 '--build-properties=%s' % json.dumps(options.build_properties)] |
| 91 | 91 |
| 92 | 92 |
| 93 def RunSteps(steps, step_cmds, options): | 93 def RunSteps(steps, step_cmds, options): |
| 94 unknown_steps = set(steps) - set(step for step, _ in step_cmds) | 94 unknown_steps = set(steps) - set(step for step, _ in step_cmds) |
| 95 if unknown_steps: | 95 if unknown_steps: |
| 96 print >> sys.stderr, 'FATAL: Unknown steps %s' % list(unknown_steps) | 96 print >> sys.stderr, 'FATAL: Unknown steps %s' % list(unknown_steps) |
| 97 sys.exit(1) | 97 sys.exit(1) |
| 98 | 98 |
| 99 exit_code = 0 |
| 99 for step, cmd in step_cmds: | 100 for step, cmd in step_cmds: |
| 100 if step in steps: | 101 if step in steps: |
| 101 cmd(options) | 102 exit_code = cmd(options) or exit_code |
| 103 |
| 104 return exit_code |
| OLD | NEW |