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

Unified Diff: deps2git.py

Issue 619133002: deps2git: Add support for overriding DEPS vars (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/deps2git/
Patch Set: Changed to var_overrides Created 6 years, 2 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 | deps_utils.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: deps2git.py
===================================================================
--- deps2git.py (revision 292133)
+++ deps2git.py (working copy)
@@ -280,6 +280,11 @@
return results
+def convert_json(option, _, value, parser):
+ """Provide an OptionParser callback to unmarshal a JSON string."""
+ setattr(parser.values, option.dest, json.loads(value))
+
+
def main():
parser = optparse.OptionParser()
parser.add_option('-d', '--deps', default='DEPS',
@@ -300,6 +305,10 @@
help='top level of a gclient git cache diretory.')
parser.add_option('-s', '--shallow', action='store_true',
help='Use shallow checkouts when populating cache dirs.')
+ parser.add_option('--var_overrides', action='callback', callback=convert_json,
+ type='string', default=None,
+ help='A dict in JSON format containing key-value pairs '
+ 'that will override variables used in the DEPS file.')
parser.add_option('--no_fail_fast', action='store_true',
help='Try to process the whole DEPS, rather than failing '
'on the first bad entry.')
@@ -311,7 +320,7 @@
# Get the content of the DEPS file.
deps, deps_os, include_rules, skip_child_includes, hooks, deps_vars = (
- deps_utils.GetDepsContent(options.deps))
+ deps_utils.GetDepsContent(options.deps, options.var_overrides))
if options.extra_rules and options.type:
parser.error('Can\'t specify type and extra-rules at the same time.')
« no previous file with comments | « no previous file | deps_utils.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698