deploy_chrome: Always test conditions and eliminate --strict
Currently we include conditions in the strict/sloppy logic
and vice versa, which is confusing and seems unnecessary.
This also simplifies the logic for strict and sloppy.
BUG=chromium:635374
TEST=./cbuildbot/run_tests scripts/deploy_chrome_unittest lib/chrome_util_unittest
Change-Id: I39f0d9afcc67a5daaeff6880192d6d54eaa83ea6
Reviewed-on: https://chromium-review.googlesource.com/368821
Commit-Ready: Steven Bennetts <stevenjb@chromium.org>
Tested-by: Steven Bennetts <stevenjb@chromium.org>
Reviewed-by: Steven Bennetts <stevenjb@chromium.org>
diff --git a/scripts/deploy_chrome.py b/scripts/deploy_chrome.py
index 8a9e110..104f070 100644
--- a/scripts/deploy_chrome.py
+++ b/scripts/deploy_chrome.py
@@ -406,10 +406,11 @@
group.add_argument('--staging-flags', default=None, type=ValidateGypDefines,
help=('Extra flags to control staging. Valid flags are - '
'%s' % ', '.join(chrome_util.STAGING_FLAGS)))
+ # TODO(stevenjb): Remove --strict entirely once removed from the ebuild.
group.add_argument('--strict', action='store_true', default=False,
- help='Stage artifacts based on the GYP_DEFINES '
- 'environment variable and --staging-flags, if set. '
- 'Enforce that all optional artifacts are deployed.')
+ help='Deprecated. Default behavior is "strict". Use '
+ '--sloppy to omit warnings for missing optional '
+ 'files.')
group.add_argument('--strip-flags', default=None,
help="Flags to call the 'strip' binutil tool with. "
"Overrides the default arguments.")
@@ -467,13 +468,10 @@
parser.error('Cannot specify both --gs-path and --local-pkg-path')
if not (options.staging_only or options.to):
parser.error('Need to specify --to')
- if (options.strict or options.staging_flags) and not options.build_dir:
- parser.error('--strict and --staging-flags require --build-dir to be '
- 'set.')
- if options.staging_flags and not options.strict:
- parser.error('--staging-flags requires --strict to be set.')
- if options.sloppy and options.strict:
- parser.error('Cannot specify both --strict and --sloppy.')
+ if options.staging_flags and not options.build_dir:
+ parser.error('--staging-flags require --build-dir to be set.')
+ if options.strict:
+ logging.warning('--strict is deprecated.')
if options.mount or options.mount_dir:
if not options.target_dir:
@@ -505,10 +503,6 @@
logging.debug('GYP_DEFINES taken from environment: %s',
options.gyp_defines)
- if options.strict and not options.gyp_defines:
- cros_build_lib.Die('When --strict is set, the GYP_DEFINES environment '
- 'variable must be set.')
-
if not options.staging_flags:
use_env = os.getenv('USE')
if use_env is not None:
@@ -584,7 +578,7 @@
strip_flags = (None if options.strip_flags is None else
shlex.split(options.strip_flags))
chrome_util.StageChromeFromBuildDir(
- staging_dir, options.build_dir, strip_bin, strict=options.strict,
+ staging_dir, options.build_dir, strip_bin,
sloppy=options.sloppy, gyp_defines=options.gyp_defines,
staging_flags=options.staging_flags,
strip_flags=strip_flags, copy_paths=copy_paths)