Rename ChromeSDK SDKFetcher. Defaults to not fetching base image.
1. Move to a model where the user of ChromeSDK specifies every component
they want to fetch. The class becomes a generic fetcher for SDK
components, not limited to Chrome, thus rename it to SDKFetcher.
2. %CHROME_SDK_* becomes %SDK_*.
3. Default to not fetching the base image, since it expands to 3G of
disk space, and no scripts currently use it. When 'cros chrome-flash'
requires the base image, it can use SDKFetcher to fetch it on demand.
BUG=None
TEST=unit tests. ran locally.
Change-Id: I0850e9944ebb923a8511642d2a4580f3fcab2c01
Reviewed-on: https://gerrit.chromium.org/gerrit/43353
Reviewed-by: David James <davidjames@chromium.org>
Commit-Queue: Ryan Cui <rcui@chromium.org>
Tested-by: Ryan Cui <rcui@chromium.org>
diff --git a/scripts/deploy_chrome.py b/scripts/deploy_chrome.py
index b0cd002..ab2a1ae 100644
--- a/scripts/deploy_chrome.py
+++ b/scripts/deploy_chrome.py
@@ -215,8 +215,8 @@
help='Skip all prompts (i.e., for disabling of rootfs '
'verification). This may result in the target '
'machine being rebooted.')
- parser.add_option('--board',
- default=os.environ.get(cros_chrome_sdk.SDK_BOARD_ENV),
+ sdk_board_env = os.environ.get(cros_chrome_sdk.SDKFetcher.SDK_BOARD_ENV)
+ parser.add_option('--board', default=sdk_board_env,
help="The board the Chrome build is targeted for. When in "
"a 'cros chrome-sdk' shell, defaults to the SDK "
"board.")
@@ -347,7 +347,7 @@
staging directory.
"""
if options.build_dir:
- sdk = cros_chrome_sdk.ChromeSDK(options.cache_dir, options.board)
+ sdk = cros_chrome_sdk.SDKFetcher(options.cache_dir, options.board)
components = (sdk.TARGET_TOOLCHAIN_KEY, constants.CHROME_ENV_TAR)
with sdk.Prepare(components=components) as ctx:
env_path = os.path.join(ctx.key_map[constants.CHROME_ENV_TAR].path,