blob: a79d3768385ff6ad6788b1136250856123e6f15f [file] [log] [blame]
Jack Rosenthal5d3f17c2023-06-16 14:15:59 -06001# Copyright 2023 The ChromiumOS Authors
Ram Chandrasekar913c0422022-05-09 23:41:22 +00002# Use of this source code is governed by a BSD-style license that can be
3# found in the LICENSE file.
4
Jack Rosenthal5d3f17c2023-06-16 14:15:59 -06005"""Wrapper to call "cros build-image".
Ram Chandrasekar913c0422022-05-09 23:41:22 +00006
Jack Rosenthal5d3f17c2023-06-16 14:15:59 -06007Eventually, this script will hard-error instead of calling "cros build-image"
8after the notice.
Ram Chandrasekar913c0422022-05-09 23:41:22 +00009"""
10
Jack Rosenthal5d3f17c2023-06-16 14:15:59 -060011import logging
Cindy Lin0abfec02022-09-01 18:25:30 +000012import sys
Jack Rosenthal5d3f17c2023-06-16 14:15:59 -060013from typing import List, Optional
Ram Chandrasekar913c0422022-05-09 23:41:22 +000014
Ram Chandrasekar913c0422022-05-09 23:41:22 +000015from chromite.lib import cros_build_lib
Jack Rosenthal5d3f17c2023-06-16 14:15:59 -060016from chromite.scripts import cros
Ram Chandrasekar355c8cc2022-05-24 23:10:30 +000017
18
Jack Rosenthal5d3f17c2023-06-16 14:15:59 -060019def main(argv: Optional[List[str]]) -> Optional[int]:
20 """Wrapper main to call "cros build-image"."""
21 argv = argv or sys.argv[1:]
22 new_argv = ["build-image", *argv]
23 new_command_str = cros_build_lib.CmdToStr(["cros", *new_argv])
24 logging.notice(
25 "build_image has been renamed to `cros build-image`. Please call"
26 f" as `{new_command_str}`. This will eventually turn into an error."
Alex Klein1699fab2022-09-08 08:46:06 -060027 )
Jack Rosenthal5d3f17c2023-06-16 14:15:59 -060028 return cros.main(new_argv)