Cindy Lin | c06b4ea | 2022-01-27 18:13:04 +0000 | [diff] [blame] | 1 | # Copyright 2022 The Chromium OS Authors. All rights reserved. |
| 2 | # Use of this source code is governed by a BSD-style license that can be |
| 3 | # found in the LICENSE file. |
| 4 | |
| 5 | """build_packages updates the set of binary packages needed by Chrome OS. |
| 6 | |
| 7 | The build_packages process cross compiles all packages that have been |
| 8 | updated into the given sysroot and builds binary packages as a side-effect. |
| 9 | The output packages will be used by the build_image script to create a |
| 10 | bootable Chrome OS image. |
| 11 | """ |
| 12 | |
| 13 | import os |
| 14 | |
Alex Klein | a39dc98 | 2022-02-03 12:13:14 -0700 | [diff] [blame] | 15 | from chromite.lib import commandline |
Cindy Lin | c06b4ea | 2022-01-27 18:13:04 +0000 | [diff] [blame] | 16 | from chromite.lib import constants |
| 17 | from chromite.lib import cros_build_lib |
| 18 | |
| 19 | |
| 20 | def main(argv): |
Alex Klein | a39dc98 | 2022-02-03 12:13:14 -0700 | [diff] [blame] | 21 | commandline.RunInsideChroot() |
| 22 | |
Cindy Lin | c06b4ea | 2022-01-27 18:13:04 +0000 | [diff] [blame] | 23 | cmd = [ |
| 24 | 'bash', |
| 25 | os.path.join(constants.CROSUTILS_DIR, 'build_packages.sh'), |
| 26 | '--script-is-run-only-by-chromite-and-not-users' |
| 27 | ] |
| 28 | cmd.extend(argv) |
| 29 | try: |
Cindy Lin | e4b243a | 2022-02-04 22:15:37 +0000 | [diff] [blame^] | 30 | # TODO(b/187793559): Don't pass in print_cmd once we switch to argparse |
| 31 | cros_build_lib.dbg_run(cmd, print_cmd=False) |
Cindy Lin | c06b4ea | 2022-01-27 18:13:04 +0000 | [diff] [blame] | 32 | except cros_build_lib.RunCommandError as e: |
| 33 | cros_build_lib.Die(e) |