Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1078)

Unified Diff: build/util/version.py

Issue 1838173005: Propagate is_official_build to version script. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/version.gni » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/util/version.py
diff --git a/build/util/version.py b/build/util/version.py
index 4d3691ae373dd139e6b49f488ffe6d8d98d9f0db..767412e93d1cdc02abbf0a2f6347c3c600ecb632 100755
--- a/build/util/version.py
+++ b/build/util/version.py
@@ -27,7 +27,7 @@ def fetch_values_from_file(values_dict, file_name):
values_dict[key] = val
-def fetch_values(file_list):
+def fetch_values(file_list, is_official_build=None):
"""
Returns a dictionary of values to be used for substitution, populating
the dictionary with KEYWORD=VALUE settings from the files in 'file_list'.
@@ -37,7 +37,7 @@ def fetch_values(file_list):
OFFICIAL_BUILD
"""
CHROME_BUILD_TYPE = os.environ.get('CHROME_BUILD_TYPE')
- if CHROME_BUILD_TYPE == '_official':
+ if CHROME_BUILD_TYPE == '_official' or is_official_build:
official_build = '1'
else:
official_build = '0'
@@ -113,6 +113,10 @@ def main():
help='Evaluate VAL after reading variables. Can be used '
'to synthesize variables. e.g. -e \'PATCH_HI=int('
'PATCH)/256.')
+ parser.add_argument('--official', action='store_true',
+ help='Whether the current build should be an official '
+ 'build, used in addition to the environment '
+ 'variable.')
parser.add_argument('args', nargs=argparse.REMAINDER,
help='For compatibility: INPUT and OUTPUT can be '
'passed as positional arguments.')
@@ -136,7 +140,7 @@ def main():
if options.args:
parser.error('Unexpected arguments: %r' % options.args)
- values = fetch_values(options.file)
+ values = fetch_values(options.file, options.official)
for key, val in evals.iteritems():
values[key] = str(eval(val, globals(), values))
« no previous file with comments | « no previous file | chrome/version.gni » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698