Jack Rosenthal | 3c63a58 | 2023-06-15 11:28:18 -0600 | [diff] [blame] | 1 | # Copyright 2023 The ChromiumOS Authors |
Cindy Lin | c06b4ea | 2022-01-27 18:13:04 +0000 | [diff] [blame] | 2 | # Use of this source code is governed by a BSD-style license that can be |
| 3 | # found in the LICENSE file. |
| 4 | |
Jack Rosenthal | 3c63a58 | 2023-06-15 11:28:18 -0600 | [diff] [blame] | 5 | """Wrapper to call "cros build-packages". |
Cindy Lin | c06b4ea | 2022-01-27 18:13:04 +0000 | [diff] [blame] | 6 | |
Jack Rosenthal | 3c63a58 | 2023-06-15 11:28:18 -0600 | [diff] [blame] | 7 | Eventually, this script will hard-error instead of calling "cros build-packages" |
| 8 | after the notice. |
Cindy Lin | c06b4ea | 2022-01-27 18:13:04 +0000 | [diff] [blame] | 9 | """ |
| 10 | |
Alex Klein | fba23ba | 2022-02-03 11:58:48 -0700 | [diff] [blame] | 11 | import logging |
Jack Rosenthal | 3c63a58 | 2023-06-15 11:28:18 -0600 | [diff] [blame] | 12 | import sys |
| 13 | from typing import List, Optional |
Cindy Lin | c06b4ea | 2022-01-27 18:13:04 +0000 | [diff] [blame] | 14 | |
Cindy Lin | c06b4ea | 2022-01-27 18:13:04 +0000 | [diff] [blame] | 15 | from chromite.lib import cros_build_lib |
Jack Rosenthal | 3c63a58 | 2023-06-15 11:28:18 -0600 | [diff] [blame] | 16 | from chromite.scripts import cros |
Cindy Lin | c06b4ea | 2022-01-27 18:13:04 +0000 | [diff] [blame] | 17 | |
| 18 | |
Jack Rosenthal | 3c63a58 | 2023-06-15 11:28:18 -0600 | [diff] [blame] | 19 | def main(argv: Optional[List[str]]) -> Optional[int]: |
| 20 | """Wrapper main to call "cros build-packages".""" |
| 21 | argv = argv or sys.argv[1:] |
| 22 | new_argv = ["build-packages", *argv] |
| 23 | new_command_str = cros_build_lib.CmdToStr(["cros", *new_argv]) |
| 24 | logging.notice( |
| 25 | "build_packages has been renamed to `cros build-packages`. Please call" |
| 26 | f" as `{new_command_str}`. This will eventually turn into an error." |
Alex Klein | 1699fab | 2022-09-08 08:46:06 -0600 | [diff] [blame] | 27 | ) |
Jack Rosenthal | 3c63a58 | 2023-06-15 11:28:18 -0600 | [diff] [blame] | 28 | return cros.main(new_argv) |