diff options
author | ojan@google.com <ojan@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-02-03 19:52:02 +0000 |
---|---|---|
committer | ojan@google.com <ojan@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-02-03 19:52:02 +0000 |
commit | 3334b7d18136ec0da16ea24e40373f2da75c0e4d (patch) | |
tree | 162e0eb2f607657aa1ce33360c6fa01eaadbfbe9 /tools/checkdeps | |
parent | 9007f5890d7fca32d8a5403581acd67ef975b806 (diff) | |
download | chromium_src-3334b7d18136ec0da16ea24e40373f2da75c0e4d.zip chromium_src-3334b7d18136ec0da16ea24e40373f2da75c0e4d.tar.gz chromium_src-3334b7d18136ec0da16ea24e40373f2da75c0e4d.tar.bz2 |
Use Vars for the webkit repo and revision number. This way
we can override the via custom_vars in .gclient on the bots
and official builds updates the merge script appropriately.
Also updates checkdeps to be Var-aware.
Review URL: http://codereview.chromium.org/19508
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@9098 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'tools/checkdeps')
-rwxr-xr-x | tools/checkdeps/checkdeps.py | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/tools/checkdeps/checkdeps.py b/tools/checkdeps/checkdeps.py index 4c00515..5ef4de3 100755 --- a/tools/checkdeps/checkdeps.py +++ b/tools/checkdeps/checkdeps.py @@ -241,18 +241,30 @@ def ApplyDirectoryRules(existing_rules, dir_name): print "Applying rules from", dir_name def FromImpl(unused): pass # NOP function so "From" doesn't fail. - scope = {"From": FromImpl} + + class _VarImpl: + def __init__(self, local_scope): + self._local_scope = local_scope + + def Lookup(self, var_name): + """Implements the Var syntax.""" + if var_name in self._local_scope.get("vars", {}): + return self._local_scope["vars"][var_name] + raise Error("Var is not defined: %s" % var_name) + + local_scope = {} + global_scope = {"From": FromImpl, "Var": _VarImpl(local_scope).Lookup} deps_file = os.path.join(dir_name, "DEPS") if not os.path.exists(deps_file): if VERBOSE: print " No deps file found in", dir_name return (existing_rules, []) # Nothing to change from the input rules. - execfile(deps_file, scope) + execfile(deps_file, global_scope, local_scope) - deps = scope.get(DEPS_VAR_NAME, {}) - include_rules = scope.get(INCLUDE_RULES_VAR_NAME, []) - skip_subdirs = scope.get(SKIP_SUBDIRS_VAR_NAME, []) + deps = local_scope.get(DEPS_VAR_NAME, {}) + include_rules = local_scope.get(INCLUDE_RULES_VAR_NAME, []) + skip_subdirs = local_scope.get(SKIP_SUBDIRS_VAR_NAME, []) return (ApplyRules(existing_rules, deps, include_rules, dir_name), skip_subdirs) |