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

Unified Diff: gclient.py

Issue 4154004: Fix custom_deps, hooks and custom_vars to be evaluated even if no DEPS file. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: Created 10 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 | tests/gclient_smoketest.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gclient.py
diff --git a/gclient.py b/gclient.py
index 94bb98a42bdb97e487c7ed3203a6fbffcf4946d2..0d1e2f93f2f950066e8969fc208cba195a067b1a 100644
--- a/gclient.py
+++ b/gclient.py
@@ -49,7 +49,7 @@ Hooks
]
"""
-__version__ = "0.6"
+__version__ = "0.6.1"
import copy
import logging
@@ -254,14 +254,6 @@ class Dependency(GClientKeywords, gclient_utils.WorkItem):
logging.debug('%s was already parsed' % self.name)
return
self.deps_parsed = True
- filepath = os.path.join(self.root_dir(), self.name, self.deps_file)
- if not os.path.isfile(filepath):
- logging.info('%s: No DEPS file found at %s' % (self.name, filepath))
- return
- deps_content = gclient_utils.FileRead(filepath)
- logging.debug(deps_content)
-
- # Eval the content.
# One thing is unintuitive, vars= {} must happen before Var() use.
local_scope = {}
var = self.VarImpl(self.custom_vars, local_scope)
@@ -271,10 +263,17 @@ class Dependency(GClientKeywords, gclient_utils.WorkItem):
'Var': var.Lookup,
'deps_os': {},
}
- try:
- exec(deps_content, global_scope, local_scope)
- except SyntaxError, e:
- gclient_utils.SyntaxErrorToError(filepath, e)
+ filepath = os.path.join(self.root_dir(), self.name, self.deps_file)
+ if not os.path.isfile(filepath):
+ logging.info('%s: No DEPS file found at %s' % (self.name, filepath))
+ else:
+ deps_content = gclient_utils.FileRead(filepath)
+ logging.debug(deps_content)
+ # Eval the content.
+ try:
+ exec(deps_content, global_scope, local_scope)
+ except SyntaxError, e:
+ gclient_utils.SyntaxErrorToError(filepath, e)
deps = local_scope.get('deps', {})
# load os specific dependencies if defined. these dependencies may
# override or extend the values defined by the 'deps' member.
@@ -283,9 +282,9 @@ class Dependency(GClientKeywords, gclient_utils.WorkItem):
os_deps = local_scope['deps_os'].get(deps_os_key, {})
if len(self.enforced_os()) > 1:
# Ignore any conflict when including deps for more than one
- # platform, so we collect the broadest set of dependencies available.
- # We may end up with the wrong revision of something for our
- # platform, but this is the best we can do.
+ # platform, so we collect the broadest set of dependencies
+ # available. We may end up with the wrong revision of something for
+ # our platform, but this is the best we can do.
deps.update([x for x in os_deps.items() if not x[0] in deps])
else:
deps.update(os_deps)
« no previous file with comments | « no previous file | tests/gclient_smoketest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698