# HG changeset patch # User Tooru Fujisawa # Date 1540371840 -32400 # Node ID 561373eda70f3fafcbea47304fcdd106aba12a83 # Parent 579209e7f3a4d8456d533d59efb22581ff5801bb Bug 1492716 - Part 2.1: Support empty string in help formatting rule and fixed some more cases. r=glandium Differential Revision: https://phabricator.services.mozilla.com/D9631 diff --git a/build/moz.configure/android-ndk.configure b/build/moz.configure/android-ndk.configure --- a/build/moz.configure/android-ndk.configure +++ b/build/moz.configure/android-ndk.configure @@ -17,17 +17,17 @@ def min_android_version(target): if target.cpu in ['aarch64', 'x86_64', 'mips64']: # 64-bit support was added in API 21. return '21' return '9' js_option('--with-android-version', nargs=1, - help='android platform version', + help='android platform version{|}', default=min_android_version) @depends('--with-android-version', min_android_version, '--help') @imports(_from='__builtin__', _import='ValueError') def android_version(value, min_version, _): if not value: # Someone has passed --without-android-version. diff --git a/build/moz.configure/toolchain.configure b/build/moz.configure/toolchain.configure --- a/build/moz.configure/toolchain.configure +++ b/build/moz.configure/toolchain.configure @@ -3,18 +3,18 @@ # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. imply_option('--enable-release', mozilla_official) imply_option('--enable-release', depends_if('MOZ_AUTOMATION')(lambda x: True)) js_option('--enable-release', - help='Build with more conservative, release engineering-oriented ' - 'options. This may slow down builds.') + help='{Build|Do not build} with more conservative, release ' + 'engineering-oriented options.{ This may slow down builds.|}') @depends('--enable-release') def developer_options(value): if not value: return True diff --git a/python/mozbuild/mozbuild/configure/help.py b/python/mozbuild/mozbuild/configure/help.py --- a/python/mozbuild/mozbuild/configure/help.py +++ b/python/mozbuild/mozbuild/configure/help.py @@ -35,17 +35,17 @@ class HelpFormatter(object): if len(opt) > 24 or not help: target.append(' %s' % opt) if help: target.append('%s%s' % (' ' * 28, help)) else: target.append(' %-24s %s' % (opt, help)) - RE_FORMAT = re.compile(r'{([^|}]+)\|([^|}]+)}') + RE_FORMAT = re.compile(r'{([^|}]*)\|([^|}]*)}') # Return formatted help text for --{enable,disable,with,without}-* options. # # Format is the following syntax: # {String for --enable or --with|String for --disable or --without} # # For example, '{Enable|Disable} optimizations' will be formatted to # 'Enable optimizations' if the options's prefix is 'enable' or 'with', diff --git a/toolkit/moz.configure b/toolkit/moz.configure --- a/toolkit/moz.configure +++ b/toolkit/moz.configure @@ -440,17 +440,17 @@ set_config('MOZ_TREMOR', sample_type_is_ def eme_default(build_project, help): if build_project == 'browser': return 'widevine' option('--enable-eme', nargs='*', choices=('widevine',), default=eme_default, - help='Enable support for Encrypted Media Extensions') + help='{Enable|Disable} support for Encrypted Media Extensions') @depends('--enable-eme', target) def enable_eme(value, target): # Widevine EME by default enabled on desktop Windows, MacOS and Linux, # x86 and x64 builds. if (target.kernel in ('Darwin', 'WINNT', 'Linux') and target.os != 'Android' and target.cpu in ('x86', 'x86_64')):